mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 22:36:33 +00:00
Fix distcheck by setting up overrides in plugin init
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-python/-/merge_requests/40>
This commit is contained in:
parent
98519897ca
commit
c6c4fc40b9
1 changed files with 17 additions and 0 deletions
|
@ -217,6 +217,7 @@ plugin_init (GstPlugin * plugin)
|
||||||
gboolean we_initialized = FALSE;
|
gboolean we_initialized = FALSE;
|
||||||
GModule *libpython;
|
GModule *libpython;
|
||||||
gpointer has_python = NULL;
|
gpointer has_python = NULL;
|
||||||
|
const gchar *override_path;
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_INIT (pyplugindebug, "pyplugin", 0,
|
GST_DEBUG_CATEGORY_INIT (pyplugindebug, "pyplugin", 0,
|
||||||
"Python plugin loader");
|
"Python plugin loader");
|
||||||
|
@ -254,6 +255,22 @@ plugin_init (GstPlugin * plugin)
|
||||||
state = PyGILState_Ensure ();
|
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 ("Running with python version '%s'", Py_GetVersion ());
|
||||||
|
|
||||||
GST_LOG ("initializing pygobject");
|
GST_LOG ("initializing pygobject");
|
||||||
|
|
Loading…
Reference in a new issue