Merge pull request #715 from kiwix/win-xapian

This commit is contained in:
Matthieu Gautier 2024-08-18 12:10:18 +02:00 committed by GitHub
commit ad72464794
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 65 additions and 44 deletions

View File

@ -12,7 +12,7 @@ jobs:
runs-on: windows-latest runs-on: windows-latest
env: env:
OS_NAME: windows OS_NAME: windows
COMPILE_CONFIG: native_dyn COMPILE_CONFIG: native_mixed
HOME: 'C:\\Users\\runneradmin' HOME: 'C:\\Users\\runneradmin'
steps: steps:
- name: Checkout code - name: Checkout code

View File

@ -35,10 +35,10 @@ class NativeDyn(NativeConfigInfo):
class NativeStatic(NativeConfigInfo): class NativeStatic(NativeConfigInfo):
name = "native_static" name = "native_static"
static = True static = True
compatible_hosts = ["fedora", "debian", "Darwin", "almalinux"] compatible_hosts = ["fedora", "debian", "Darwin", "almalinux", "Windows"]
class NativeMixed(MixedMixin("native_static"), NativeConfigInfo): class NativeMixed(MixedMixin("native_static"), NativeConfigInfo):
name = "native_mixed" name = "native_mixed"
static = False static = False
compatible_hosts = ["fedora", "debian", "Darwin", "almalinux"] compatible_hosts = ["fedora", "debian", "Darwin", "almalinux", "Windows"]

View File

@ -14,7 +14,7 @@ class AllBaseDependencies(Dependency):
@classmethod @classmethod
def get_dependencies(cls, configInfo, allDeps): def get_dependencies(cls, configInfo, allDeps):
if neutralEnv("distname") == "Windows": 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": if configInfo.build == "wasm" or environ.get("OS_NAME") == "manylinux":
return ["zlib", "lzma", "zstd", "icu4c", "xapian-core"] return ["zlib", "lzma", "zstd", "icu4c", "xapian-core"]

View File

@ -39,6 +39,7 @@ class Icu(Dependency):
topdir=None, topdir=None,
name=self.source_dir, name=self.source_dir,
) )
if platform.system() != "Windows":
shutil.rmtree( shutil.rmtree(
pj(neutralEnv("source_dir"), self.source_dir, "source", "data") pj(neutralEnv("source_dir"), self.source_dir, "source", "data")
) )

View File

@ -23,7 +23,7 @@ class Libzim(Dependency):
@classmethod @classmethod
def get_dependencies(cls, configInfo, allDeps): def get_dependencies(cls, configInfo, allDeps):
if neutralEnv("distname") == "Windows": if neutralEnv("distname") == "Windows":
return ["zstd", "icu4c", "zim-testing-suite"] return ["zstd", "xapian-core", "icu4c", "zim-testing-suite"]
deps = ["lzma", "zstd", "xapian-core", "icu4c"] deps = ["lzma", "zstd", "xapian-core", "icu4c"]
if configInfo.name not in ("flatpak", "wasm"): if configInfo.name not in ("flatpak", "wasm"):
deps.append("zim-testing-suite") deps.append("zim-testing-suite")
@ -33,7 +33,7 @@ class Libzim(Dependency):
def configure_options(self): def configure_options(self):
configInfo = self.buildEnv.configInfo configInfo = self.buildEnv.configInfo
if neutralEnv("distname") == "Windows": if neutralEnv("distname") == "Windows":
yield "-Dwith_xapian=false" yield "-Dwith_xapian_fuller=false"
yield "-Dwerror=false" yield "-Dwerror=false"
if configInfo.build == "android": if configInfo.build == "android":
yield "-DUSE_BUFFER_HEADER=false" yield "-DUSE_BUFFER_HEADER=false"

View File

@ -1,12 +1,34 @@
from .base import Dependency, ReleaseDownload, MakeBuilder from .base import Dependency, GitClone, ReleaseDownload, MakeBuilder, MesonBuilder
from kiwixbuild.utils import Remotefile from kiwixbuild.utils import Remotefile
from kiwixbuild._global import neutralEnv from kiwixbuild._global import neutralEnv
import platform
class Xapian(Dependency): class Xapian(Dependency):
name = "xapian-core" name = "xapian-core"
if platform.system() == "Windows":
class Source(GitClone):
git_remote = "https://github.com/openzim/xapian-meson.git"
git_dir = "xapian-core"
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"]
else:
class Source(ReleaseDownload): class Source(ReleaseDownload):
archive = Remotefile( archive = Remotefile(
"xapian-core-1.4.23.tar.xz", "xapian-core-1.4.23.tar.xz",
@ -22,16 +44,14 @@ class Xapian(Dependency):
] ]
configure_env = { configure_env = {
"_format_LDFLAGS": "{env.LDFLAGS} -L{buildEnv.install_dir}/{buildEnv.libprefix}", "_format_LDFLAGS": "{env.LDFLAGS} -L{buildEnv.install_dir}/{buildEnv.libprefix}",
"_format_CXXFLAGS": "{env.CXXFLAGS} -O3 -I{buildEnv.install_dir}/include", "_format_CXXFLAGS": "{env.CXXFLAGS} -I{buildEnv.install_dir}/include",
} }
@classmethod @classmethod
def get_dependencies(cls, configInfo, allDeps): def get_dependencies(cls, configInfo, allDeps):
if neutralEnv("distname") == "Windows":
return ["zlib"]
deps = ["zlib", "lzma"] deps = ["zlib", "lzma"]
if ( if (
configInfo.build in ("win32", "wasm") configInfo.build in ("win32", "win64", "wasm")
or neutralEnv("distname") == "Darwin" or neutralEnv("distname") == "Darwin"
): ):
return deps return deps

View File

@ -39,7 +39,7 @@ release_versions = {
# This is the "version" of the whole base_deps_versions dict. # This is the "version" of the whole base_deps_versions dict.
# Change this when you change base_deps_versions. # Change this when you change base_deps_versions.
base_deps_meta_version = "01" base_deps_meta_version = "02"
base_deps_versions = { base_deps_versions = {
"zlib": "1.2.12", "zlib": "1.2.12",
@ -47,7 +47,7 @@ base_deps_versions = {
"zstd": "1.5.2", "zstd": "1.5.2",
"docoptcpp": "0.6.2", "docoptcpp": "0.6.2",
"uuid": "1.43.4", "uuid": "1.43.4",
"xapian-core": "1.4.23", "xapian-core": "1.4.26",
"mustache": "4.1", "mustache": "4.1",
"pugixml": "1.2", "pugixml": "1.2",
"libmicrohttpd": "0.9.76", "libmicrohttpd": "0.9.76",