Merge pull request #535 from kiwix/libzim_android
This commit is contained in:
commit
fce112d4b1
|
@ -16,7 +16,7 @@ RUN apt update -q \
|
||||||
# Python (2) is needed to install android-ndk
|
# Python (2) is needed to install android-ndk
|
||||||
python \
|
python \
|
||||||
# Packaged dependencies
|
# Packaged dependencies
|
||||||
libbz2-dev libmagic-dev uuid-dev zlib1g-dev default-jdk \
|
libbz2-dev libmagic-dev uuid-dev zlib1g-dev \
|
||||||
libmicrohttpd-dev aria2 libgtest-dev libgl-dev \
|
libmicrohttpd-dev aria2 libgtest-dev libgl-dev \
|
||||||
# Qt packages
|
# Qt packages
|
||||||
qt515base qt515webengine qt515svg qt515imageformats qt515wayland \
|
qt515base qt515webengine qt515svg qt515imageformats qt515wayland \
|
||||||
|
|
|
@ -11,9 +11,9 @@ from common import (
|
||||||
DESKTOP,
|
DESKTOP,
|
||||||
)
|
)
|
||||||
|
|
||||||
if PLATFORM_TARGET.startswith("android_"):
|
if (PLATFORM_TARGET.startswith("android_")
|
||||||
TARGETS = ("libkiwix",)
|
or PLATFORM_TARGET.startswith("iOS")
|
||||||
elif PLATFORM_TARGET.startswith("iOS") or PLATFORM_TARGET.startswith("macOS"):
|
or PLATFORM_TARGET.startswith("macOS")):
|
||||||
TARGETS = ("libzim", "libkiwix")
|
TARGETS = ("libzim", "libkiwix")
|
||||||
elif PLATFORM_TARGET.startswith("native_"):
|
elif PLATFORM_TARGET.startswith("native_"):
|
||||||
if OS_NAME == "osx":
|
if OS_NAME == "osx":
|
||||||
|
|
|
@ -27,9 +27,7 @@ if os.environ.get('GITHUB_EVENT_NAME') == 'schedule':
|
||||||
else:
|
else:
|
||||||
RELEASE = True
|
RELEASE = True
|
||||||
|
|
||||||
if PLATFORM_TARGET.startswith("android_"):
|
if PLATFORM_TARGET.startswith("android_") or PLATFORM_TARGET.startswith("iOS"):
|
||||||
TARGETS = ("libkiwix",)
|
|
||||||
elif PLATFORM_TARGET.startswith("iOS"):
|
|
||||||
TARGETS = ("libzim", "libkiwix")
|
TARGETS = ("libzim", "libkiwix")
|
||||||
elif PLATFORM_TARGET.startswith("native_"):
|
elif PLATFORM_TARGET.startswith("native_"):
|
||||||
if OS_NAME == "osx":
|
if OS_NAME == "osx":
|
||||||
|
|
|
@ -93,9 +93,16 @@ EXPORT_FILES = {
|
||||||
"libzim": (
|
"libzim": (
|
||||||
INSTALL_DIR,
|
INSTALL_DIR,
|
||||||
(
|
(
|
||||||
"lib/x86_64-linux-gnu/libzim.so.{}".format(main_project_versions["libzim"]),
|
"lib/{libprefix}/libzim.so".format(
|
||||||
"lib/x86_64-linux-gnu/libzim.so.{}".format(
|
libprefix=LIB_PREFIX.get(PLATFORM_TARGET, "x86_64-linux-gnu"),
|
||||||
main_project_versions["libzim"][0]
|
),
|
||||||
|
"lib/{libprefix}/libzim.so.{version}".format(
|
||||||
|
libprefix=LIB_PREFIX.get(PLATFORM_TARGET, "x86_64-linux-gnu"),
|
||||||
|
version=main_project_versions["libzim"]
|
||||||
|
),
|
||||||
|
"lib/{libprefix}/libzim.so.{version}".format(
|
||||||
|
libprefix=LIB_PREFIX.get(PLATFORM_TARGET, "x86_64-linux-gnu"),
|
||||||
|
version=main_project_versions["libzim"][0]
|
||||||
),
|
),
|
||||||
"lib/libzim.{}.dylib".format(
|
"lib/libzim.{}.dylib".format(
|
||||||
main_project_versions["libzim"][0]
|
main_project_versions["libzim"][0]
|
||||||
|
|
|
@ -12,9 +12,7 @@ from common import (
|
||||||
KIWIX_DESKTOP_ONLY,
|
KIWIX_DESKTOP_ONLY,
|
||||||
)
|
)
|
||||||
|
|
||||||
if PLATFORM_TARGET.startswith("android_"):
|
if PLATFORM_TARGET.startswith("android_") or PLATFORM_TARGET.startswith("iOS"):
|
||||||
TARGETS = ("libzim", "libkiwix")
|
|
||||||
elif PLATFORM_TARGET.startswith("iOS"):
|
|
||||||
TARGETS = ("libzim", "libkiwix")
|
TARGETS = ("libzim", "libkiwix")
|
||||||
elif PLATFORM_TARGET.startswith("native_"):
|
elif PLATFORM_TARGET.startswith("native_"):
|
||||||
if OS_NAME == "osx":
|
if OS_NAME == "osx":
|
||||||
|
|
|
@ -29,6 +29,7 @@ class Libzim(Dependency):
|
||||||
config_options = []
|
config_options = []
|
||||||
if platformInfo.build == 'android':
|
if platformInfo.build == 'android':
|
||||||
config_options.append("-DUSE_BUFFER_HEADER=false")
|
config_options.append("-DUSE_BUFFER_HEADER=false")
|
||||||
|
config_options.append("-Dstatic-linkage=true")
|
||||||
if platformInfo.build == 'iOS':
|
if platformInfo.build == 'iOS':
|
||||||
config_options.append("-Db_bitcode=true")
|
config_options.append("-Db_bitcode=true")
|
||||||
if platformInfo.name == 'native_mixed' and option('target') == 'libzim':
|
if platformInfo.name == 'native_mixed' and option('target') == 'libzim':
|
||||||
|
@ -40,3 +41,9 @@ class Libzim(Dependency):
|
||||||
zim_testing_suite = get_target_step('zim-testing-suite', 'source')
|
zim_testing_suite = get_target_step('zim-testing-suite', 'source')
|
||||||
config_options.append('-Dtest_data_dir={}'.format(zim_testing_suite.source_path))
|
config_options.append('-Dtest_data_dir={}'.format(zim_testing_suite.source_path))
|
||||||
return " ".join(config_options)
|
return " ".join(config_options)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def library_type(self):
|
||||||
|
if self.buildEnv.platformInfo.build == 'android':
|
||||||
|
return 'shared'
|
||||||
|
return super().library_type
|
||||||
|
|
|
@ -61,7 +61,7 @@ PACKAGE_NAME_MAPPERS = {
|
||||||
'COMMON': _fedora_common
|
'COMMON': _fedora_common
|
||||||
},
|
},
|
||||||
'fedora_android': {
|
'fedora_android': {
|
||||||
'COMMON': _fedora_common + ['java-1.8.0-openjdk-devel']
|
'COMMON': _fedora_common
|
||||||
},
|
},
|
||||||
'debian_native_dyn': {
|
'debian_native_dyn': {
|
||||||
'COMMON': _debian_common + ['libbz2-dev', 'libmagic-dev'],
|
'COMMON': _debian_common + ['libbz2-dev', 'libmagic-dev'],
|
||||||
|
@ -94,7 +94,7 @@ PACKAGE_NAME_MAPPERS = {
|
||||||
'COMMON': _debian_common,
|
'COMMON': _debian_common,
|
||||||
},
|
},
|
||||||
'debian_android': {
|
'debian_android': {
|
||||||
'COMMON': _debian_common + ['default-jdk'],
|
'COMMON': _debian_common,
|
||||||
},
|
},
|
||||||
'Darwin_native_dyn': {
|
'Darwin_native_dyn': {
|
||||||
'COMMON': ['autoconf', 'automake', 'libtool', 'cmake', 'pkg-config'],
|
'COMMON': ['autoconf', 'automake', 'libtool', 'cmake', 'pkg-config'],
|
||||||
|
|
Loading…
Reference in New Issue