Files
kiwix-build/kiwixbuild/dependencies/icu4c.py
Matthieu Gautier 180fb249f6 Add a support to compile libzim for wasm.
`icu4c_wasm.patch` is build by :
 - Copying config.sub from liblzma source as new version of config.sub there
   knows about wasm architecture.
 - Copying `mh-linux` on `mh-unknown` as specified in (origin) `mh-unknown`.
   This is because icu4c configure doesn't detect `emscripten` platform and
   "fallback" to `mh-unknown`.
2022-11-16 16:37:05 +01:00

50 lines
1.8 KiB
Python

from .base import (
Dependency,
ReleaseDownload,
MakeBuilder
)
from kiwixbuild.utils import SkipCommand, Remotefile
from kiwixbuild._global import get_target_step
class Icu(Dependency):
name = "icu4c"
class Source(ReleaseDownload):
archive = Remotefile('icu4c_svn_58-2.tar.gz',
'fd8fcc1f1b8b2b71b879e88844480ebec107189c21076c81573f71dca5686a0d')
patches = ["icu4c_fix_static_lib_name_mingw.patch",
"icu4c_android_elf64_st_info.patch",
"icu4c_custom_data.patch",
"icu4c_noxlocale.patch",
"icu4c_rpath.patch",
"icu4c_build_config.patch",
"icu4c_wasm.patch"
]
class Builder(MakeBuilder):
subsource_dir = "source"
make_install_target = "install"
@classmethod
def get_dependencies(cls, platformInfo, allDeps):
plt = 'native_static' if platformInfo.static else 'native_dyn'
return [(plt, 'icu4c')]
@property
def configure_option(self):
options = ("--disable-samples --disable-tests --disable-extras "
"--disable-dyload --enable-rpath "
"--disable-icuio --disable-layoutex")
platformInfo = self.buildEnv.platformInfo
if platformInfo.build != 'native':
icu_native_builder = get_target_step(
'icu4c',
'native_static' if platformInfo.static else 'native_dyn')
options += " --with-cross-build={} --disable-tools".format(
icu_native_builder.build_path)
if platformInfo.build in ('android', 'wasm'):
options += " --with-data-packaging=archive"
return options