diff --git a/kiwixbuild/__init__.py b/kiwixbuild/__init__.py index 5872732..bb7d6c0 100644 --- a/kiwixbuild/__init__.py +++ b/kiwixbuild/__init__.py @@ -38,6 +38,8 @@ def parse_args(): help="Clean all intermediate files after the (successfull) build") subgroup.add_argument('--dont-install-packages', action='store_true', help="Do not try to install packages before compiling") + subgroup.add_argument('--assume-packages-installed', action='store_true', + help="Assume the package to install to be aleady installed") subgroup.add_argument('--android-arch', action='append', help=("Specify the architecture to build for android application/libraries.\n" "Can be specified several times to build for several architectures.\n" diff --git a/kiwixbuild/builder.py b/kiwixbuild/builder.py index 1b60056..9df8762 100644 --- a/kiwixbuild/builder.py +++ b/kiwixbuild/builder.py @@ -149,6 +149,10 @@ class Builder: packages_to_have = self._get_packages() packages_to_have = remove_duplicates(packages_to_have) + if option('assume_packages_installed'): + print("SKIP, Assume package installed") + return + distname = neutralEnv('distname') if distname in ('fedora', 'redhat', 'centos'): package_installer = 'sudo dnf install {}' diff --git a/travis/compile_all.py b/travis/compile_all.py index 1301ead..f97a25a 100755 --- a/travis/compile_all.py +++ b/travis/compile_all.py @@ -75,6 +75,8 @@ def run_kiwix_build(target, platform, command = ['kiwix-build'] command.append(target) command.append('--hide-progress') + if platform == 'flatpak': + command.append('--assume-packages-installed') if target == 'kiwix-android' and platform.startswith('android_'): command.extend(['--target-platform', 'android', '--android-arch', platform[8:]]) elif platform == 'android':