Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dependencies for zim-tools #736

Merged
merged 3 commits into from
Aug 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions kiwixbuild/dependencies/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .base import *
from . import (
all_dependencies,
boostregex,
tc_android_ndk,
aria2,
tc_armhf,
Expand Down
2 changes: 2 additions & 0 deletions kiwixbuild/dependencies/all_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ def get_dependencies(cls, configInfo, allDeps):
"xapian-core",
"zim-testing-suite",
"icu4c",
"boostregex",
"docoptcpp"
]

if not configInfo.name.endswith("_dyn"):
Expand Down
27 changes: 27 additions & 0 deletions kiwixbuild/dependencies/boostregex.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from .base import Dependency, ReleaseDownload, Builder as BaseBuilder

from kiwixbuild.utils import Remotefile, pj
from shutil import copytree


class BoostRegex(Dependency):
name = "boostregex"

class Source(ReleaseDownload):
archive = Remotefile(
"regex-boost-1.86.0.zip",
"",
"https://codeload.github.com/boostorg/regex/zip/refs/tags/boost-1.86.0",
)

class Builder(BaseBuilder):
def build(self):
self.command("copy_headers", self._copy_headers)

def _copy_headers(self, context):
context.try_skip(self.build_path)
copytree(
pj(self.source_path, "include", "boost"),
pj(self.buildEnv.install_dir, "include", "boost"),
dirs_exist_ok=True,
)
14 changes: 11 additions & 3 deletions kiwixbuild/dependencies/docoptcpp.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .base import Dependency, ReleaseDownload, MesonBuilder

from kiwixbuild.utils import Remotefile

from kiwixbuild._global import neutralEnv

class docoptcpp(Dependency):
name = "docoptcpp"
Expand All @@ -21,6 +21,14 @@ class Source(ReleaseDownload):
)

archives = [src_archive, meson_archive]
patches = ["docopt_meson_install_pkgconfig.patch"]
patches = [
"docopt_meson_install_pkgconfig.patch",
"docopt_meson_use_boostregex.patch",
]

Builder = MesonBuilder
class Builder(MesonBuilder):
@classmethod
def get_dependencies(cls, configInfo, allDeps):
if neutralEnv("distname") == "Windows":
return ["boostregex"]
return []
4 changes: 2 additions & 2 deletions kiwixbuild/dependencies/icu4c.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ class Icu(Dependency):

class Source(ReleaseDownload):
archive = Remotefile(
"icu4c-73_1-Win64-MSVC2019.zip",
"icu4c-74_1-Win64-MSVC2022.zip",
"",
"https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-Win64-MSVC2019.zip",
"https://github.com/unicode-org/icu/releases/download/release-74-1/icu4c-74_1-Win64-MSVC2022.zip",
)

class Builder(BaseBuilder):
Expand Down
14 changes: 14 additions & 0 deletions kiwixbuild/patches/docopt_meson_use_boostregex.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff -ur docoptcpp-0.6.2/meson.build docoptcpp-0.6.2_boostregex/meson.build
--- docoptcpp-0.6.2/meson.build 2024-08-28 17:22:46.256716100 +0200
+++ docoptcpp-0.6.2_boostregex/meson.build 2024-08-28 17:02:47.932681000 +0200
@@ -8,6 +8,10 @@
add_project_arguments('-DDOCOPT_DLL', '-DDOCOPT_EXPORTS', language: 'cpp')
endif

+if cpp.get_id() =='msvc'
+ add_project_arguments('-DDOCTOPT_USE_BOOST_REGEX', '-DBOOST_REGEX_STANDALONE', language: 'cpp')
+endif
+
# bug with missing dllexport. fixed in next version.
if cpp.get_argument_syntax() == 'msvc'
doclib = static_library('docopt', 'docopt.cpp', install: true)
2 changes: 1 addition & 1 deletion kiwixbuild/versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

# This is the "version" of the whole base_deps_versions dict.
# Change this when you change base_deps_versions.
base_deps_meta_version = "06"
base_deps_meta_version = "07"

base_deps_versions = {
"zlib": "1.2.12",
Expand Down
Loading