From e441b847b5dfb8217d388f68323664113c3a9acb Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 13 Jun 2018 14:40:23 +0200 Subject: [PATCH 1/7] Use gcc-4.8 to compile in Docker. Other travis-CI will use the default gcc version of ubuntu trusty. We must compile with the same compiler to ensure that we don't break ABI. --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c213dda..f9ec730 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,8 @@ RUN \ apt install -q -y --no-install-recommends \ # Base build tools build-essential \ -# gcc-5 \ -# g++-5 \ + gcc-4.8 \ + g++-4.8 \ automake \ libtool \ cmake \ @@ -73,6 +73,7 @@ RUN \ mv ninja /home/travis/.local/bin ;\ rm ninja-linux.zip ENV PATH="/home/travis/.local/bin:${PATH}" +ENV CC=gcc-4.8 CXX=g++-4.8 QMAKE_CC=gcc-4.8 QMAKE_CXX=g++-4.8 COPY . kiwix-build/ RUN sudo chown -R travis:travis /home/travis/kiwix-build From 4047ec20dd2d4f898aaf4ce31ad82b764d167754 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Thu, 14 Jun 2018 14:53:47 +0200 Subject: [PATCH 2/7] Add xapian patch to correctly include sys types. --- kiwixbuild/dependencies/xapian.py | 1 + kiwixbuild/patches/xapian_sys_types.patch | 12 ++++++++++++ kiwixbuild/versions.py | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 kiwixbuild/patches/xapian_sys_types.patch diff --git a/kiwixbuild/dependencies/xapian.py b/kiwixbuild/dependencies/xapian.py index 3d76cbc..d3c6a4f 100644 --- a/kiwixbuild/dependencies/xapian.py +++ b/kiwixbuild/dependencies/xapian.py @@ -14,6 +14,7 @@ class Xapian(Dependency): class Source(ReleaseDownload): archive = Remotefile('xapian-core-1.4.5.tar.xz', '85b5f952de9df925fd13e00f6e82484162fd506d38745613a50b0a2064c6b02b') + patches = ['xapian_sys_types.patch'] class Builder(MakeBuilder): configure_option = "--disable-sse --disable-backend-inmemory --disable-documentation" diff --git a/kiwixbuild/patches/xapian_sys_types.patch b/kiwixbuild/patches/xapian_sys_types.patch new file mode 100644 index 0000000..6a78712 --- /dev/null +++ b/kiwixbuild/patches/xapian_sys_types.patch @@ -0,0 +1,12 @@ +diff -ur xapian-core-1.4.5/backends/glass/glass_dbcheck.h xapian-core-1.4.5.patched/backends/glass/glass_dbcheck.h +--- xapian-core-1.4.5/backends/glass/glass_dbcheck.h 2017-10-16 04:32:24.000000000 +0200 ++++ xapian-core-1.4.5.patched/backends/glass/glass_dbcheck.h 2018-06-13 14:55:58.574898188 +0200 +@@ -24,7 +24,7 @@ + + #include "xapian/types.h" + +-#include // For size_t. ++#include // For size_t and off_t. + #include + #include + #include diff --git a/kiwixbuild/versions.py b/kiwixbuild/versions.py index f0f0f18..95ca19e 100644 --- a/kiwixbuild/versions.py +++ b/kiwixbuild/versions.py @@ -10,7 +10,7 @@ main_project_versions = { # This is the "version" of the whole base_deps_versions dict. # Change this when you change base_deps_versions. -base_deps_meta_version = '7' +base_deps_meta_version = '8' base_deps_versions = { From 8506cdeffdf878552c354e9fac08dadde654bcd3 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Thu, 14 Jun 2018 16:16:56 +0200 Subject: [PATCH 3/7] Correctly pass CMAKE_* to qmake. qmake doesn't use the env variables, we must pass the variables in the command line. --- kiwixbuild/dependencies/base.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/kiwixbuild/dependencies/base.py b/kiwixbuild/dependencies/base.py index cd3453e..6897ad2 100644 --- a/kiwixbuild/dependencies/base.py +++ b/kiwixbuild/dependencies/base.py @@ -371,14 +371,26 @@ class CMakeBuilder(MakeBuilder): class QMakeBuilder(MakeBuilder): qmake_target = "" + + @property + def env_option(self): + options = "" + if 'QMAKE_CC' in os.environ: + options += 'QMAKE_CC={} '.format(os.environ['QMAKE_CC']) + if 'QMAKE_CXX' in os.environ: + options += 'QMAKE_CXX={} '.format(os.environ['QMAKE_CXX']) + return options + def _configure(self, context): context.try_skip(self.build_path) cross_option = "" command = ("qmake {configure_option}" + " {env_option}" " {source_path}" " {cross_option}") command = command.format( configure_option=self.configure_option, + env_option=self.env_option, source_path=self.source_path, cross_option=cross_option ) From eed80c1ff972e84c7049594fe43ce0da12e09c45 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Thu, 14 Jun 2018 16:17:35 +0200 Subject: [PATCH 4/7] Correctly associate the source with the builder. --- kiwixbuild/builder.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kiwixbuild/builder.py b/kiwixbuild/builder.py index 9113078..6feee72 100644 --- a/kiwixbuild/builder.py +++ b/kiwixbuild/builder.py @@ -37,10 +37,12 @@ class Builder: steps = list(remove_duplicates(steps)) if option('build_nodeps'): + src_targetDef = ('source', targetDef[1]) + add_target_step(src_targetDef, self._targets[src_targetDef]) add_target_step(targetDef, self._targets[targetDef]) else: for dep in steps: - if option('build_deps_only') and dep == targetDef: + if option('build_deps_only') and dep[1] == targetDef[1]: continue add_target_step(dep, self._targets[dep]) self.instanciate_steps() From 1cbfcef9ce465cabce02dfe24717fe597b3d8103 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Thu, 14 Jun 2018 17:06:33 +0200 Subject: [PATCH 5/7] Fix kiwix-desktop dependencies. --- kiwixbuild/dependencies/kiwix_desktop.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kiwixbuild/dependencies/kiwix_desktop.py b/kiwixbuild/dependencies/kiwix_desktop.py index d309310..66e810a 100644 --- a/kiwixbuild/dependencies/kiwix_desktop.py +++ b/kiwixbuild/dependencies/kiwix_desktop.py @@ -5,13 +5,13 @@ from .base import ( class KiwixDesktop(Dependency): name = "kiwix-desktop" - dependencies = ["qt", "qtwebengine", "kiwix-lib"] class Source(GitClone): git_remote = "https://github.com/kiwix/kiwix-desktop.git" git_dir = "kiwix-desktop" class Builder(QMakeBuilder): + dependencies = ["qt", "qtwebengine", "kiwix-lib"] @property def configure_option(self): options = ["PREFIX={}".format(self.buildEnv.install_dir)] From 9ad07fe550b4e9b54f534c95cec86972302613a1 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Thu, 14 Jun 2018 17:07:36 +0200 Subject: [PATCH 6/7] Travis, do not try to compile deps if not needed. --- travis/compile_all.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/travis/compile_all.py b/travis/compile_all.py index 91c5a28..6b37c11 100755 --- a/travis/compile_all.py +++ b/travis/compile_all.py @@ -62,7 +62,11 @@ Generated at {date} date=date.today().isoformat())) -def run_kiwix_build(target, platform, build_deps_only=False, make_release=False, make_dist=False): +def run_kiwix_build(target, platform, + build_deps_only=False, + target_only=False, + make_release=False, + make_dist=False): command = ['kiwix-build'] command.append(target) command.append('--hide-progress') @@ -76,6 +80,8 @@ def run_kiwix_build(target, platform, build_deps_only=False, make_release=False, command.extend(['--target-platform', platform]) if build_deps_only: command.append('--build-deps-only') + if target_only: + command.append('--build-nodeps') if make_release: command.append('--make-release') if make_dist: @@ -276,7 +282,8 @@ for target in TARGETS: run_kiwix_build(target, platform=PLATFORM, - make_release=make_release) + make_release=make_release, + target_only=True) if target == 'kiwix-desktop': create_app_image() if make_release and PLATFORM == 'native_dyn': From b090353001b5b5dd0e9d681da433339e3d4e5b01 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Thu, 14 Jun 2018 17:09:36 +0200 Subject: [PATCH 7/7] Do not use the system ctpp2 in native_dyn debian. The CI is using ubuntu artful and the deb package is compiled with another compiler that gcc-4.8 (used in other project CI). As we compile everything with gcc-4.8, we must compile our own ctpp2. --- Dockerfile | 4 ++-- kiwixbuild/packages.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index f9ec730..3237c40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,8 +37,8 @@ RUN \ libmagic-dev \ zlib1g-dev \ uuid-dev \ - ctpp2-utils \ - libctpp2-dev \ +# ctpp2-utils \ +# libctpp2-dev \ libmicrohttpd-dev \ # Qt packages libqt5gui5 \ diff --git a/kiwixbuild/packages.py b/kiwixbuild/packages.py index d12ec57..2193953 100644 --- a/kiwixbuild/packages.py +++ b/kiwixbuild/packages.py @@ -55,8 +55,8 @@ PACKAGE_NAME_MAPPERS = { 'COMMON': _debian_common + ['libbz2-dev', 'libmagic-dev'], 'zlib': ['zlib1g-dev'], 'uuid': ['uuid-dev'], - 'ctpp2': ['libctpp2-dev'], - 'ctpp2c': ['ctpp2-utils'], + #'ctpp2': ['libctpp2-dev'], + #'ctpp2c': ['ctpp2-utils'], 'libmicrohttpd': ['libmicrohttpd-dev', 'ccache'], 'qt' : ['libqt5gui5', 'qtbase5-dev', 'qt5-default'], 'qtwebengine' : ['qtwebengine5-dev']