diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9303d68..75db2da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: windows-latest env: OS_NAME: windows - COMPILE_CONFIG: native_dyn + COMPILE_CONFIG: native_mixed HOME: 'C:\\Users\\runneradmin' steps: - name: Checkout code diff --git a/kiwixbuild/configs/native.py b/kiwixbuild/configs/native.py index 20c55a5..3da055a 100644 --- a/kiwixbuild/configs/native.py +++ b/kiwixbuild/configs/native.py @@ -35,10 +35,10 @@ class NativeDyn(NativeConfigInfo): class NativeStatic(NativeConfigInfo): name = "native_static" static = True - compatible_hosts = ["fedora", "debian", "Darwin", "almalinux"] + compatible_hosts = ["fedora", "debian", "Darwin", "almalinux", "Windows"] class NativeMixed(MixedMixin("native_static"), NativeConfigInfo): name = "native_mixed" static = False - compatible_hosts = ["fedora", "debian", "Darwin", "almalinux"] + compatible_hosts = ["fedora", "debian", "Darwin", "almalinux", "Windows"] diff --git a/kiwixbuild/dependencies/all_dependencies.py b/kiwixbuild/dependencies/all_dependencies.py index 1894f57..25dba4f 100644 --- a/kiwixbuild/dependencies/all_dependencies.py +++ b/kiwixbuild/dependencies/all_dependencies.py @@ -14,7 +14,7 @@ class AllBaseDependencies(Dependency): @classmethod def get_dependencies(cls, configInfo, allDeps): if neutralEnv("distname") == "Windows": - return ["zlib", "zstd", "icu4c", "zim-testing-suite"] + return ["zlib", "zstd", "icu4c", "zim-testing-suite", "xapian-core"] if configInfo.build == "wasm" or environ.get("OS_NAME") == "manylinux": return ["zlib", "lzma", "zstd", "icu4c", "xapian-core"] diff --git a/kiwixbuild/dependencies/icu4c.py b/kiwixbuild/dependencies/icu4c.py index 689d415..b3dfaaa 100644 --- a/kiwixbuild/dependencies/icu4c.py +++ b/kiwixbuild/dependencies/icu4c.py @@ -39,15 +39,16 @@ class Icu(Dependency): 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", - ) + if platform.system() != "Windows": + 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", + ) extract_archive( pj(neutralEnv("archive_dir"), self.meson_patch.name), neutralEnv("source_dir"), diff --git a/kiwixbuild/dependencies/libzim.py b/kiwixbuild/dependencies/libzim.py index 4928c94..cb5adcf 100644 --- a/kiwixbuild/dependencies/libzim.py +++ b/kiwixbuild/dependencies/libzim.py @@ -23,7 +23,7 @@ class Libzim(Dependency): @classmethod def get_dependencies(cls, configInfo, allDeps): if neutralEnv("distname") == "Windows": - return ["zstd", "icu4c", "zim-testing-suite"] + return ["zstd", "xapian-core", "icu4c", "zim-testing-suite"] deps = ["lzma", "zstd", "xapian-core", "icu4c"] if configInfo.name not in ("flatpak", "wasm"): deps.append("zim-testing-suite") @@ -33,7 +33,7 @@ class Libzim(Dependency): def configure_options(self): configInfo = self.buildEnv.configInfo if neutralEnv("distname") == "Windows": - yield "-Dwith_xapian=false" + yield "-Dwith_xapian_fuller=false" yield "-Dwerror=false" if configInfo.build == "android": yield "-DUSE_BUFFER_HEADER=false" diff --git a/kiwixbuild/dependencies/xapian.py b/kiwixbuild/dependencies/xapian.py index 252d2c2..e49289f 100644 --- a/kiwixbuild/dependencies/xapian.py +++ b/kiwixbuild/dependencies/xapian.py @@ -1,38 +1,58 @@ -from .base import Dependency, ReleaseDownload, MakeBuilder +from .base import Dependency, GitClone, ReleaseDownload, MakeBuilder, MesonBuilder from kiwixbuild.utils import Remotefile from kiwixbuild._global import neutralEnv +import platform + class Xapian(Dependency): name = "xapian-core" - class Source(ReleaseDownload): - archive = Remotefile( - "xapian-core-1.4.23.tar.xz", - "30d3518172084f310dab86d262b512718a7f9a13635aaa1a188e61dc26b2288c", - ) + if platform.system() == "Windows": - class Builder(MakeBuilder): - configure_options = [ - "--disable-sse", - "--disable-backend-chert", - "--disable-backend-remote", - "--disable-documentation", - ] - configure_env = { - "_format_LDFLAGS": "{env.LDFLAGS} -L{buildEnv.install_dir}/{buildEnv.libprefix}", - "_format_CXXFLAGS": "{env.CXXFLAGS} -O3 -I{buildEnv.install_dir}/include", - } + class Source(GitClone): + git_remote = "https://github.com/openzim/xapian-meson.git" + git_dir = "xapian-core" - @classmethod - def get_dependencies(cls, configInfo, allDeps): - if neutralEnv("distname") == "Windows": + class Builder(MesonBuilder): + configure_options = [ + "-Denable-sse=false", + "-Denable-backend-chert=false", + "-Denable-backend-remote=false", + ] + subsource_dir = "xapian-core" + + @classmethod + def get_dependencies(cls, configInfo, allDeps): return ["zlib"] - deps = ["zlib", "lzma"] - if ( - configInfo.build in ("win32", "wasm") - or neutralEnv("distname") == "Darwin" - ): - return deps - return deps + ["uuid"] + + else: + + class Source(ReleaseDownload): + archive = Remotefile( + "xapian-core-1.4.23.tar.xz", + "30d3518172084f310dab86d262b512718a7f9a13635aaa1a188e61dc26b2288c", + ) + + class Builder(MakeBuilder): + configure_options = [ + "--disable-sse", + "--disable-backend-chert", + "--disable-backend-remote", + "--disable-documentation", + ] + configure_env = { + "_format_LDFLAGS": "{env.LDFLAGS} -L{buildEnv.install_dir}/{buildEnv.libprefix}", + "_format_CXXFLAGS": "{env.CXXFLAGS} -I{buildEnv.install_dir}/include", + } + + @classmethod + def get_dependencies(cls, configInfo, allDeps): + deps = ["zlib", "lzma"] + if ( + configInfo.build in ("win32", "win64", "wasm") + or neutralEnv("distname") == "Darwin" + ): + return deps + return deps + ["uuid"] diff --git a/kiwixbuild/versions.py b/kiwixbuild/versions.py index 0fdc9bd..d78bb2a 100644 --- a/kiwixbuild/versions.py +++ b/kiwixbuild/versions.py @@ -39,7 +39,7 @@ release_versions = { # This is the "version" of the whole base_deps_versions dict. # Change this when you change base_deps_versions. -base_deps_meta_version = "01" +base_deps_meta_version = "02" base_deps_versions = { "zlib": "1.2.12", @@ -47,7 +47,7 @@ base_deps_versions = { "zstd": "1.5.2", "docoptcpp": "0.6.2", "uuid": "1.43.4", - "xapian-core": "1.4.23", + "xapian-core": "1.4.26", "mustache": "4.1", "pugixml": "1.2", "libmicrohttpd": "0.9.76",