Merge pull request #451 from kiwix/integrate-zimwriterfs-into-zim-tools

This commit is contained in:
Matthieu Gautier 2020-07-15 16:11:57 +02:00 committed by GitHub
commit 962835b33a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 31 additions and 38 deletions

View File

@ -36,14 +36,14 @@ elif PLATFORM_TARGET.startswith("iOS"):
TARGETS = ("libzim", "kiwix-lib")
elif PLATFORM_TARGET.startswith("native_"):
if OS_NAME == "osx":
TARGETS = ("libzim", ) if PLATFORM_TARGET == "native_mixed" else ("libzim", "zimwriterfs", "zim-tools", "kiwix-lib")
TARGETS = ("libzim", ) if PLATFORM_TARGET == "native_mixed" else ("libzim", "zim-tools", "kiwix-lib")
else:
if DESKTOP:
TARGETS = ("kiwix-desktop",)
elif PLATFORM_TARGET == "native_mixed":
TARGETS = ("libzim",)
else:
TARGETS = ("zimwriterfs", "zim-tools", "kiwix-tools")
TARGETS = ("zim-tools", "kiwix-tools")
elif PLATFORM_TARGET in ("win32_static", "armhf_static", "i586_static"):
TARGETS = ("kiwix-tools",)
elif PLATFORM_TARGET == "flatpak":

View File

@ -72,10 +72,10 @@ EXPORT_FILES = {
"zimdiff",
"zimpatch",
"zimsplit",
"zimwriterfs",
)
],
),
"zimwriterfs": (INSTALL_DIR / "bin", ["zimwriterfs" + BIN_EXT]),
"libzim": (
INSTALL_DIR,
(

View File

@ -18,14 +18,14 @@ elif PLATFORM_TARGET.startswith("iOS"):
TARGETS = ("libzim", "kiwix-lib")
elif PLATFORM_TARGET.startswith("native_"):
if OS_NAME == "osx":
TARGETS = ("libzim", "zimwriterfs", "zim-tools", "kiwix-lib")
TARGETS = ("libzim", "zim-tools", "kiwix-lib")
else:
if DESKTOP:
TARGETS = ("kiwix-desktop",)
elif PLATFORM_TARGET == "native_mixed":
TARGETS = ("libzim",)
else:
TARGETS = ("libzim", "zimwriterfs", "zim-tools", "kiwix-lib", "kiwix-tools")
TARGETS = ("libzim", "zim-tools", "kiwix-lib", "kiwix-tools")
else:
TARGETS = ("libzim", "zim-tools", "kiwix-lib", "kiwix-tools")

View File

@ -63,6 +63,15 @@ kiwix-build zim-tools # will build zim-tools and its dependencies
By default, `kiwix-build` will build `kiwix-tools` .
To see the whole list of available targets run with non existing target, ex:
```bash
kiwix-build not-existing-target
...
invalid choice: 'not-existing-target' (choose from 'alldependencies', 'android-ndk',
...
```
#### Target platform
If no target platform is specified, a default one will be infered from

View File

@ -25,7 +25,6 @@ from . import (
uuid,
xapian,
zim_tools,
zimwriterfs,
zlib,
zstd
)

View File

@ -13,12 +13,12 @@ class AllBaseDependencies(Dependency):
@classmethod
def get_dependencies(cls, platformInfo, allDeps):
base_deps = ['zlib', 'lzma', 'zstd', 'xapian-core', 'pugixml', 'libcurl', 'icu4c', 'mustache', 'libmicrohttpd']
# zimwriterfs
if platformInfo.build not in ('android', 'win32'):
base_deps += ['libmagic', 'gumbo']
# zimtools
if platformInfo.build not in ('android','iOS'):
# We do not build zimtools at all on "android" and "iOS"
if platformInfo.build not in ('android', 'iOS'):
base_deps += ['docoptcpp']
if platformInfo.build != 'win32':
# zimwriterfs
base_deps += ['libmagic', 'gumbo']
return base_deps

View File

@ -12,10 +12,19 @@ class ZimTools(Dependency):
git_dir = "zim-tools"
class Builder(MesonBuilder):
dependencies = ['libzim', 'docoptcpp']
@classmethod
def get_dependencies(cls, platformInfo, allDeps):
base_deps = ['libzim', 'docoptcpp']
if platformInfo.build != 'win32':
base_deps += ['libmagic', 'gumbo']
return base_deps
@property
def configure_option(self):
base_option = ""
# We don't build zimwriterfs on win32, and so we don't have magic
if self.buildEnv.platformInfo.build != 'win32':
base_option += " -Dmagic-install-prefix={buildEnv.install_dir}"
if self.buildEnv.platformInfo.static:
return "-Dstatic-linkage=true"
return ""
base_option += " -Dstatic-linkage=true"
return base_option

View File

@ -1,22 +0,0 @@
from .base import (
Dependency,
GitClone,
MesonBuilder)
class Zimwriterfs(Dependency):
name = "zimwriterfs"
force_build = True
class Source(GitClone):
git_remote = "https://github.com/openzim/zimwriterfs.git"
git_dir = "zimwriterfs"
class Builder(MesonBuilder):
dependencies = ['libzim', 'zlib', 'xapian-core', 'gumbo', 'icu4c', 'libmagic']
@property
def configure_option(self):
base_option = "-Dmagic-install-prefix={buildEnv.install_dir}"
if self.buildEnv.platformInfo.static:
base_option += " -Dstatic-linkage=true"
return base_option

View File

@ -5,7 +5,6 @@ main_project_versions = {
'kiwix-lib': '9.3.0',
'kiwix-tools': '3.1.2', # Also need to change this in appveyor/install_kiwix-tools.cmd
'zim-tools': '1.2.1',
'zimwriterfs': '1.3.10',
'kiwix-desktop': '2.0.2' # Also change KIWIX_DESKTOP_VERSION and KIWIX_DESKTOP_RELEASE in appveyor.yml
# You need to do the release process of kiwix-tools and kiwix-desktop in two separated process.
}
@ -35,7 +34,6 @@ release_versions = {
'kiwix-lib': 0, # Depends of libzim (was 1)
'kiwix-tools': 0, # Depends of kiwix-lib and libzim (was 6)
'zim-tools': None, # Depends of libzim (was 3)
'zimwriterfs': None, # Depends of libzim (was 4)
'kiwix-desktop': None # Depends of kiwix-lib and libzim (was 0)
}