From d3c275f349ce99488f88b66477533d2b069c9f93 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 21 Feb 2022 17:10:09 +0100 Subject: [PATCH] Install make --- .github/workflows/ci.yml | 2 +- kiwixbuild/buildenv.py | 5 +++++ kiwixbuild/dependencies/base.py | 10 +++++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3cdf9d2..9485794 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: chmod 600 $SSH_KEY - name: Install packages run: | - choco.exe install pkgconfiglite ninja + choco.exe install pkgconfiglite ninja make #- run: | #ls #libtoolize diff --git a/kiwixbuild/buildenv.py b/kiwixbuild/buildenv.py index 109e0e2..59d4aff 100644 --- a/kiwixbuild/buildenv.py +++ b/kiwixbuild/buildenv.py @@ -21,6 +21,9 @@ class PlatformNeutralEnv: self.log_dir): os.makedirs(d, exist_ok=True) self.detect_platform() + self.make_command = self._detect_make() + if not self.make_command: + sys.exit("ERROR: make command not found.") self.ninja_command = self._detect_ninja() if not self.ninja_command: sys.exit("ERROR: ninja command not found.") @@ -55,6 +58,8 @@ class PlatformNeutralEnv: if retcode == 0: return n + def _detect_make(self): + return self._detect_binary('make.exe', 'make') def _detect_ninja(self): return self._detect_binary('ninja', 'ninja-build') diff --git a/kiwixbuild/dependencies/base.py b/kiwixbuild/dependencies/base.py index 2601ea8..539e2d5 100644 --- a/kiwixbuild/dependencies/base.py +++ b/kiwixbuild/dependencies/base.py @@ -379,7 +379,8 @@ class MakeBuilder(Builder): def _compile(self, context): context.try_skip(self.build_path) - command = "make -j4 {make_target} {make_option}".format( + command = "{command} -j4 {make_target} {make_option}".format( + command=neutralEnv('make_command'), make_target=self.make_target, make_option=self.make_option ) @@ -388,7 +389,8 @@ class MakeBuilder(Builder): def _install(self, context): context.try_skip(self.build_path) - command = "make {make_install_target} {make_option}".format( + command = "{command} {make_install_target} {make_option}".format( + command=neutralEnv('make_command'), make_install_target=self.make_install_target, make_option=self.make_option ) @@ -397,7 +399,9 @@ class MakeBuilder(Builder): def _make_dist(self, context): context.try_skip(self.build_path) - command = "make dist" + command = "{command} dist".format( + command=neutralEnv('make_command'), + ) env = self.get_env(cross_comp_flags=True, cross_compilers=True, cross_path=True) run_command(command, self.build_path, context, env=env)