diff --git a/.github/scripts/build_definition.py b/.github/scripts/build_definition.py index 844e4fb..7a38f2e 100644 --- a/.github/scripts/build_definition.py +++ b/.github/scripts/build_definition.py @@ -61,8 +61,6 @@ BUILD_DEF = """ | | aarch64_musl_dyn | d | | B | B | | | linux-aarch64-musl-dyn | | | x86-64_musl_static | | | BP | BP | | linux-x86_64-musl | | | | x86-64_musl_mixed | BP | | | | | linux-x86_64-musl | | - | | win32_static | d | dB | dBP | dBP | | win-i686 |win32-static | - | | win32_dyn | d | dB | dB | dB | | |win32-dyn | | | i586_static | | | BP | BP | | linux-i586 | | | | i586_dyn | | | B | B | | | | | | wasm | dBP | | | | | wasm-emscripten | wasm | diff --git a/.github/scripts/common.py b/.github/scripts/common.py index bc93a5c..a8c5103 100644 --- a/.github/scripts/common.py +++ b/.github/scripts/common.py @@ -49,7 +49,7 @@ if platform.system() == "Windows": BIN_EXT = ".exe" else: KBUILD_SOURCE_DIR = HOME / "kiwix-build" - BIN_EXT = ".exe" if COMPILE_CONFIG.startswith("win32_") else "" + BIN_EXT = "" _ref = _environ.get("GITHUB_REF", "").split("/")[-1] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe4c020..58db577 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,10 +107,6 @@ jobs: image_variant: manylinux - config: aarch64_mixed image_variant: manylinux - - config: win32_static - image_variant: f35 - - config: win32_dyn - image_variant: f35 env: HOME: /home/runner SSH_KEY: /tmp/id_rsa diff --git a/.github/workflows/releaseNigthly.yml b/.github/workflows/releaseNigthly.yml index 8d1f287..e9bd2b9 100644 --- a/.github/workflows/releaseNigthly.yml +++ b/.github/workflows/releaseNigthly.yml @@ -131,8 +131,6 @@ jobs: image_variant: manylinux - config: aarch64_mixed image_variant: manylinux - - config: win32_static - image_variant: f35 env: HOME: /home/runner SSH_KEY: /tmp/id_rsa diff --git a/README.md b/README.md index 1ba27ed..ec248bf 100644 --- a/README.md +++ b/README.md @@ -89,8 +89,6 @@ platforms: - native_dyn - native_mixed - native_static -- win32_dyn -- win32_static - android - android_arm - android_arm64 @@ -101,11 +99,6 @@ platforms: All `native_*` config means using the native compiler without any cross-compilation option. Other may simply use cross-compilation or may download a specific toolchain to use. -If you want to compile `kiwix-tools` for win32 using static linkage: -```bash -kiwix-build --config win32_dyn -``` - Android ------- diff --git a/kiwixbuild/configs/__init__.py b/kiwixbuild/configs/__init__.py index e82de4d..d2a8b25 100644 --- a/kiwixbuild/configs/__init__.py +++ b/kiwixbuild/configs/__init__.py @@ -1,3 +1,3 @@ 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, wasm diff --git a/kiwixbuild/configs/win32.py b/kiwixbuild/configs/win32.py deleted file mode 100644 index 6b665e7..0000000 --- a/kiwixbuild/configs/win32.py +++ /dev/null @@ -1,99 +0,0 @@ -import subprocess - -from .base import ConfigInfo -from kiwixbuild.utils import which, pj -from kiwixbuild._global import neutralEnv - - -class Win32ConfigInfo(ConfigInfo): - build = "win32" - compatible_hosts = ["fedora", "debian"] - arch_full = "i686-w64-mingw32" - extra_libs = ["-lwinmm", "-lshlwapi", "-lws2_32", "-lssp"] - - def get_cross_config(self): - return { - "exe_wrapper_def": self.exe_wrapper_def, - "binaries": self.binaries, - "root_path": self.root_path, - "extra_libs": self.extra_libs, - "extra_cflags": [ - "-DWIN32", - *( - "-I{}".format(include_dir) - for include_dir in self.get_include_dirs() - ), - ], - "host_machine": { - "system": "Windows", - "lsystem": "windows", - "cpu_family": "x86", - "cpu": "i686", - "endian": "little", - "abi": "", - }, - } - - def finalize_setup(self): - super().finalize_setup() - self.buildEnv.cmake_crossfile = self._gen_crossfile("cmake_cross_file.txt") - self.buildEnv.meson_crossfile = self._gen_crossfile("meson_cross_file.txt") - - @property - def root_path(self): - root_paths = { - "fedora": "/usr/i686-w64-mingw32/sys-root/mingw", - "debian": "/usr/i686-w64-mingw32", - } - return root_paths[neutralEnv("distname")] - - @property - def binaries(self): - return { - k: which("{}-{}".format(self.arch_full, v)) - for k, v in ( - ("CC", "gcc"), - ("CXX", "g++"), - ("AR", "ar"), - ("STRIP", "strip"), - ("WINDRES", "windres"), - ("RANLIB", "ranlib"), - ("PKGCONFIG", "pkg-config"), - ) - } - - @property - def exe_wrapper_def(self): - try: - which("wine") - except subprocess.CalledProcessError: - return "" - else: - return "exe_wrapper = 'wine'" - - @property - def configure_options(self): - yield f"--host={self.arch_full}" - - def set_compiler(self, env): - for k, v in self.binaries.items(): - env[k] = v - - def get_bin_dir(self): - return [pj(self.root_path, "bin")] - - def get_env(self): - env = super().get_env() - env["PKG_CONFIG_LIBDIR"] = pj(self.root_path, "lib", "pkgconfig") - env["LIBS"] = " ".join(self.extra_libs) + " " + env["LIBS"] - return env - - -class Win32Dyn(Win32ConfigInfo): - name = "win32_dyn" - static = False - - -class Win32Static(Win32ConfigInfo): - name = "win32_static" - static = True diff --git a/kiwixbuild/dependencies/all_dependencies.py b/kiwixbuild/dependencies/all_dependencies.py index 03f36b1..4899d32 100644 --- a/kiwixbuild/dependencies/all_dependencies.py +++ b/kiwixbuild/dependencies/all_dependencies.py @@ -24,7 +24,7 @@ class AllBaseDependencies(Dependency): "zim-testing-suite", "icu4c", "boostregex", - "docoptcpp" + "docoptcpp", ] if not configInfo.name.endswith("_dyn"): @@ -50,10 +50,7 @@ class AllBaseDependencies(Dependency): # Add specific dependencies depending of the config if configInfo.build not in ("android", "iOS"): # For zimtools - base_deps += ["docoptcpp"] - if configInfo.build != "win32": - # zimwriterfs - base_deps += ["libmagic", "gumbo"] + base_deps += ["docoptcpp", "libmagic", "gumbo"] if ( configInfo.build == "native" and neutralEnv("distname") != "Darwin" diff --git a/kiwixbuild/dependencies/xapian.py b/kiwixbuild/dependencies/xapian.py index e49289f..5a15f23 100644 --- a/kiwixbuild/dependencies/xapian.py +++ b/kiwixbuild/dependencies/xapian.py @@ -50,9 +50,6 @@ class Xapian(Dependency): @classmethod def get_dependencies(cls, configInfo, allDeps): deps = ["zlib", "lzma"] - if ( - configInfo.build in ("win32", "win64", "wasm") - or neutralEnv("distname") == "Darwin" - ): + if configInfo.build == "wasm" or neutralEnv("distname") == "Darwin": return deps return deps + ["uuid"] diff --git a/kiwixbuild/dependencies/zim_tools.py b/kiwixbuild/dependencies/zim_tools.py index 1a0733c..6fc9045 100644 --- a/kiwixbuild/dependencies/zim_tools.py +++ b/kiwixbuild/dependencies/zim_tools.py @@ -14,17 +14,14 @@ class ZimTools(Dependency): @classmethod def get_dependencies(cls, configInfo, allDeps): base_deps = ["libzim", "docoptcpp", "mustache"] - if configInfo.build != "win32" and neutralEnv("distname") != "Windows": + if 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" - and neutralEnv("distname") != "Windows" - ): + # We don't build zimwriterfs on Windows, and so we don't have magic + if neutralEnv("distname") != "Windows": yield f"-Dmagic-install-prefix={self.buildEnv.install_dir}" if self.buildEnv.configInfo.static: yield "-Dstatic-linkage=true" diff --git a/kiwixbuild/packages.py b/kiwixbuild/packages.py index e7364ff..10dcdd6 100644 --- a/kiwixbuild/packages.py +++ b/kiwixbuild/packages.py @@ -50,7 +50,7 @@ PACKAGE_NAME_MAPPERS = { }, "fedora_native_static": { "COMMON": _fedora_common + ["glibc-static", "libstdc++-static"], - "lzma": ["xz-devel", "xz-static"] + "lzma": ["xz-devel", "xz-static"], # Either there is no packages, or no static or too old }, "fedora_i586_dyn": { @@ -59,33 +59,6 @@ PACKAGE_NAME_MAPPERS = { "fedora_i586_static": { "COMMON": _fedora_common + ["glibc-devel.i686"], }, - "fedora_win32_dyn": { - "COMMON": _fedora_common - + [ - "mingw32-gcc-c++", - "mingw32-bzip2", - "mingw32-win-iconv", - "mingw32-winpthreads", - "wine", - ], - "zlib": ["mingw32-zlib"], - "lzma": ["mingw32-xz-libs"], - "libmicrohttpd": ["mingw32-libmicrohttpd"], - }, - "fedora_win32_static": { - "COMMON": _fedora_common - + [ - "mingw32-gcc-c++", - "mingw32-bzip2-static", - "mingw32-win-iconv-static", - "mingw32-winpthreads-static", - "wine", - ], - "zlib": ["mingw32-zlib-static"], - "lzma": ["mingw32-xz-libs-static"], - "libmicrohttpd": None, # ['mingw32-libmicrohttpd-static'] packaging dependecy seems buggy, and some static lib are name libfoo.dll.a and - # gcc cannot found them. - }, "fedora_armhf_static": {"COMMON": _fedora_common}, "fedora_armhf_dyn": {"COMMON": _fedora_common}, "fedora_android": {"COMMON": _fedora_common}, @@ -109,24 +82,6 @@ PACKAGE_NAME_MAPPERS = { "COMMON": _debian_common + ["libc6-dev-i386", "lib32stdc++6", "gcc-multilib", "g++-multilib"], }, - "debian_win32_dyn": { - "COMMON": _debian_common - + [ - "g++-mingw-w64-i686", - "gcc-mingw-w64-i686", - "gcc-mingw-w64-base", - "mingw-w64-tools", - ], - }, - "debian_win32_static": { - "COMMON": _debian_common - + [ - "g++-mingw-w64-i686", - "gcc-mingw-w64-i686", - "gcc-mingw-w64-base", - "mingw-w64-tools", - ], - }, "debian_armhf_static": { "COMMON": _debian_common, },