Merge pull request #733 from kiwix/tools_deps_ci_windows

This commit is contained in:
Matthieu Gautier 2024-08-27 17:14:48 +02:00 committed by GitHub
commit 31aee276ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 60 additions and 19 deletions

View File

@ -22,7 +22,7 @@ BUILD_DEF = """
| manylinux | aarch64_mixed | BP | | | | | linux-aarch64-manylinux | | | manylinux | aarch64_mixed | BP | | | | | linux-aarch64-manylinux | |
---------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------
# On Windows, we build only libzim for now. And only native_mixed as xapian doesn't compile as dll # On Windows, we build only libzim for now. And only native_mixed as xapian doesn't compile as dll
| windows | native_static | Bd | d | | d | | win-x86_64 | win-x86_64-static | | windows | native_static | Bd | d | d | d | | win-x86_64 | win-x86_64-static |
| windows | native_dyn | Bd | | | | | win-x86_64 | win-x86_64-dyn | | windows | native_dyn | Bd | | | | | win-x86_64 | win-x86_64-dyn |
| windows | native_mixed | BPd | d | | | Bd | win-x86_64 | win-x86_64-mixed | | windows | native_mixed | BPd | d | | | Bd | win-x86_64 | win-x86_64-mixed |
---------------------------------------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -14,7 +14,7 @@ jobs:
- native_mixed - native_mixed
- native_dyn - native_dyn
- native_static - native_static
runs-on: windows-latest runs-on: windows-2022
env: env:
OS_NAME: windows OS_NAME: windows
COMPILE_CONFIG: ${{matrix.config}} COMPILE_CONFIG: ${{matrix.config}}

View File

@ -16,7 +16,7 @@ jobs:
- native_mixed - native_mixed
- native_dyn - native_dyn
- native_static - native_static
runs-on: windows-latest runs-on: windows-2022
env: env:
OS_NAME: windows OS_NAME: windows
COMPILE_CONFIG: ${{matrix.config}} COMPILE_CONFIG: ${{matrix.config}}

View File

@ -1,4 +1,4 @@
from .base import Dependency, GitClone, CMakeBuilder from .base import Dependency, ReleaseDownload, MesonBuilder
from kiwixbuild.utils import Remotefile from kiwixbuild.utils import Remotefile
@ -6,11 +6,21 @@ from kiwixbuild.utils import Remotefile
class docoptcpp(Dependency): class docoptcpp(Dependency):
name = "docoptcpp" name = "docoptcpp"
class Source(GitClone): class Source(ReleaseDownload):
git_remote = "https://github.com/docopt/docopt.cpp.git" name = "docoptcpp"
git_dir = "docopt.cpp" src_archive = Remotefile(
force_full_clone = True "v0.6.3.tar.gz",
git_ref = "3dd23e3280f213bacefdf5fcb04857bf52e90917" "28af5a0c482c6d508d22b14d588a3b0bd9ff97135f99c2814a5aa3cbff1d6632",
"https://github.com/docopt/docopt.cpp/archive/v0.6.3.tar.gz",
)
class Builder(CMakeBuilder): meson_archive = Remotefile(
make_install_targets = ["install"] "docopt_0.6.3-3_patch.zip",
"1f641187f9d3f35b0a5ebd2011876ef8e9b04b69b7b163095dd7dfa16219ad01",
"https://wrapdb.mesonbuild.com/v2/docopt_0.6.3-3/get_patch",
)
archives = [src_archive, meson_archive]
patches = ["docopt_meson_install_pkgconfig.patch"]
Builder = MesonBuilder

View File

@ -10,7 +10,7 @@ class KiwixTools(Dependency):
git_dir = "kiwix-tools" git_dir = "kiwix-tools"
class Builder(MesonBuilder): class Builder(MesonBuilder):
dependencies = ["libkiwix"] dependencies = ["libkiwix", "docoptcpp"]
@property @property
def configure_options(self): def configure_options(self):

View File

@ -9,9 +9,6 @@ base_url = (
) )
aarch_base_url = "https://master.dl.sourceforge.net/project/raspberry-pi-cross-compilers/Bonus%20Raspberry%20Pi%20GCC%2064-Bit%20Toolchains/Raspberry%20Pi%20GCC%2064-Bit%20Cross-Compiler%20Toolchains/Stretch/GCC%206.3.0/"
class armv6_toolchain(Dependency): class armv6_toolchain(Dependency):
dont_skip = True dont_skip = True
neutral = True neutral = True
@ -53,7 +50,6 @@ class aarch64_toolchain(Dependency):
archive = Remotefile( archive = Remotefile(
"cross-gcc-6.3.0-pi_64.tar.gz", "cross-gcc-6.3.0-pi_64.tar.gz",
"1b048bb8886ad63d21797cd9129fc37b9ea0dfaac7e3c36f888aa16fbec1d320", "1b048bb8886ad63d21797cd9129fc37b9ea0dfaac7e3c36f888aa16fbec1d320",
aarch_base_url + "cross-gcc-6.3.0-pi_64.tar.gz",
) )
Builder = TcCopyBuilder Builder = TcCopyBuilder

View File

@ -1,4 +1,5 @@
from .base import Dependency, GitClone, MesonBuilder from .base import Dependency, GitClone, MesonBuilder
from kiwixbuild._global import neutralEnv
class ZimTools(Dependency): class ZimTools(Dependency):
@ -13,14 +14,17 @@ class ZimTools(Dependency):
@classmethod @classmethod
def get_dependencies(cls, configInfo, allDeps): def get_dependencies(cls, configInfo, allDeps):
base_deps = ["libzim", "docoptcpp", "mustache"] base_deps = ["libzim", "docoptcpp", "mustache"]
if configInfo.build != "win32": if configInfo.build != "win32" and neutralEnv("distname") != "Windows":
base_deps += ["libmagic", "gumbo"] base_deps += ["libmagic", "gumbo"]
return base_deps return base_deps
@property @property
def configure_options(self): def configure_options(self):
# We don't build zimwriterfs on win32, and so we don't have magic # We don't build zimwriterfs on win32, and so we don't have magic
if self.buildEnv.configInfo.build != "win32": if (
self.buildEnv.configInfo.build != "win32"
and neutralEnv("distname") != "Windows"
):
yield f"-Dmagic-install-prefix={self.buildEnv.install_dir}" yield f"-Dmagic-install-prefix={self.buildEnv.install_dir}"
if self.buildEnv.configInfo.static: if self.buildEnv.configInfo.static:
yield "-Dstatic-linkage=true" yield "-Dstatic-linkage=true"

View File

@ -0,0 +1,31 @@
diff '--color=auto' -ur docoptcpp-0.6.2/meson.build docoptcpp-0.6.2_patched/meson.build
--- docoptcpp-0.6.2/meson.build 2024-08-26 14:28:47.553448529 +0200
+++ docoptcpp-0.6.2_patched/meson.build 2024-08-26 14:10:47.232603427 +0200
@@ -10,11 +10,25 @@
# bug with missing dllexport. fixed in next version.
if cpp.get_argument_syntax() == 'msvc'
- doclib = static_library('docopt', 'docopt.cpp')
+ doclib = static_library('docopt', 'docopt.cpp', install: true)
else
- doclib = library('docopt', 'docopt.cpp')
+ doclib = library('docopt', 'docopt.cpp', install: true)
endif
executable('docopt_example', 'examples/naval_fate.cpp', link_with: doclib)
docopt_dep = declare_dependency(include_directories: include_directories('.'),
link_with: doclib)
+
+install_headers(
+ 'docopt.h',
+ 'docopt_value.h',
+ subdir: 'docopt'
+)
+
+pkg_mod = import('pkgconfig')
+pkg_mod.generate(
+ doclib,
+ version: meson.project_version(),
+ name: 'docopt',
+ filebase: 'docopt'
+)

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 = "05" base_deps_meta_version = "06"
base_deps_versions = { base_deps_versions = {
"zlib": "1.2.12", "zlib": "1.2.12",