From 1cafcbf412e5af6fe265519995c788ce649717aa Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 5 May 2021 15:06:35 +0200 Subject: [PATCH 1/2] Get the "source" `zim-testing-suite` step. The source step (install source) always exists. The `plaformInfo.name` step may not exists (On mixed target, we build all deps static and the last project dyn) So the `native_dyn` doesn't exists for `zim-testing-suite`. --- kiwixbuild/dependencies/libzim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kiwixbuild/dependencies/libzim.py b/kiwixbuild/dependencies/libzim.py index 58b166c..40aed27 100644 --- a/kiwixbuild/dependencies/libzim.py +++ b/kiwixbuild/dependencies/libzim.py @@ -20,7 +20,7 @@ class Libzim(Dependency): @property def configure_option(self): platformInfo = self.buildEnv.platformInfo - zim_testing_suite = get_target_step('zim-testing-suite', platformInfo.name) + zim_testing_suite = get_target_step('zim-testing-suite', 'source') config_options = ['-Dtest_data_dir={}'.format(zim_testing_suite.source_path)] if platformInfo.build == 'android': config_options.append("-DUSE_BUFFER_HEADER=false") From 7dcf57e32baf7b7c7ba31a2fcfc70cb384e32499 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 5 May 2021 15:07:29 +0200 Subject: [PATCH 2/2] Do not download zim-testing-suite when building in flatpak. --- kiwixbuild/dependencies/libzim.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/kiwixbuild/dependencies/libzim.py b/kiwixbuild/dependencies/libzim.py index 40aed27..8c9ecfe 100644 --- a/kiwixbuild/dependencies/libzim.py +++ b/kiwixbuild/dependencies/libzim.py @@ -14,14 +14,19 @@ class Libzim(Dependency): class Builder(MesonBuilder): test_option = "-t 8" - dependencies = ['lzma', 'zstd', 'xapian-core', 'icu4c', 'zim-testing-suite'] strip_option = '' + @classmethod + def get_dependencies(cls, platformInfo, allDeps): + deps = ['lzma', 'zstd', 'xapian-core', 'icu4c'] + if platformInfo.build != 'flatpak': + deps.append('zim-testing-suite') + return deps + @property def configure_option(self): platformInfo = self.buildEnv.platformInfo - zim_testing_suite = get_target_step('zim-testing-suite', 'source') - config_options = ['-Dtest_data_dir={}'.format(zim_testing_suite.source_path)] + config_options = [] if platformInfo.build == 'android': config_options.append("-DUSE_BUFFER_HEADER=false") if platformInfo.build == 'iOS': @@ -30,4 +35,8 @@ class Libzim(Dependency): config_options.append("-Dstatic-linkage=true") if platformInfo.name == "flatpak": config_options.append("--wrap-mode=nodownload") + config_options.append("-Dtest_data_dir=none") + else: + zim_testing_suite = get_target_step('zim-testing-suite', 'source') + config_options.append('-Dtest_data_dir={}'.format(zim_testing_suite.source_path)) return " ".join(config_options)