blob: f01a6678181a033b431a366be7b4b4fb1de6184f [file] [log] [blame]
Patrick Williams03907ee2022-05-01 06:28:52 -05001From 2e9582167bf9d3273004edb2637310531f0155ab Mon Sep 17 00:00:00 2001
Brad Bishopa5c52ff2018-11-23 10:55:50 +13002From: Alexander Kanavin <alex.kanavin@gmail.com>
3Date: Mon, 19 Nov 2018 14:24:26 +0100
4Subject: [PATCH] python module: do not manipulate the environment when calling
5 pkg-config
6
7Upstream-Status: Inappropriate [oe-core specific]
8Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
Brad Bishop19323692019-04-05 15:28:33 -04009
Brad Bishopa5c52ff2018-11-23 10:55:50 +130010---
Patrick Williams03907ee2022-05-01 06:28:52 -050011 mesonbuild/modules/python.py | 6 +-----
12 1 file changed, 1 insertion(+), 5 deletions(-)
Brad Bishopa5c52ff2018-11-23 10:55:50 +130013
14diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py
Patrick Williams03907ee2022-05-01 06:28:52 -050015index 3bbccd1..fda7a25 100644
Brad Bishopa5c52ff2018-11-23 10:55:50 +130016--- a/mesonbuild/modules/python.py
17+++ b/mesonbuild/modules/python.py
Patrick Williams03907ee2022-05-01 06:28:52 -050018@@ -277,9 +277,6 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice',
19 # there is no LIBPC, so we can't search in it
20 return NotFoundDependency('python', env)
21
Andrew Geissler595f6302022-01-24 19:11:47 +000022- old_pkg_libdir = os.environ.pop('PKG_CONFIG_LIBDIR', None)
23- old_pkg_path = os.environ.pop('PKG_CONFIG_PATH', None)
Patrick Williams03907ee2022-05-01 06:28:52 -050024- os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir
Andrew Geissler595f6302022-01-24 19:11:47 +000025 try:
Patrick Williams03907ee2022-05-01 06:28:52 -050026 return PythonPkgConfigDependency(name, env, kwargs, installation, True)
Andrew Geissler595f6302022-01-24 19:11:47 +000027 finally:
Patrick Williams03907ee2022-05-01 06:28:52 -050028@@ -288,8 +285,7 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice',
Andrew Geissler595f6302022-01-24 19:11:47 +000029 os.environ[name] = value
30 elif name in os.environ:
31 del os.environ[name]
32- set_env('PKG_CONFIG_LIBDIR', old_pkg_libdir)
33- set_env('PKG_CONFIG_PATH', old_pkg_path)
34+ pass
Brad Bishopa5c52ff2018-11-23 10:55:50 +130035
Patrick Williams03907ee2022-05-01 06:28:52 -050036 candidates.append(functools.partial(wrap_in_pythons_pc_dir, pkg_name, env, kwargs, installation))
37 # We only need to check both, if a python install has a LIBPC. It might point to the wrong location,