From 2774967e6d2eae0b1361e4d3f20112b5e55a0917 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Mon, 20 Jan 2020 21:28:39 +0100 Subject: [PATCH] Set the pkg-config for cross-compiling. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is needed for win32 on fedora. It is better to use a specific pkg-config than setting a PKG_CONFIG_LIBDIR. This avoid other CIĀ (libzim/...) to set a env var specific to win32 build. --- kiwixbuild/platforms/android.py | 6 ++++-- kiwixbuild/platforms/armhf.py | 6 ++++-- kiwixbuild/platforms/i586.py | 3 ++- kiwixbuild/platforms/ios.py | 1 + kiwixbuild/platforms/win32.py | 3 ++- kiwixbuild/templates/meson_cross_file.txt | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) diff --git a/kiwixbuild/platforms/android.py b/kiwixbuild/platforms/android.py index 1a8e3a4..668a2ab 100644 --- a/kiwixbuild/platforms/android.py +++ b/kiwixbuild/platforms/android.py @@ -26,8 +26,10 @@ class AndroidPlatformInfo(PlatformInfo): def binaries(self): install_path = self.install_path - return {k:pj(install_path, 'bin', v) - for k,v in self.binaries_name.items()} + binaries = {k:pj(install_path, 'bin', v) + for k,v in self.binaries_name.items()} + binaries['PKGCONFIG'] = 'pkg-config' + return binaries @property def ndk_builder(self): diff --git a/kiwixbuild/platforms/armhf.py b/kiwixbuild/platforms/armhf.py index d07710d..6e0497d 100644 --- a/kiwixbuild/platforms/armhf.py +++ b/kiwixbuild/platforms/armhf.py @@ -49,8 +49,10 @@ class ArmhfPlatformInfo(PlatformInfo): ('RANLIB', 'ranlib'), ('LD', 'ld')) ) - return {k:pj(self.root_path, 'bin', v) - for k,v in binaries} + binaries = {k:pj(self.root_path, 'bin', v) + for k,v in binaries} + binaries['PKGCONFIG'] = 'pkg-config' + return binaries @property def exe_wrapper_def(self): diff --git a/kiwixbuild/platforms/i586.py b/kiwixbuild/platforms/i586.py index ec1160a..e090001 100644 --- a/kiwixbuild/platforms/i586.py +++ b/kiwixbuild/platforms/i586.py @@ -37,7 +37,8 @@ class I586PlatformInfo(PlatformInfo): ('AR', 'ar'), ('STRIP', 'strip'), ('RANLIB', 'ranlib'), - ('LD', 'ld')) + ('LD', 'ld'), + ('PKGCONFIG', 'pkg-config')) } def set_env(self, env): diff --git a/kiwixbuild/platforms/ios.py b/kiwixbuild/platforms/ios.py index 523d426..df08374 100644 --- a/kiwixbuild/platforms/ios.py +++ b/kiwixbuild/platforms/ios.py @@ -64,6 +64,7 @@ class iOSPlatformInfo(PlatformInfo): 'STRIP': '/usr/bin/strip', 'RANLIB': '/usr/bin/ranlib', 'LD': '/usr/bin/ld', + 'PKGCONFIG': 'pkg-config', } @property diff --git a/kiwixbuild/platforms/win32.py b/kiwixbuild/platforms/win32.py index b2f3fa6..17b37c4 100644 --- a/kiwixbuild/platforms/win32.py +++ b/kiwixbuild/platforms/win32.py @@ -49,7 +49,8 @@ class Win32PlatformInfo(PlatformInfo): ('AR', 'ar'), ('STRIP', 'strip'), ('WINDRES', 'windres'), - ('RANLIB', 'ranlib')) + ('RANLIB', 'ranlib'), + ('PKGCONFIG', 'pkg-config')) } @property diff --git a/kiwixbuild/templates/meson_cross_file.txt b/kiwixbuild/templates/meson_cross_file.txt index 6a664de..d5e6716 100644 --- a/kiwixbuild/templates/meson_cross_file.txt +++ b/kiwixbuild/templates/meson_cross_file.txt @@ -1,5 +1,5 @@ [binaries] -pkgconfig = 'pkg-config' +pkgconfig = '{binaries[PKGCONFIG]}' c = '{binaries[CC]}' ar = '{binaries[AR]}' cpp = '{binaries[CXX]}'