Introduce winbash config and build xapian using it.
This commit is contained in:
parent
0085c0b7db
commit
676099fcc9
|
@ -1,3 +1,15 @@
|
||||||
from .base import *
|
from .base import *
|
||||||
|
|
||||||
from . import android, armhf, musl, flatpak, i586, ios, native, neutral, win32, wasm
|
from . import (
|
||||||
|
android,
|
||||||
|
armhf,
|
||||||
|
musl,
|
||||||
|
flatpak,
|
||||||
|
i586,
|
||||||
|
ios,
|
||||||
|
native,
|
||||||
|
neutral,
|
||||||
|
win32,
|
||||||
|
wasm,
|
||||||
|
winbash,
|
||||||
|
)
|
||||||
|
|
|
@ -0,0 +1,34 @@
|
||||||
|
from .base import ConfigInfo
|
||||||
|
import sysconfig
|
||||||
|
|
||||||
|
from kiwixbuild.utils import pj
|
||||||
|
from kiwixbuild._global import get_target_step
|
||||||
|
|
||||||
|
|
||||||
|
class WinBashConfigInfo(ConfigInfo):
|
||||||
|
"""This config is kind of internal config to compile xapian using git bash."""
|
||||||
|
|
||||||
|
name = "win_bash"
|
||||||
|
compatible_hosts = ["Windows"]
|
||||||
|
exe_wrapper_def = ""
|
||||||
|
|
||||||
|
@property
|
||||||
|
def arch_name(self):
|
||||||
|
return sysconfig.get_platform()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def config_wrapper(self):
|
||||||
|
yield "C:\\Program Files\\Git\\bin\\bash.exe"
|
||||||
|
|
||||||
|
@property
|
||||||
|
def binaries(self):
|
||||||
|
binaries = {
|
||||||
|
"CC": "cl -nologo",
|
||||||
|
"CXX": "cl -nologo",
|
||||||
|
"AR": "lib",
|
||||||
|
}
|
||||||
|
return binaries
|
||||||
|
|
||||||
|
def set_comp_flags(self, env):
|
||||||
|
super().set_comp_flags(env)
|
||||||
|
env["CXXFLAGS"] = "-EHsc -MD " + env["CXXFLAGS"]
|
|
@ -23,7 +23,12 @@ 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", "xapian-core"]
|
return [
|
||||||
|
"zstd",
|
||||||
|
"icu4c",
|
||||||
|
"zim-testing-suite",
|
||||||
|
("win_bash", "xapian-core"),
|
||||||
|
]
|
||||||
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")
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
from .base import Dependency, ReleaseDownload, MakeBuilder
|
from .base import Dependency, ReleaseDownload, MakeBuilder
|
||||||
|
|
||||||
from kiwixbuild.utils import Remotefile
|
from kiwixbuild.utils import Remotefile, pj
|
||||||
from kiwixbuild._global import neutralEnv
|
from kiwixbuild._global import neutralEnv
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,12 +14,24 @@ class Xapian(Dependency):
|
||||||
)
|
)
|
||||||
|
|
||||||
class Builder(MakeBuilder):
|
class Builder(MakeBuilder):
|
||||||
configure_options = [
|
@property
|
||||||
|
def configure_options(self):
|
||||||
|
if neutralEnv("distname") == "Windows":
|
||||||
|
compile_script = pj(self.source_path, "compile")
|
||||||
|
return [
|
||||||
|
'CC="cl -nologo"',
|
||||||
|
'CXX=f"{compile_script} cl -nologo"',
|
||||||
|
"CXXFLAGS=-EHsc",
|
||||||
|
"AR=lib",
|
||||||
|
]
|
||||||
|
else:
|
||||||
|
return [
|
||||||
"--disable-sse",
|
"--disable-sse",
|
||||||
"--disable-backend-chert",
|
"--disable-backend-chert",
|
||||||
"--disable-backend-remote",
|
"--disable-backend-remote",
|
||||||
"--disable-documentation",
|
"--disable-documentation",
|
||||||
]
|
]
|
||||||
|
|
||||||
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} -O3 -I{buildEnv.install_dir}/include",
|
||||||
|
|
Loading…
Reference in New Issue