Merge pull request #26 from kiwix/dependencies_update
Dependencies update
This commit is contained in:
commit
d1e7653fa5
12
.travis.yml
12
.travis.yml
|
@ -18,12 +18,12 @@ env:
|
||||||
- BUILD_OPTION="--target-platform=native_static" ARCHIVE_TYPE="--tar" DEPLOY=true
|
- BUILD_OPTION="--target-platform=native_static" ARCHIVE_TYPE="--tar" DEPLOY=true
|
||||||
- BUILD_OPTION="--target-platform=win32_dyn"
|
- BUILD_OPTION="--target-platform=win32_dyn"
|
||||||
- BUILD_OPTION="--target-platform=win32_static" ARCHIVE_TYPE="--zip" DEPLOY=true
|
- BUILD_OPTION="--target-platform=win32_static" ARCHIVE_TYPE="--zip" DEPLOY=true
|
||||||
- BUILD_OPTION="--target-platform=android_arm Kiwixlib"
|
- BUILD_OPTION="--target-platform=android_arm kiwix-lib"
|
||||||
- BUILD_OPTION="--target-platform=android_arm64 Kiwixlib"
|
- BUILD_OPTION="--target-platform=android_arm64 kiwix-lib"
|
||||||
- BUILD_OPTION="--target-platform=android_mips Kiwixlib"
|
- BUILD_OPTION="--target-platform=android_mips kiwix-lib"
|
||||||
- BUILD_OPTION="--target-platform=android_mips64 Kiwixlib"
|
- BUILD_OPTION="--target-platform=android_mips64 kiwix-lib"
|
||||||
- BUILD_OPTION="--target-platform=android_x86 Kiwixlib"
|
- BUILD_OPTION="--target-platform=android_x86 kiwix-lib"
|
||||||
- BUILD_OPTION="--target-platform=android_x86_64 Kiwixlib"
|
- BUILD_OPTION="--target-platform=android_x86_64 kiwix-lib"
|
||||||
notifications:
|
notifications:
|
||||||
irc:
|
irc:
|
||||||
channels:
|
channels:
|
||||||
|
|
|
@ -123,7 +123,7 @@ class Xapian(Dependency):
|
||||||
deps = ['zlib', 'lzma']
|
deps = ['zlib', 'lzma']
|
||||||
if self.buildEnv.platform_info.build == 'win32':
|
if self.buildEnv.platform_info.build == 'win32':
|
||||||
return deps
|
return deps
|
||||||
return deps + ['UUID']
|
return deps + ['uuid']
|
||||||
|
|
||||||
|
|
||||||
class CTPP2(Dependency):
|
class CTPP2(Dependency):
|
||||||
|
@ -175,6 +175,12 @@ class Icu(Dependency):
|
||||||
version = "58_2"
|
version = "58_2"
|
||||||
|
|
||||||
class Source(ReleaseDownload):
|
class Source(ReleaseDownload):
|
||||||
|
name = "icu4c"
|
||||||
|
|
||||||
|
@property
|
||||||
|
def source_dir(self):
|
||||||
|
return "{}-{}".format(self.name, self.target.version)
|
||||||
|
|
||||||
archive = Remotefile('icu4c-58_2-src.tgz',
|
archive = Remotefile('icu4c-58_2-src.tgz',
|
||||||
'2b0a4410153a9b20de0e20c7d8b66049a72aef244b53683d0d7521371683da0c',
|
'2b0a4410153a9b20de0e20c7d8b66049a72aef244b53683d0d7521371683da0c',
|
||||||
'https://freefr.dl.sourceforge.net/project/icu/ICU4C/58.2/icu4c-58_2-src.tgz')
|
'https://freefr.dl.sourceforge.net/project/icu/ICU4C/58.2/icu4c-58_2-src.tgz')
|
||||||
|
@ -201,10 +207,10 @@ class Icu(Dependency):
|
||||||
|
|
||||||
|
|
||||||
class Icu_native(Icu):
|
class Icu_native(Icu):
|
||||||
|
name = "icu4c_native"
|
||||||
force_native_build = True
|
force_native_build = True
|
||||||
|
|
||||||
class Builder(Icu.Builder):
|
class Builder(Icu.Builder):
|
||||||
name = "icu_native"
|
|
||||||
@property
|
@property
|
||||||
def build_path(self):
|
def build_path(self):
|
||||||
return super().build_path+"_native"
|
return super().build_path+"_native"
|
||||||
|
@ -214,33 +220,24 @@ class Icu_native(Icu):
|
||||||
|
|
||||||
|
|
||||||
class Icu_cross_compile(Icu):
|
class Icu_cross_compile(Icu):
|
||||||
dependencies = ['Icu_native']
|
name = "icu4c_cross-compile"
|
||||||
|
dependencies = ['icu4c_native']
|
||||||
|
|
||||||
class Builder(Icu.Builder):
|
class Builder(Icu.Builder):
|
||||||
name = "icu_cross-compile"
|
|
||||||
@property
|
@property
|
||||||
def configure_option(self):
|
def configure_option(self):
|
||||||
Icu_native = self.buildEnv.targetsDict['Icu_native']
|
icu_native_dep = self.buildEnv.targetsDict['icu4c_native']
|
||||||
return super().configure_option + " --with-cross-build=" + Icu_native.builder.build_path
|
return super().configure_option + " --with-cross-build=" + icu_native_dep.builder.build_path
|
||||||
|
|
||||||
|
|
||||||
class OpenzimSource(GitClone):
|
class Libzim(Dependency):
|
||||||
git_remote = "https://gerrit.wikimedia.org/r/p/openzim.git"
|
name = "libzim"
|
||||||
git_dir = "openzim"
|
|
||||||
|
|
||||||
def _post_prepare_script(self, context):
|
class Source(GitClone):
|
||||||
context.try_skip(self.git_path)
|
git_remote = "https://github.com/openzim/libzim.git"
|
||||||
command = "./autogen.sh"
|
git_dir = "libzim"
|
||||||
self.buildEnv.run_command(command, pj(self.git_path, 'zimwriterfs'), context)
|
|
||||||
|
|
||||||
|
Builder = MesonBuilder
|
||||||
class Zimlib(Dependency):
|
|
||||||
name = "zimlib"
|
|
||||||
|
|
||||||
Source = OpenzimSource
|
|
||||||
|
|
||||||
class Builder(MesonBuilder):
|
|
||||||
subsource_dir = "zimlib"
|
|
||||||
|
|
||||||
|
|
||||||
class Zimwriterfs(Dependency):
|
class Zimwriterfs(Dependency):
|
||||||
|
@ -249,16 +246,22 @@ class Zimwriterfs(Dependency):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dependencies(self):
|
def dependencies(self):
|
||||||
base_dependencies = ['Zimlib', 'zlib', 'lzma', 'Xapian']
|
base_dependencies = ['libzim', 'zlib', 'lzma', 'xapian-core']
|
||||||
if self.buildEnv.platform_info.build != 'native':
|
if self.buildEnv.platform_info.build != 'native':
|
||||||
return base_dependencies + ["Icu_cross_compile"]
|
return base_dependencies + ["icu4c_cross-compile"]
|
||||||
else:
|
else:
|
||||||
return base_dependencies + ["Icu"]
|
return base_dependencies + ["icu4c"]
|
||||||
|
|
||||||
Source = OpenzimSource
|
class Source(GitClone):
|
||||||
|
git_remote = "https://github.com/openzim/zimwriterfs.git"
|
||||||
|
git_dir = "zimwriterfs"
|
||||||
|
|
||||||
class Builder(MakeBuilder):
|
def _post_prepare_script(self, context):
|
||||||
subsource_dir = "zimwriterfs"
|
context.try_skip(self.git_path)
|
||||||
|
command = "./autogen.sh"
|
||||||
|
self.buildEnv.run_command(command, self.git_path, context)
|
||||||
|
|
||||||
|
Builder = MakeBuilder
|
||||||
|
|
||||||
|
|
||||||
class Kiwixlib(Dependency):
|
class Kiwixlib(Dependency):
|
||||||
|
@ -266,13 +269,13 @@ class Kiwixlib(Dependency):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def dependencies(self):
|
def dependencies(self):
|
||||||
base_dependencies = ["Xapian", "Pugixml", "Zimlib", "zlib", "lzma"]
|
base_dependencies = ["xapian-core", "pugixml", "libzim", "zlib", "lzma"]
|
||||||
if self.buildEnv.platform_info.build != 'android':
|
if self.buildEnv.platform_info.build != 'android':
|
||||||
base_dependencies += ['CTPP2']
|
base_dependencies += ['ctpp2']
|
||||||
if self.buildEnv.platform_info.build != 'native':
|
if self.buildEnv.platform_info.build != 'native':
|
||||||
return base_dependencies + ["Icu_cross_compile"]
|
return base_dependencies + ["icu4c_cross-compile"]
|
||||||
else:
|
else:
|
||||||
return base_dependencies + ["Icu"]
|
return base_dependencies + ["icu4c"]
|
||||||
|
|
||||||
class Source(GitClone):
|
class Source(GitClone):
|
||||||
git_remote = "https://github.com/kiwix/kiwix-lib.git"
|
git_remote = "https://github.com/kiwix/kiwix-lib.git"
|
||||||
|
@ -295,7 +298,7 @@ class Kiwixlib(Dependency):
|
||||||
|
|
||||||
class KiwixTools(Dependency):
|
class KiwixTools(Dependency):
|
||||||
name = "kiwix-tools"
|
name = "kiwix-tools"
|
||||||
dependencies = ["Kiwixlib", "MicroHttpd", "zlib"]
|
dependencies = ["kiwix-lib", "libmicrohttpd", "zlib"]
|
||||||
|
|
||||||
class Source(GitClone):
|
class Source(GitClone):
|
||||||
git_remote = "https://github.com/kiwix/kiwix-tools.git"
|
git_remote = "https://github.com/kiwix/kiwix-tools.git"
|
||||||
|
|
|
@ -11,7 +11,8 @@ class _MetaDependency(type):
|
||||||
def __new__(cls, name, bases, dct):
|
def __new__(cls, name, bases, dct):
|
||||||
_class = type.__new__(cls, name, bases, dct)
|
_class = type.__new__(cls, name, bases, dct)
|
||||||
if name != 'Dependency':
|
if name != 'Dependency':
|
||||||
Dependency.all_deps[name] = _class
|
dep_name = dct['name']
|
||||||
|
Dependency.all_deps[dep_name] = _class
|
||||||
return _class
|
return _class
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -710,6 +710,7 @@ class android_ndk(Toolchain):
|
||||||
|
|
||||||
class Builder:
|
class Builder:
|
||||||
def __init__(self, options):
|
def __init__(self, options):
|
||||||
|
self.options = options
|
||||||
self.targets = OrderedDict()
|
self.targets = OrderedDict()
|
||||||
self.buildEnv = buildEnv = BuildEnv(options, self.targets)
|
self.buildEnv = buildEnv = BuildEnv(options, self.targets)
|
||||||
|
|
||||||
|
@ -738,6 +739,10 @@ class Builder:
|
||||||
yield targetName
|
yield targetName
|
||||||
|
|
||||||
def prepare_sources(self):
|
def prepare_sources(self):
|
||||||
|
if self.options.skip_source_prepare:
|
||||||
|
print("SKIP")
|
||||||
|
return
|
||||||
|
|
||||||
toolchain_sources = (tlc.source for tlc in self.buildEnv.toolchains if tlc.source)
|
toolchain_sources = (tlc.source for tlc in self.buildEnv.toolchains if tlc.source)
|
||||||
for toolchain_source in toolchain_sources:
|
for toolchain_source in toolchain_sources:
|
||||||
print("prepare sources for toolchain {} :".format(toolchain_source.name))
|
print("prepare sources for toolchain {} :".format(toolchain_source.name))
|
||||||
|
@ -775,7 +780,8 @@ class Builder:
|
||||||
|
|
||||||
def parse_args():
|
def parse_args():
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('targets', default='KiwixTools', nargs='?')
|
parser.add_argument('targets', default='kiwix-tools', nargs='?',
|
||||||
|
choices=Dependency.all_deps.keys())
|
||||||
parser.add_argument('--working-dir', default=".")
|
parser.add_argument('--working-dir', default=".")
|
||||||
parser.add_argument('--libprefix', default=None)
|
parser.add_argument('--libprefix', default=None)
|
||||||
parser.add_argument('--target-platform', default="native_dyn", choices=BuildEnv.target_platforms)
|
parser.add_argument('--target-platform', default="native_dyn", choices=BuildEnv.target_platforms)
|
||||||
|
@ -784,6 +790,8 @@ def parse_args():
|
||||||
" log files per commands"))
|
" log files per commands"))
|
||||||
parser.add_argument('--no-cert-check', action='store_true',
|
parser.add_argument('--no-cert-check', action='store_true',
|
||||||
help="Skip SSL certificate verification during download")
|
help="Skip SSL certificate verification during download")
|
||||||
|
parser.add_argument('--skip-source-prepare', action='store_true',
|
||||||
|
help="Skip the source download part")
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue