summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@igalia.com>2020-08-20 16:03:36 -0400
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>2020-08-24 18:15:50 +0000
commitc6c4fc40b94fe4b400fbc28b03539d7b80ad6977 (patch)
tree1a1fb9680864ef9e27c7b26ab85fa984a4ab5738
parent98519897cab59bf97137927307af193e5014d2e0 (diff)
Fix distcheck by setting up overrides in plugin init
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-python/-/merge_requests/40>
-rw-r--r--plugin/gstpythonplugin.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugin/gstpythonplugin.c b/plugin/gstpythonplugin.c
index 9b31581..90c1dd6 100644
--- a/plugin/gstpythonplugin.c
+++ b/plugin/gstpythonplugin.c
@@ -217,6 +217,7 @@ plugin_init (GstPlugin * plugin)
gboolean we_initialized = FALSE;
GModule *libpython;
gpointer has_python = NULL;
+ const gchar *override_path;
GST_DEBUG_CATEGORY_INIT (pyplugindebug, "pyplugin", 0,
"Python plugin loader");
@@ -254,6 +255,22 @@ plugin_init (GstPlugin * plugin)
state = PyGILState_Ensure ();
}
+ if ((override_path = g_getenv ("GST_OVERRIDE_SRC_PATH"))) {
+ gchar *overrides_setup =
+ g_build_filename (override_path, "..", "..", "testsuite",
+ "overrides_hack.py", NULL);
+ FILE *fd = fopen (overrides_setup, "rb");
+
+ if (!fd || PyRun_SimpleFileExFlags (fd, overrides_setup, 1, 0)) {
+ g_free (overrides_setup);
+
+ return FALSE;
+ } else {
+ g_free (overrides_setup);
+ GST_INFO ("Imported overrides setup");
+ }
+ }
+
GST_LOG ("Running with python version '%s'", Py_GetVersion ());
GST_LOG ("initializing pygobject");