dev-util/meson: fix test_pkgconfig_gen_deps
authorMike Gilbert <floppym@gentoo.org>
Tue, 14 Jan 2020 05:17:47 +0000 (00:17 -0500)
committerMike Gilbert <floppym@gentoo.org>
Tue, 14 Jan 2020 05:18:04 +0000 (00:18 -0500)
Closes: https://bugs.gentoo.org/705352
Package-Manager: Portage-2.3.84_p2, Repoman-2.3.20_p24
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
dev-util/meson/files/0.52.1-test_pkgconfig_gen_deps.patch [new file with mode: 0644]
dev-util/meson/meson-0.52.1.ebuild
dev-util/meson/meson-0.53.0.ebuild

diff --git a/dev-util/meson/files/0.52.1-test_pkgconfig_gen_deps.patch b/dev-util/meson/files/0.52.1-test_pkgconfig_gen_deps.patch
new file mode 100644 (file)
index 0000000..ec753e0
--- /dev/null
@@ -0,0 +1,46 @@
+From 1ce668f9163e1c912382eeb0e6ae40d123c0cca9 Mon Sep 17 00:00:00 2001
+From: Mike Gilbert <floppym@gentoo.org>
+Date: Mon, 13 Jan 2020 23:46:09 -0500
+Subject: [PATCH] test_pkgconfig_gen_deps: set
+ PKG_CONFIG_SYSTEM_LIBRARY_PATH=/usr/lib
+
+pkgconf automatically prunes "system library paths" from its output. The
+system library paths depend on the system toolchain. A common value on a
+64-bit system is as follows:
+
+/lib64:/usr/lib64:/usr/local/lib64
+
+So, if -L/usr/lib64 appears in the Libs section, it will be pruned from
+the output of pkg-config --libs.
+
+The pc files generated for this test contain something like this:
+
+libdir=/usr/lib
+Libs: -L${libdir} ...
+
+pkgconf may not consider /usr/lib to be a system library path, so it is
+not pruned as the test expects. To work around this, override the
+compiled-in list of paths via the PKG_CONFIG_SYSTEM_LIBRARY_PATH
+environment variable.
+
+Fixes: https://github.com/mesonbuild/meson/issues/6004
+---
+ run_unittests.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/run_unittests.py b/run_unittests.py
+index 898f05e54d..5a60b9b6a4 100755
+--- a/run_unittests.py
++++ b/run_unittests.py
+@@ -4832,7 +4832,10 @@ def test_pkgconfig_gen_deps(self):
+         privatedir2 = self.privatedir
+         os.environ
+-        env = {'PKG_CONFIG_LIBDIR': os.pathsep.join([privatedir1, privatedir2])}
++        env = {
++            'PKG_CONFIG_LIBDIR': os.pathsep.join([privatedir1, privatedir2]),
++            'PKG_CONFIG_SYSTEM_LIBRARY_PATH': '/usr/lib',
++        }
+         self._run(['pkg-config', 'dependency-test', '--validate'], override_envvars=env)
+         # pkg-config strips some duplicated flags so we have to parse the
index 85edd45c7d123db7a709ccfac8f767baff7885d1..3b5f7e24d00431f3933df428c343fe0713f124c2 100644 (file)
@@ -35,6 +35,10 @@ DEPEND="${RDEPEND}
 "
 
 python_prepare_all() {
+       local PATCHES=(
+               "${FILESDIR}"/0.52.1-test_pkgconfig_gen_deps.patch
+       )
+
        # ASAN and sandbox both want control over LD_PRELOAD
        # https://bugs.gentoo.org/673016
        sed -i -e 's/test_generate_gir_with_address_sanitizer/_&/' run_unittests.py || die
index e7ca1f73f7bf6e93c44b6b1abfa473a624a9eb29..c9252fd5abdff6ba5e987f27ccba4f8e5ac34561 100644 (file)
@@ -35,6 +35,10 @@ DEPEND="${RDEPEND}
 "
 
 python_prepare_all() {
+       local PATCHES=(
+               "${FILESDIR}"/0.52.1-test_pkgconfig_gen_deps.patch
+       )
+
        # ASAN and sandbox both want control over LD_PRELOAD
        # https://bugs.gentoo.org/673016
        sed -i -e 's/test_generate_gir_with_address_sanitizer/_&/' run_unittests.py || die