From bf1aa16608a181e67869adf46fa532fc4a7ce9f6 Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Mon, 5 Sep 2016 11:54:46 -0300 Subject: [PATCH] Add [gst-]python support --- gst-uninstalled.py | 32 +++++++++++++++++++++++++++++++- meson.build | 7 ++++--- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/gst-uninstalled.py b/gst-uninstalled.py index b4ea6ea1e4..94a99ba22f 100755 --- a/gst-uninstalled.py +++ b/gst-uninstalled.py @@ -1,7 +1,9 @@ #!/usr/bin/env python3 -import os import argparse +import os +import re +import site import subprocess @@ -12,6 +14,7 @@ def prepend_env_var(env, var, value): env[var] = os.pathsep + value + os.pathsep + env.get(var, "") env[var] = env[var].replace(os.pathsep + os.pathsep, os.pathsep).strip(os.pathsep) + def set_prompt_var(options, env): ps1 = env.get("PS1") if ps1: @@ -68,6 +71,33 @@ def get_subprocess_env(options): env["GST_PTP_HELPER"] = os.path.normpath( "%s/subprojects/gstreamer/libs/gst/helpers/gst-ptp-helper" % options.builddir) env["GST_REGISTRY"] = os.path.normpath(options.builddir + "/registry.dat") + prepend_env_var(env, 'PYTHONPATH', ':'.join(site.getsitepackages())) + env["PYTHONPATH"] = env["PYTHONPATH"] + ':' + os.path.normpath( + options.builddir + '/subprojects/gst-python') + + filename = "meson.build" + sharedlib_reg = re.compile(r'\.so$|\.dylib$') + typelib_reg = re.compile(r'.*\.typelib$') + for root, dirnames, filenames in os.walk(os.path.join(options.builddir, + 'subprojects')): + has_typelib = False + has_shared = False + for filename in filenames: + if typelib_reg.search(filename) and not has_typelib: + has_typelib = True + prepend_env_var(env, "GI_TYPELIB_PATH", + os.path.join(options.builddir, root)) + if has_shared: + break + elif sharedlib_reg.search(filename) and not has_shared: + has_shared = True + prepend_env_var(env, "LD_LIBRARY_PATH", + os.path.join(options.builddir, root)) + prepend_env_var(env, "DYLD_LIBRARY_PATH", + os.path.join(options.builddir, root)) + if has_typelib: + break + set_prompt_var(options, env) diff --git a/meson.build b/meson.build index 9709864992..721c7151fd 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ -project('gstreamer uninstalled', 'c', version : '1.9.1.1') +project('All GStreamer modules', 'c', version : '1.9.2.1') -gst_version = meson.project_version() +gst_version = '>= @0@'.format(meson.project_version()) gst_branch = 'master' glib_req = '>= 2.40.0' @@ -12,7 +12,8 @@ subprojects = [ 'gst-plugins-ugly', 'gst-plugins-bad', 'gst-devtools', - 'gst-editing-services' + 'gst-editing-services', + 'gst-python' ] # FIXME Remove that check once we have ffmpeg as a gst-libav subproject