diff options
author | Philippe Normand <philn@igalia.com> | 2019-11-02 16:27:16 +0100 |
---|---|---|
committer | Philippe Normand <philn@igalia.com> | 2019-11-06 09:33:46 +0100 |
commit | 2e6bd1ca8d4e09fa7c5f5c8a39ce110d6e9f290c (patch) | |
tree | 7597cabd56d73fa1d3c08b148f5f34f4cfbdb981 /gst-env.py | |
parent | aded9c617fa334774d746ef0ebd3cd879c343bb4 (diff) | |
download | gstreamer-2e6bd1ca8d4e09fa7c5f5c8a39ce110d6e9f290c.tar.gz |
gst-env: Fix the gst plugin file path regex for Linux platforms
On Linux, the library file is stored in the platform triplet directory under the
lib directory (hence for example
lib/x86_64-linux-gnu/gstreamer-1.0/libgstfoo.so) so the regex needs to take this
into account.
With this change the LD_LIBRARY_PATH on Linux now contains only the directories
with gst libs, ignoring the plugins, as initially intended in
c6613d8da2191aaf2bd7d1ddd4130a289b02e1ba.
Fixes #56
Diffstat (limited to 'gst-env.py')
-rwxr-xr-x | gst-env.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gst-env.py b/gst-env.py index c5e2fc801a..d368a21b0a 100755 --- a/gst-env.py +++ b/gst-env.py @@ -30,8 +30,11 @@ if not os.path.exists(DEFAULT_BUILDDIR): TYPELIB_REG = re.compile(r'.*\.typelib$') SHAREDLIB_REG = re.compile(r'\.so|\.dylib|\.dll') -GSTPLUGIN_FILEPATH_REG = re.compile(r'.*/lib[^/]*/gstreamer-1.0/[^/]+$') +# libdir is expanded from option of the same name listed in the `meson +# introspect --buildoptions` output. +GSTPLUGIN_FILEPATH_REG_TEMPLATE = r'.*/{libdir}/gstreamer-1.0/[^/]+$' +GSTPLUGIN_FILEPATH_REG = None def listify(o): if isinstance(o, str): @@ -84,6 +87,10 @@ def is_library_target_and_not_plugin(target, filename): # None of the installed files in the target correspond to the built # filename, so skip return False + + global GSTPLUGIN_FILEPATH_REG + if GSTPLUGIN_FILEPATH_REG is None: + GSTPLUGIN_FILEPATH_REG = re.compile(GSTPLUGIN_FILEPATH_REG_TEMPLATE) if GSTPLUGIN_FILEPATH_REG.search(install_filename.replace('\\', '/')): return False return True @@ -194,6 +201,15 @@ def get_subprocess_env(options, gst_version): paths = set() mono_paths = set() srcdir_path = pathlib.Path(options.srcdir) + + build_options_s = subprocess.check_output(meson + ['introspect', options.builddir, '--buildoptions']) + build_options = json.loads(build_options_s.decode()) + libdir, = [o['value'] for o in build_options if o['name'] == 'libdir'] + libdir = libdir.replace('\\', '/') + + global GSTPLUGIN_FILEPATH_REG_TEMPLATE + GSTPLUGIN_FILEPATH_REG_TEMPLATE = GSTPLUGIN_FILEPATH_REG_TEMPLATE.format(libdir=libdir) + for target in targets: filenames = listify(target['filename']) for filename in filenames: |