gst-env: Use meson-uninstalled pkgconfig files if available
authorNirbheek Chauhan <nirbheek@centricular.com>
Fri, 12 Jun 2020 13:29:17 +0000 (18:59 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Fri, 12 Jun 2020 13:51:52 +0000 (19:21 +0530)
This allows people to use the development environment for building
projects when glib is built as a subproject.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/158>

gst-env.py

index 11ca421..34f8f21 100755 (executable)
@@ -358,6 +358,11 @@ def get_subprocess_env(options, gst_version):
         for pkg_dir in pkg_dirs:
             prepend_env_var(env, "PKG_CONFIG_PATH", pkg_dir, options.sysroot)
 
+    # Check if meson has generated -uninstalled pkgconfig files
+    meson_uninstalled = pathlib.Path(options.builddir) / 'meson-uninstalled'
+    if meson_uninstalled.is_dir():
+        prepend_env_var(env, 'PKG_CONFIG_PATH', str(meson_uninstalled), options.sysroot)
+
     for python_dir in python_dirs:
         prepend_env_var(env, 'PYTHONPATH', python_dir, options.sysroot)