Skip to content

Commit

Permalink
Remove cross-building libzim to win32.
Browse files Browse the repository at this point in the history
Now we build libzim natively on Windows, we can remove cross-compilation
to Windows.
  • Loading branch information
mgautierfr committed Sep 1, 2024
1 parent 5ff01d9 commit 397dba9
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 177 deletions.
2 changes: 0 additions & 2 deletions .github/scripts/build_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@
| | 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 |
Expand Down
2 changes: 1 addition & 1 deletion .github/scripts/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_build_dir(config) -> Path:
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]
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/releaseNigthly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ platforms:
- native_dyn
- native_mixed
- native_static
- win32_dyn
- win32_static
- android
- android_arm
- android_arm64
Expand All @@ -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
-------
Expand Down
2 changes: 1 addition & 1 deletion kiwixbuild/configs/__init__.py
Original file line number Diff line number Diff line change
@@ -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
99 changes: 0 additions & 99 deletions kiwixbuild/configs/win32.py

This file was deleted.

7 changes: 2 additions & 5 deletions kiwixbuild/dependencies/all_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get_dependencies(cls, configInfo, allDeps):
"zim-testing-suite",
"icu4c",
"boostregex",
"docoptcpp"
"docoptcpp",
]

if not configInfo.name.endswith("_dyn"):
Expand All @@ -50,10 +50,7 @@ def get_dependencies(cls, configInfo, allDeps):
# 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"
Expand Down
5 changes: 1 addition & 4 deletions kiwixbuild/dependencies/xapian.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ class Builder(MakeBuilder):
@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"]
9 changes: 3 additions & 6 deletions kiwixbuild/dependencies/zim_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,14 @@ class Builder(MesonBuilder):
@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"
47 changes: 1 addition & 46 deletions kiwixbuild/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
},
"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": {
Expand All @@ -59,33 +59,6 @@
"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},
Expand All @@ -109,24 +82,6 @@
"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,
},
Expand Down

0 comments on commit 397dba9

Please sign in to comment.