[TRAVISCI] Build kiwix-lib on macOS
This commit is contained in:
parent
9acd6b3447
commit
3ad73093f5
|
@ -1,4 +1,5 @@
|
||||||
language: cpp
|
language: cpp
|
||||||
|
|
||||||
dist: trusty
|
dist: trusty
|
||||||
sudo: required
|
sudo: required
|
||||||
branches:
|
branches:
|
||||||
|
@ -6,8 +7,11 @@ branches:
|
||||||
- master
|
- master
|
||||||
- /\d+\.\d+\.\d+$/
|
- /\d+\.\d+\.\d+$/
|
||||||
if: type != push OR tag IS present
|
if: type != push OR tag IS present
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- eval "${MATRIX_EVAL}"
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then eval "${MATRIX_EVAL}"; fi
|
||||||
|
- PATH=$PATH:${HOME}/bin
|
||||||
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=$PATH:$(brew --prefix)/opt/gettext/bin; fi
|
||||||
- ${CXX} --version
|
- ${CXX} --version
|
||||||
- openssl aes-256-cbc -K $encrypted_eba2f7543984_key -iv $encrypted_eba2f7543984_iv
|
- openssl aes-256-cbc -K $encrypted_eba2f7543984_key -iv $encrypted_eba2f7543984_iv
|
||||||
-in travis/travisci_builder_id_key.enc -out travis/travisci_builder_id_key -d
|
-in travis/travisci_builder_id_key.enc -out travis/travisci_builder_id_key -d
|
||||||
|
@ -66,6 +70,8 @@ matrix:
|
||||||
if: type!=cron AND type!=pull_request
|
if: type!=cron AND type!=pull_request
|
||||||
- env: PLATFORM="android_mips64"
|
- env: PLATFORM="android_mips64"
|
||||||
if: type!=cron AND type!=pull_request
|
if: type!=cron AND type!=pull_request
|
||||||
|
- env: PLATFORM="native_dyn"
|
||||||
|
os: osx
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
irc:
|
irc:
|
||||||
|
|
|
@ -14,6 +14,7 @@ from urllib.error import URLError
|
||||||
from kiwixbuild import dependency_versions
|
from kiwixbuild import dependency_versions
|
||||||
|
|
||||||
PLATFORM = environ['PLATFORM']
|
PLATFORM = environ['PLATFORM']
|
||||||
|
TRAVIS_OS_NAME = environ['TRAVIS_OS_NAME']
|
||||||
|
|
||||||
def home():
|
def home():
|
||||||
return Path(os.path.expanduser('~'))
|
return Path(os.path.expanduser('~'))
|
||||||
|
@ -111,7 +112,8 @@ def make_archive(project, platform):
|
||||||
def make_deps_archive(target, full=False):
|
def make_deps_archive(target, full=False):
|
||||||
(BASE_DIR/'.install_packages_ok').unlink()
|
(BASE_DIR/'.install_packages_ok').unlink()
|
||||||
|
|
||||||
archive_name = "deps_{}_{}.tar.gz".format(PLATFORM, target)
|
archive_name = "deps_{}_{}_{}.tar.gz".format(
|
||||||
|
TRAVIS_OS_NAME, PLATFORM, target)
|
||||||
files_to_archive = [BASE_DIR/'INSTALL']
|
files_to_archive = [BASE_DIR/'INSTALL']
|
||||||
files_to_archive += BASE_DIR.glob('**/android-ndk*')
|
files_to_archive += BASE_DIR.glob('**/android-ndk*')
|
||||||
if (BASE_DIR/'meson_cross_file.txt').exists():
|
if (BASE_DIR/'meson_cross_file.txt').exists():
|
||||||
|
@ -159,7 +161,8 @@ make_release = re.fullmatch(r"[0-9]+\.[0-9]+\.[0-9]+", environ.get('TRAVIS_TAG',
|
||||||
|
|
||||||
# The first thing we need to do is to (potentially) download already compiled base dependencies.
|
# The first thing we need to do is to (potentially) download already compiled base dependencies.
|
||||||
BASE_DEP_VERSION = dependency_versions.base_deps_meta_version
|
BASE_DEP_VERSION = dependency_versions.base_deps_meta_version
|
||||||
base_dep_archive_name = "base_deps_{}_{}.tar.gz".format(PLATFORM, BASE_DEP_VERSION)
|
base_dep_archive_name = "base_deps_{}_{}_{}.tar.gz".format(
|
||||||
|
TRAVIS_OS_NAME, PLATFORM, BASE_DEP_VERSION)
|
||||||
|
|
||||||
print("--- Getting archive {} ---".format(base_dep_archive_name), flush=True)
|
print("--- Getting archive {} ---".format(base_dep_archive_name), flush=True)
|
||||||
try:
|
try:
|
||||||
|
@ -183,6 +186,9 @@ if environ['TRAVIS_EVENT_TYPE'] != 'cron' and not make_release:
|
||||||
if PLATFORM.startswith('android'):
|
if PLATFORM.startswith('android'):
|
||||||
TARGETS = ('kiwix-android',)
|
TARGETS = ('kiwix-android',)
|
||||||
elif PLATFORM.startswith('native_'):
|
elif PLATFORM.startswith('native_'):
|
||||||
|
if TRAVIS_OS_NAME == "osx":
|
||||||
|
TARGETS = ('kiwix-lib', )
|
||||||
|
else:
|
||||||
TARGETS = ('kiwix-tools', 'zim-tools', 'zimwriterfs')
|
TARGETS = ('kiwix-tools', 'zim-tools', 'zimwriterfs')
|
||||||
else:
|
else:
|
||||||
TARGETS = ('kiwix-tools', )
|
TARGETS = ('kiwix-tools', )
|
||||||
|
@ -201,6 +207,9 @@ if PLATFORM.startswith('android'):
|
||||||
else:
|
else:
|
||||||
TARGETS = ('libzim', 'kiwix-lib', 'kiwix-android')
|
TARGETS = ('libzim', 'kiwix-lib', 'kiwix-android')
|
||||||
elif PLATFORM.startswith('native_'):
|
elif PLATFORM.startswith('native_'):
|
||||||
|
if TRAVIS_OS_NAME == "osx":
|
||||||
|
TARGETS = ('libzim', 'zimwriterfs', 'zim-tools', 'kiwix-lib')
|
||||||
|
else:
|
||||||
TARGETS = ('libzim', 'zimwriterfs', 'zim-tools', 'kiwix-lib', 'kiwix-tools')
|
TARGETS = ('libzim', 'zimwriterfs', 'zim-tools', 'kiwix-lib', 'kiwix-tools')
|
||||||
else:
|
else:
|
||||||
TARGETS = ('libzim', 'kiwix-lib', 'kiwix-tools')
|
TARGETS = ('libzim', 'kiwix-lib', 'kiwix-tools')
|
||||||
|
|
|
@ -2,13 +2,24 @@
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
pip3 install --user --upgrade pip wheel
|
if [[ "$TRAVIS_OS_NAME" == "osx" ]]
|
||||||
pip3 install --user pillow
|
then
|
||||||
|
brew update
|
||||||
|
brew upgrade python3
|
||||||
|
pip3 install pillow
|
||||||
|
pip3 install .
|
||||||
|
|
||||||
pip3 install --user .
|
wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-mac.zip
|
||||||
|
unzip ninja-mac.zip ninja
|
||||||
|
else
|
||||||
|
pip3 install --user --upgrade pip wheel
|
||||||
|
pip3 install --user pillow
|
||||||
|
pip3 install --user .
|
||||||
|
|
||||||
# ninja
|
wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip
|
||||||
wget https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip
|
unzip ninja-linux.zip ninja
|
||||||
unzip ninja-linux.zip ninja
|
fi
|
||||||
|
|
||||||
|
mkdir -p $HOME/bin
|
||||||
cp ninja $HOME/bin
|
cp ninja $HOME/bin
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue