diff --git a/kiwixbuild/buildenv.py b/kiwixbuild/buildenv.py index 05f1e1e..8348118 100644 --- a/kiwixbuild/buildenv.py +++ b/kiwixbuild/buildenv.py @@ -23,10 +23,13 @@ class PlatformNeutralEnv: self.detect_platform() self.ninja_command = self._detect_ninja() if not self.ninja_command: - sys.exit("ERROR: ninja command not found") + sys.exit("ERROR: ninja command not found.") self.meson_command = self._detect_meson() if not self.meson_command: - sys.exit("ERROR: meson command not found") + sys.exit("ERROR: meson command not found.") + self.qmake_command = self._detect_qmake() + if not self.qmake_command: + print("WARNING: qmake command not found.", file=sys.stderr) self.mesontest_command = "{} test".format(self.meson_command) def detect_platform(self): @@ -47,8 +50,8 @@ class PlatformNeutralEnv: where = where or self.archive_dir download_remote(what, where) - def _detect_ninja(self): - for n in ['ninja', 'ninja-build']: + def _detect_binary(self, *bin_variants): + for n in bin_variants: try: retcode = subprocess.check_call([n, '--version'], stdout=subprocess.DEVNULL) @@ -58,16 +61,15 @@ class PlatformNeutralEnv: if retcode == 0: return n + + def _detect_ninja(self): + return self._detect_binary('ninja', 'ninja-build') + def _detect_meson(self): - for n in ['meson.py', 'meson']: - try: - retcode = subprocess.check_call([n, '--version'], - stdout=subprocess.DEVNULL) - except (FileNotFoundError, PermissionError): - # Doesn't exist in PATH or isn't executable - continue - if retcode == 0: - return n + return self._detect_binary('meson.py', 'meson') + + def _detect_qmake(self): + return self._detect_binary('qmake-qt5', 'qmake') class BuildEnv: diff --git a/kiwixbuild/dependencies/base.py b/kiwixbuild/dependencies/base.py index bb8637d..4499929 100644 --- a/kiwixbuild/dependencies/base.py +++ b/kiwixbuild/dependencies/base.py @@ -448,11 +448,12 @@ class QMakeBuilder(MakeBuilder): def _configure(self, context): context.try_skip(self.build_path) cross_option = "" - command = ("qmake {configure_option}" + command = ("{command} {configure_option}" " {env_option}" " {source_path}" " {cross_option}") command = command.format( + command = neutralEnv('qmake_command'), configure_option=self.configure_option, env_option=self.env_option, source_path=self.source_path, diff --git a/kiwixbuild/dependencies/flatpak.py b/kiwixbuild/dependencies/flatpak.py index d4764ec..943c777 100644 --- a/kiwixbuild/dependencies/flatpak.py +++ b/kiwixbuild/dependencies/flatpak.py @@ -36,7 +36,7 @@ class org_kde(Dependency): self.command('install_sdk', self._install_sdk) -class org_kde(Dependency): +class io_qt_qtwebengine(Dependency): neutral = False name = 'io.qt.qtwebengine' diff --git a/kiwixbuild/dependencies/libkiwix.py b/kiwixbuild/dependencies/libkiwix.py index 21a9b31..e441391 100644 --- a/kiwixbuild/dependencies/libkiwix.py +++ b/kiwixbuild/dependencies/libkiwix.py @@ -64,7 +64,7 @@ class LibkiwixApp(Dependency): except FileNotFoundError: pass if not os.path.exists(self.build_path): - shutil.copytree(pj(self.source_path, 'android-libkiwix-publisher'), self.build_path, symlinks=True) + shutil.copytree(pj(self.source_path, 'android-kiwix-lib-publisher'), self.build_path, symlinks=True) for arch in option('android_arch'): try: kiwix_builder = get_target_step('libkiwix', 'android_{}'.format(arch)) diff --git a/kiwixbuild/packages.py b/kiwixbuild/packages.py index 69fc35a..162cdbf 100644 --- a/kiwixbuild/packages.py +++ b/kiwixbuild/packages.py @@ -1,6 +1,6 @@ -_fedora_common = ['automake', 'libtool', 'cmake', 'git', 'subversion', 'ccache', 'pkg-config', 'gcc-c++', 'gettext-devel'] +_fedora_common = ['automake', 'libtool', 'cmake', 'git', 'subversion', 'ccache', 'pkgconf-pkg-config', 'gcc-c++', 'gettext-devel'] _debian_common = ['automake', 'libtool', 'cmake', 'git', 'subversion', 'ccache', 'pkg-config', 'gcc', 'autopoint'] PACKAGE_NAME_MAPPERS = { 'flatpak': { @@ -27,7 +27,7 @@ PACKAGE_NAME_MAPPERS = { 'file' : ['file-devel'], 'gumbo' : ['gumbo-parser-devel'], 'aria2': ['aria2'], - 'qt': ['qt5-qtbase-devel', 'qt5-devel', 'qt5-qtsvg'], + 'qt': ['qt5-qtbase-devel', 'qt5-qtsvg'], 'qtwebengine': ['qt5-qtwebengine-devel'] }, 'fedora_native_static': { diff --git a/kiwixbuild/platforms/win32.py b/kiwixbuild/platforms/win32.py index 444e8cd..2d2a2cf 100644 --- a/kiwixbuild/platforms/win32.py +++ b/kiwixbuild/platforms/win32.py @@ -9,7 +9,7 @@ class Win32PlatformInfo(PlatformInfo): build = 'win32' compatible_hosts = ['fedora', 'debian'] arch_full = 'i686-w64-mingw32' - extra_libs = ['-lwinmm', '-lshlwapi', '-lws2_32'] + extra_libs = ['-lwinmm', '-lshlwapi', '-lws2_32', '-lssp'] def get_cross_config(self): return {