diff --git a/Dockerfile b/Dockerfile index c213dda..3237c40 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 \ @@ -37,8 +37,8 @@ RUN \ libmagic-dev \ zlib1g-dev \ uuid-dev \ - ctpp2-utils \ - libctpp2-dev \ +# ctpp2-utils \ +# libctpp2-dev \ libmicrohttpd-dev \ # Qt packages libqt5gui5 \ @@ -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 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() 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 ) 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)] 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/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'] 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 = { 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':