From: Thibault Saunier Date: Mon, 5 Sep 2016 14:54:46 +0000 (-0300) Subject: Add [gst-]python support X-Git-Tag: 1.19.3~481^2~443 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bf1aa16608a181e67869adf46fa532fc4a7ce9f6;p=platform%2Fupstream%2Fgstreamer.git Add [gst-]python support --- diff --git a/gst-uninstalled.py b/gst-uninstalled.py index b4ea6ea..94a99ba 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 9709864..721c715 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