diff --git a/kiwixbuild/dependencies/base.py b/kiwixbuild/dependencies/base.py index c0d6e93..a9136ec 100644 --- a/kiwixbuild/dependencies/base.py +++ b/kiwixbuild/dependencies/base.py @@ -283,6 +283,8 @@ class Builder: if hasattr(self, '_pre_build_script'): self.command('pre_build_script', self._pre_build_script) self.command('configure', self._configure) + if hasattr(self, '_post_configure_script'): + self.command('post_configure_script', self._post_configure_script) self.command('compile', self._compile) if hasattr(self, '_test'): self.command('test', self._test) diff --git a/kiwixbuild/dependencies/icu4c.py b/kiwixbuild/dependencies/icu4c.py index b5a1e6d..dfeabcd 100644 --- a/kiwixbuild/dependencies/icu4c.py +++ b/kiwixbuild/dependencies/icu4c.py @@ -7,6 +7,7 @@ from .base import ( from kiwixbuild.utils import pj, SkipCommand, Remotefile, extract_archive from kiwixbuild._global import get_target_step, neutralEnv import os, shutil +import fileinput class Icu(Dependency): name = "icu4c" @@ -77,3 +78,13 @@ class Icu(Dependency): def set_env(self, env): env['ICU_DATA_FILTER_FILE'] = pj(os.path.dirname(os.path.realpath(__file__)), "icu4c_data_filter.json") + + def _post_configure_script(self, context): + if self.buildEnv.platformInfo.build != "wasm": + context.skip() + context.try_skip(self.build_path) + for line in fileinput.input(pj(self.build_path, 'Makefile'), inplace=True): + if line == "#DATASUBDIR = data\n": + print("DATASUBDIR = data") + else: + print(line, end="") diff --git a/kiwixbuild/utils.py b/kiwixbuild/utils.py index 0c5d4ec..c0c0b4a 100644 --- a/kiwixbuild/utils.py +++ b/kiwixbuild/utils.py @@ -189,6 +189,9 @@ class Context: self.autoskip_file = None self.no_skip = False + def skip(self, msg=""): + raise SkipCommand(msg) + def try_skip(self, path, extra_name=""): if self.no_skip: return