From 35b92950874d1ba4046c582a5d78e1f935732949 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 27 Jan 2023 11:47:22 -0300 Subject: [PATCH] gst-env: Handle installing python modules to dist-packages Part-of: --- gst-env.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gst-env.py b/gst-env.py index fb266adad3..a1868c1b8f 100755 --- a/gst-env.py +++ b/gst-env.py @@ -430,8 +430,13 @@ def get_subprocess_env(options, gst_version): # /usr/lib/site-packages/foo/bar.py , we will not add anything # to PYTHONPATH, but the current approach works with pygobject # and gst-python at least. + py_package = None if 'site-packages' in installpath_parts: - install_subpath = os.path.join(*installpath_parts[installpath_parts.index('site-packages') + 1:]) + py_package = 'site-packages' + elif 'dist-packages' in installpath_parts: + py_package = 'dist-packages' + if py_package: + install_subpath = os.path.join(*installpath_parts[installpath_parts.index(py_package) + 1:]) if path.endswith(install_subpath): if os.path.commonprefix(["gi/overrides", install_subpath]): overrides_dirs.add(os.path.dirname(path))