From 00aced4649fe4f99ad5334fb7c2eb45264812a30 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Thu, 5 Sep 2019 16:42:35 +0200 Subject: [PATCH] Use fedora 30 to cross compile kiwix-tools. --- .travis.yml | 5 ++++- kiwixbuild/packages.py | 2 +- travis/compile_all.py | 2 +- travis/f30_builder.dockerfile | 28 ++++++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 travis/f30_builder.dockerfile diff --git a/.travis.yml b/.travis.yml index d5ce174..365c76d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,9 @@ jobs: - stage: build_docker_images script: *build_images env: VARIANT=bionic + - stage: build_docker_images + script: *build_images + env: VARIANT=f30 - stage: android_build env: PLATFORM="android" if: type != pull_request @@ -70,7 +73,7 @@ script: then VARIANT=xenial if [[ $DESKTOP_ONLY = 1 ]]; then VARIANT=bionic; fi - if [[ $PLATFORM =~ ^win32_* ]]; then VARIANT=bionic; fi + if [[ $PLATFORM =~ ^win32_* ]]; then VARIANT=f30; fi fi - | if [[ $TRAVIS_OS_NAME = "linux" ]] diff --git a/kiwixbuild/packages.py b/kiwixbuild/packages.py index af9ad7b..69fc35a 100644 --- a/kiwixbuild/packages.py +++ b/kiwixbuild/packages.py @@ -1,6 +1,6 @@ -_fedora_common = ['automake', 'libtool', 'cmake', 'git', 'subversion', 'ccache', 'pkgconfig', 'gcc-c++', 'gettext-devel'] +_fedora_common = ['automake', 'libtool', 'cmake', 'git', 'subversion', 'ccache', 'pkg-config', 'gcc-c++', 'gettext-devel'] _debian_common = ['automake', 'libtool', 'cmake', 'git', 'subversion', 'ccache', 'pkg-config', 'gcc', 'autopoint'] PACKAGE_NAME_MAPPERS = { 'flatpak': { diff --git a/travis/compile_all.py b/travis/compile_all.py index 29a00a5..025ded7 100755 --- a/travis/compile_all.py +++ b/travis/compile_all.py @@ -89,7 +89,7 @@ def run_kiwix_build(target, platform, command = ['kiwix-build'] command.append(target) command.append('--hide-progress') - if platform == 'flatpak': + if platform == 'flatpak' or platform.startswith('win32_'): command.append('--assume-packages-installed') if target == 'kiwix-android' and platform.startswith('android_'): command.extend(['--target-platform', 'android', '--android-arch', platform[8:]]) diff --git a/travis/f30_builder.dockerfile b/travis/f30_builder.dockerfile new file mode 100644 index 0000000..99d68fe --- /dev/null +++ b/travis/f30_builder.dockerfile @@ -0,0 +1,28 @@ +FROM fedora:30 + +ENV LANG C.UTF-8 + +RUN dnf install -y --nodocs \ +# Base build tools + make automake libtool cmake git-core subversion pkg-config gcc-c++ \ + wget unzip ninja-build ccache which patch \ +# Cross win32 compiler + mingw32-gcc-c++ mingw32-bzip2-static mingw32-win-iconv-static \ + mingw32-winpthreads-static mingw32-zlib-static mingw32-xz-libs-static \ + mingw32-libmicrohttpd \ +# Other tools (to remove) +# vim less grep + && dnf remove -y "*-doc" \ + && dnf autoremove -y \ + && dnf clean all + +# Create user +RUN useradd --create-home ci_builder +USER ci_builder +WORKDIR /home/ci_builder +ENV PATH="/home/ci_builder/.local/bin:${PATH}" + +ENV TRAVIS_BUILD_DIR /home/ci_builder/kiwix-build +ENV TRAVIS_OS_NAME linux_f30 + +CMD pip3 install --user ./kiwix-build && kiwix-build/travis/compile_all.py