diff --git a/MANIFEST.in b/MANIFEST.in index ace80097..4b999f7a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,3 @@ include kiwixbuild/templates/*_cross_file.txt include kiwixbuild/patches/*.patch +include kiwixbuild/dependencies/icu4c_data_filter.json diff --git a/kiwixbuild/dependencies/icu4c.py b/kiwixbuild/dependencies/icu4c.py index f9425d19..b45c4354 100644 --- a/kiwixbuild/dependencies/icu4c.py +++ b/kiwixbuild/dependencies/icu4c.py @@ -4,16 +4,41 @@ MakeBuilder ) -from kiwixbuild.utils import SkipCommand, Remotefile -from kiwixbuild._global import get_target_step +from kiwixbuild.utils import pj, SkipCommand, Remotefile, extract_archive +from kiwixbuild._global import get_target_step, neutralEnv +import os, shutil class Icu(Dependency): name = "icu4c" class Source(ReleaseDownload): - archive = Remotefile('icu4c-73_2-src.tgz', - '818a80712ed3caacd9b652305e01afc7fa167e6f2e94996da44b90c2ab604ce1', - 'https://github.com/unicode-org/icu/releases/download/release-73-2/icu4c-73_2-src.tgz') + archive_src = Remotefile('icu4c-73_2-src.tgz', + '818a80712ed3caacd9b652305e01afc7fa167e6f2e94996da44b90c2ab604ce1', + 'https://github.com/unicode-org/icu/releases/download/release-73-2/icu4c-73_2-src.tgz') + archive_data = Remotefile('icu4c-73_2-data.zip', + 'ca1ee076163b438461e484421a7679fc33a64cd0a54f9d4b401893fa1eb42701', + 'https://github.com/unicode-org/icu/releases/download/release-73-2/icu4c-73_2-data.zip') + + + archives = [archive_src, archive_data] + + def _extract(self, context): + context.try_skip(self.extract_path) + if os.path.exists(self.extract_path): + shutil.rmtree(self.extract_path) + extract_archive( + pj(neutralEnv('archive_dir'), self.archive_src.name), + neutralEnv('source_dir'), + topdir=None, + name=self.source_dir) + shutil.rmtree(pj(neutralEnv('source_dir'), self.source_dir, 'source', 'data')) + extract_archive( + pj(neutralEnv('archive_dir'), self.archive_data.name), + pj(neutralEnv('source_dir'), self.source_dir, 'source'), + topdir='data', + name='data' + ) + patches = [ "icu4c_fix_static_lib_name_mingw.patch", # "icu4c_android_elf64_st_info.patch", @@ -49,3 +74,6 @@ def configure_option(self): if platformInfo.build in ('android', 'wasm'): options += " --with-data-packaging=archive" return options + + def set_env(self, env): + env['ICU_DATA_FILTER_FILE'] = pj(os.path.dirname(os.path.realpath(__file__)), "icu4c_data_filter.json") diff --git a/kiwixbuild/dependencies/icu4c_data_filter.json b/kiwixbuild/dependencies/icu4c_data_filter.json new file mode 100644 index 00000000..820f0df2 --- /dev/null +++ b/kiwixbuild/dependencies/icu4c_data_filter.json @@ -0,0 +1,14 @@ +{ + "strategy": "additive", + "featureFilters": { + "lang_tree": "include", + "locales_tree": "include", + "translit": "include", + "misc": { + "includelist": [ + "likelySubtags", + "metadata" + ] + } + } +} diff --git a/kiwixbuild/versions.py b/kiwixbuild/versions.py index 4e6bb677..f599cd2c 100644 --- a/kiwixbuild/versions.py +++ b/kiwixbuild/versions.py @@ -39,7 +39,7 @@ # This is the "version" of the whole base_deps_versions dict. # Change this when you change base_deps_versions. -base_deps_meta_version = '93' +base_deps_meta_version = '94' base_deps_versions = { 'zlib' : '1.2.12',