Merge pull request #493 from kiwix/various_fix

This commit is contained in:
Matthieu Gautier 2021-07-06 10:39:40 +02:00 committed by GitHub
commit ee093b4dfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 22 additions and 19 deletions

View File

@ -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:

View File

@ -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,

View File

@ -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'

View File

@ -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))

View File

@ -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': {

View File

@ -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 {