Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame^] | 1 | From 2e9582167bf9d3273004edb2637310531f0155ab Mon Sep 17 00:00:00 2001 |
Brad Bishop | a5c52ff | 2018-11-23 10:55:50 +1300 | [diff] [blame] | 2 | From: Alexander Kanavin <alex.kanavin@gmail.com> |
| 3 | Date: Mon, 19 Nov 2018 14:24:26 +0100 |
| 4 | Subject: [PATCH] python module: do not manipulate the environment when calling |
| 5 | pkg-config |
| 6 | |
| 7 | Upstream-Status: Inappropriate [oe-core specific] |
| 8 | Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 9 | |
Brad Bishop | a5c52ff | 2018-11-23 10:55:50 +1300 | [diff] [blame] | 10 | --- |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame^] | 11 | mesonbuild/modules/python.py | 6 +----- |
| 12 | 1 file changed, 1 insertion(+), 5 deletions(-) |
Brad Bishop | a5c52ff | 2018-11-23 10:55:50 +1300 | [diff] [blame] | 13 | |
| 14 | diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame^] | 15 | index 3bbccd1..fda7a25 100644 |
Brad Bishop | a5c52ff | 2018-11-23 10:55:50 +1300 | [diff] [blame] | 16 | --- a/mesonbuild/modules/python.py |
| 17 | +++ b/mesonbuild/modules/python.py |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame^] | 18 | @@ -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 Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 22 | - old_pkg_libdir = os.environ.pop('PKG_CONFIG_LIBDIR', None) |
| 23 | - old_pkg_path = os.environ.pop('PKG_CONFIG_PATH', None) |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame^] | 24 | - os.environ['PKG_CONFIG_LIBDIR'] = pkg_libdir |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 25 | try: |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame^] | 26 | return PythonPkgConfigDependency(name, env, kwargs, installation, True) |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 27 | finally: |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame^] | 28 | @@ -288,8 +285,7 @@ def python_factory(env: 'Environment', for_machine: 'MachineChoice', |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 29 | 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 Bishop | a5c52ff | 2018-11-23 10:55:50 +1300 | [diff] [blame] | 35 | |
Patrick Williams | 03907ee | 2022-05-01 06:28:52 -0500 | [diff] [blame^] | 36 | 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, |