From a7f42fcc99ed512da6a7e8c01fa6ee1c16bc889a Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 26 Aug 2024 11:04:50 +0200 Subject: [PATCH] Compile zim-tools dependencies on Windows github CI. --- .github/scripts/build_definition.py | 2 +- kiwixbuild/dependencies/zim_tools.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/scripts/build_definition.py b/.github/scripts/build_definition.py index f2d5135..89692fa 100644 --- a/.github/scripts/build_definition.py +++ b/.github/scripts/build_definition.py @@ -22,7 +22,7 @@ BUILD_DEF = """ | manylinux | aarch64_mixed | BP | | | | | linux-aarch64-manylinux | | ---------------------------------------------------------------------------------------------------------------------------------------------- # On Windows, we build only libzim for now. And only native_mixed as xapian doesn't compile as dll - | windows | native_static | Bd | d | | d | | win-x86_64 | win-x86_64-static | + | windows | native_static | Bd | d | d | d | | win-x86_64 | win-x86_64-static | | windows | native_dyn | Bd | | | | | win-x86_64 | win-x86_64-dyn | | windows | native_mixed | BPd | d | | | Bd | win-x86_64 | win-x86_64-mixed | ---------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/kiwixbuild/dependencies/zim_tools.py b/kiwixbuild/dependencies/zim_tools.py index 9e677c8..1a0733c 100644 --- a/kiwixbuild/dependencies/zim_tools.py +++ b/kiwixbuild/dependencies/zim_tools.py @@ -1,4 +1,5 @@ from .base import Dependency, GitClone, MesonBuilder +from kiwixbuild._global import neutralEnv class ZimTools(Dependency): @@ -13,14 +14,17 @@ class ZimTools(Dependency): @classmethod def get_dependencies(cls, configInfo, allDeps): base_deps = ["libzim", "docoptcpp", "mustache"] - if configInfo.build != "win32": + if configInfo.build != "win32" and neutralEnv("distname") != "Windows": base_deps += ["libmagic", "gumbo"] return base_deps @property def configure_options(self): # We don't build zimwriterfs on win32, and so we don't have magic - if self.buildEnv.configInfo.build != "win32": + if ( + self.buildEnv.configInfo.build != "win32" + and neutralEnv("distname") != "Windows" + ): yield f"-Dmagic-install-prefix={self.buildEnv.install_dir}" if self.buildEnv.configInfo.static: yield "-Dstatic-linkage=true"