cccombiner: stop attaching caption buffers when caption pad has gone EOS
[platform/upstream/gstreamer.git] / gst-env.py
index 94dba9b..c64042d 100755 (executable)
@@ -302,7 +302,7 @@ def get_subprocess_env(options, gst_version):
                     options.sysroot)
 
     # gst-indent
-    prepend_env_var(env, "PATH", os.path.join(SCRIPTDIR, 'gstreamer', 'tools'),
+    prepend_env_var(env, "PATH", os.path.join(SCRIPTDIR, 'scripts'),
                     options.sysroot)
 
     # tools: gst-launch-1.0, gst-inspect-1.0
@@ -386,6 +386,7 @@ def get_subprocess_env(options, gst_version):
     presets = set()
     encoding_targets = set()
     python_dirs = setup_gdb(options)
+    overrides_dirs = set()
     if '--installed' in subprocess.check_output(meson + ['introspect', '-h']).decode():
         installed_s = subprocess.check_output(meson + ['introspect', options.builddir, '--installed'])
         for path, installpath in json.loads(installed_s.decode()).items():
@@ -406,7 +407,10 @@ def get_subprocess_env(options, gst_version):
             if 'site-packages' in installpath_parts:
                 install_subpath = os.path.join(*installpath_parts[installpath_parts.index('site-packages') + 1:])
                 if path.endswith(install_subpath):
-                    python_dirs.add(path[:len (install_subpath) * -1])
+                    if os.path.commonprefix(["gi/overrides", install_subpath]):
+                        overrides_dirs.add(os.path.dirname(path))
+                    else:
+                        python_dirs.add(path[:len (install_subpath) * -1])
 
             if path.endswith('.prs'):
                 presets.add(os.path.dirname(path))
@@ -432,11 +436,18 @@ def get_subprocess_env(options, gst_version):
     for python_dir in sorted(python_dirs):
         prepend_env_var(env, 'PYTHONPATH', python_dir, options.sysroot)
 
+    for python_dir in sorted(overrides_dirs):
+        prepend_env_var(env, '_GI_OVERRIDES_PATH', python_dir, options.sysroot)
+
     mesonpath = os.path.join(SCRIPTDIR, "meson")
     if os.path.join(mesonpath):
         # Add meson/ into PYTHONPATH if we are using a local meson
         prepend_env_var(env, 'PYTHONPATH', mesonpath, options.sysroot)
 
+    # Ensure that gst-python/gi is used first
+    prepend_env_var(env, "PYTHONPATH", os.path.join(SCRIPTDIR, 'subprojects', 'gst-python'),
+                    options.sysroot)
+
     # For devhelp books
     if 'XDG_DATA_DIRS' not in env or not env['XDG_DATA_DIRS']:
         # Preserve default paths when empty
@@ -471,7 +482,7 @@ if __name__ == "__main__":
                         help="The meson build directory")
     parser.add_argument("--gstbuilddir",
                         default=None,
-                        help="The meson gst-build build directory (defaults to builddir)")
+                        help="The meson GStreamer build directory (defaults to builddir)")
     parser.add_argument("--srcdir",
                         default=SCRIPTDIR,
                         help="The top level source directory")
@@ -496,7 +507,7 @@ if __name__ == "__main__":
         exit(1)
 
     if options.gstbuilddir and not os.path.exists(options.gstbuilddir):
-        print("gst-build is not built in %s\n\nBuild it and try again" %
+        print("GStreamer is not built in %s\n\nBuild it and try again" %
               options.gstbuilddir)
         exit(1)
     elif not options.gstbuilddir:
@@ -582,6 +593,10 @@ if __name__ == "__main__":
                 print('{}={}'.format(name, shlex.quote(value)))
                 print('export {}'.format(name))
         else:
+            if os.environ.get("CI_PROJECT_NAME"):
+                print("Ignoring SIGINT when running on the CI,"
+                      " as we get spurious sigint in there for some reason.")
+                signal.signal(signal.SIGINT, signal.SIG_IGN)
             exit(subprocess.call(args, close_fds=False, env=env))
 
     except subprocess.CalledProcessError as e: