From d642a5493d241267a74ce29ab8c4d06fc0fc20db Mon Sep 17 00:00:00 2001 From: maxice8 Date: Sun, 9 Sep 2018 20:25:14 -0300 Subject: [PATCH] meson: add patch to fix caching of pkg-config files. Allows us to use the PKG_CONFIG variable to tell Meson which is the pkg-config to be used to get our native dependencies. We actually could always do that but Meson would cache the variable for the pkg-config file if we used the dependency() call without 'native: true' and after that all future usages of dependency() even with 'native: true' would use the cross-compile one. See this issue from where the patch came from: - https://github.com/mesonbuild/meson/issues/1736 --- .../patches/fix-pkg-config-native-not-found.patch | 15 +++++++++++++++ srcpkgs/meson/template | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/meson/patches/fix-pkg-config-native-not-found.patch diff --git a/srcpkgs/meson/patches/fix-pkg-config-native-not-found.patch b/srcpkgs/meson/patches/fix-pkg-config-native-not-found.patch new file mode 100644 index 00000000000..c364e9efa30 --- /dev/null +++ b/srcpkgs/meson/patches/fix-pkg-config-native-not-found.patch @@ -0,0 +1,15 @@ +Source: https://github.com/mesonbuild/meson/issues/1736 +Upstream: Unknown +Reason: prevents meson from caching a variable with the value of the cross-compile pkg-config that can be later used to fetch the value of a native pkg-config, fixes problems with finding native: true dependencies. + +--- mesonbuild/dependencies/base.py ++++ mesonbuild/dependencies/base.py +@@ -448,7 +448,6 @@ class PkgConfigDependency(ExternalDependency): + potential_pkgbin = ExternalProgram.from_cross_info(environment.cross_info, 'pkgconfig') + if potential_pkgbin.found(): + self.pkgbin = potential_pkgbin +- PkgConfigDependency.class_pkgbin = self.pkgbin + else: + mlog.debug('Cross pkg-config %s not found.' % potential_pkgbin.name) + # Only search for the native pkg-config the first time and + diff --git a/srcpkgs/meson/template b/srcpkgs/meson/template index 7098f671607..8b6b47d187d 100644 --- a/srcpkgs/meson/template +++ b/srcpkgs/meson/template @@ -1,7 +1,7 @@ # Template file for 'meson' pkgname=meson version=0.47.2 -revision=1 +revision=2 noarch=yes build_style=python3-module pycompile_module="mesonbuild"