diff options
| author | Lukas Schmelting <lschmelting@posteo.com> | 2025-05-18 21:12:03 +0200 |
|---|---|---|
| committer | Sam James <sam@gentoo.org> | 2025-06-09 01:19:45 +0100 |
| commit | 0c58185159d8fc50552a6b718dff283fb9545589 (patch) | |
| tree | 3bc1f0d13c3c25aba059087bfa47e21a3cde127d /dev-python/gst-python | |
| parent | 85a518ccd0f838427a844e3334d7af7d47c431b2 (diff) | |
| download | gentoo-0c58185159d8fc50552a6b718dff283fb9545589.tar.gz gentoo-0c58185159d8fc50552a6b718dff283fb9545589.tar.bz2 gentoo-0c58185159d8fc50552a6b718dff283fb9545589.zip | |
dev-python/gst-python: Restrict for pygobject-3.52 compability
Moves to revision 1 and introduces:
- A <dev-python/pygobject-3.52 restriction for versions lower than 1.24.11-r1
- A dev-python/pygobject-3.52.3 compability patch for version 1.24.11-r1
Note that the move to revision 1 was done in a separate commit for
gst-python-1.22.11 to avoid git emitting a misleading diff.
Signed-off-by: Lukas Schmelting <lschmelting@posteo.com>
Part-of: https://github.com/gentoo/gentoo/pull/41404
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python/gst-python')
| -rw-r--r-- | dev-python/gst-python/files/gstreamer_compat__ge_pygobject-3.52.3.patch | 68 | ||||
| -rw-r--r-- | dev-python/gst-python/gst-python-1.22.12-r1.ebuild (renamed from dev-python/gst-python/gst-python-1.22.12.ebuild) | 4 | ||||
| -rw-r--r-- | dev-python/gst-python/gst-python-1.24.10-r1.ebuild (renamed from dev-python/gst-python/gst-python-1.24.10.ebuild) | 6 | ||||
| -rw-r--r-- | dev-python/gst-python/gst-python-1.24.11-r1.ebuild (renamed from dev-python/gst-python/gst-python-1.24.11.ebuild) | 7 |
4 files changed, 81 insertions, 4 deletions
diff --git a/dev-python/gst-python/files/gstreamer_compat__ge_pygobject-3.52.3.patch b/dev-python/gst-python/files/gstreamer_compat__ge_pygobject-3.52.3.patch new file mode 100644 index 000000000000..8096dd65c67e --- /dev/null +++ b/dev-python/gst-python/files/gstreamer_compat__ge_pygobject-3.52.3.patch @@ -0,0 +1,68 @@ +From 0496a778bb85e0b263ed2fddfcf3dac7961fe4f5 Mon Sep 17 00:00:00 2001 +From: Matteo Bruni <matteo.bruni@gmail.com> +Date: Thu, 20 Mar 2025 10:09:21 +0100 +Subject: [PATCH] gst-python: fix compatibility with PyGObject>=3.52.0 + +PyGObject 3.52.0 moved OverridesProxyModule _introspection_module to __slots__, +causing Segmentation Faults when accessing the field. +Since _introspection_module is used to get Gst.Element but is never actually +used afterward, we fix the issue by removing this part. + +Fixes #4314 + +Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8685> +--- + .../gst-python/plugin/gstpythonplugin.c | 23 +------------------ + 1 file changed, 1 insertion(+), 22 deletions(-) + +diff --git a/subprojects/gst-python/plugin/gstpythonplugin.c b/subprojects/gst-python/plugin/gstpythonplugin.c +index ba2986f265d5..47442bb47e03 100644 +--- a/plugin/gstpythonplugin.c ++++ b/plugin/gstpythonplugin.c +@@ -53,8 +53,6 @@ gstpy_module_symbol (gpointer handle, const char *name, gpointer * symbol) + } + #endif + +-void *_PyGstElement_Type; +- + GST_DEBUG_CATEGORY_STATIC (pyplugindebug); + #define GST_CAT_DEFAULT pyplugindebug + +@@ -237,7 +235,7 @@ static gboolean + plugin_init (GstPlugin * plugin) + { + PyGILState_STATE state = 0; +- PyObject *gi, *require_version, *args, *gst, *dict, *pyplugin; ++ PyObject *gi, *require_version, *args, *gst, *pyplugin; + gboolean we_initialized = FALSE; + gpointer has_python = NULL; + const gchar *override_path; +@@ -333,25 +331,6 @@ plugin_init (GstPlugin * plugin) + } + + if (we_initialized) { +- PyObject *tmp; +- +- dict = PyModule_GetDict (gst); +- if (!dict) { +- g_critical ("gi.repository.Gst is no dict"); +- return FALSE; +- } +- +- tmp = +- PyObject_GetAttr (PyMapping_GetItemString (dict, +- "_introspection_module"), PyUnicode_FromString ("__dict__")); +- +- _PyGstElement_Type = PyMapping_GetItemString (tmp, "Element"); +- +- if (!_PyGstElement_Type) { +- g_critical ("Could not get Gst.Element"); +- return FALSE; +- } +- + pyplugin = pygobject_new (G_OBJECT (plugin)); + if (!pyplugin || PyModule_AddObject (gst, "__plugin__", pyplugin) != 0) { + g_critical ("Couldn't set __plugin__ attribute"); +-- +GitLab + diff --git a/dev-python/gst-python/gst-python-1.22.12.ebuild b/dev-python/gst-python/gst-python-1.22.12-r1.ebuild index 2f5920def90b..ca232607d702 100644 --- a/dev-python/gst-python/gst-python-1.22.12.ebuild +++ b/dev-python/gst-python/gst-python-1.22.12-r1.ebuild @@ -20,6 +20,7 @@ RDEPEND="${PYTHON_DEPS} >=media-libs/gstreamer-${PV}:1.0[introspection] >=media-libs/gst-plugins-base-${PV}:1.0[introspection] >=dev-python/pygobject-3.8:3[${PYTHON_USEDEP}] + <dev-python/pygobject-3.52:3 " DEPEND="${RDEPEND}" BDEPEND=" @@ -29,7 +30,8 @@ BDEPEND=" src_prepare() { default - # Avoid building & testing plugin - it must NOT be multi-python as gst-inspect will map in all libpython.so versions and crash or behave mysteriously. + # Avoid building & testing plugin - it must NOT be multi-python as gst-inspect will map in all libpython.so versions + # and crash or behave mysteriously. # Python plugin support is of limited use (GIL gets in the way). If it's ever requested or needed, it should be a # separate python-single-r1 media-plugins/gst-plugins-python package that only builds the plugin directory. sed -e '/subdir.*plugin/d' -i meson.build || die diff --git a/dev-python/gst-python/gst-python-1.24.10.ebuild b/dev-python/gst-python/gst-python-1.24.10-r1.ebuild index 50e860486672..28d02ceb9843 100644 --- a/dev-python/gst-python/gst-python-1.24.10.ebuild +++ b/dev-python/gst-python/gst-python-1.24.10-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -20,6 +20,7 @@ RDEPEND="${PYTHON_DEPS} >=media-libs/gstreamer-${PV}:1.0[introspection] >=media-libs/gst-plugins-base-${PV}:1.0[introspection] >=dev-python/pygobject-3.8:3[${PYTHON_USEDEP}] + <dev-python/pygobject-3.52:3 " DEPEND="${RDEPEND}" BDEPEND=" @@ -29,7 +30,8 @@ BDEPEND=" src_prepare() { default - # Avoid building & testing plugin - it must NOT be multi-python as gst-inspect will map in all libpython.so versions and crash or behave mysteriously. + # Avoid building & testing plugin - it must NOT be multi-python as gst-inspect will map in all libpython.so versions + # and crash or behave mysteriously. # Python plugin support is of limited use (GIL gets in the way). If it's ever requested or needed, it should be a # separate python-single-r1 media-plugins/gst-plugins-python package that only builds the plugin directory. sed -e '/subdir.*plugin/d' -i meson.build || die diff --git a/dev-python/gst-python/gst-python-1.24.11.ebuild b/dev-python/gst-python/gst-python-1.24.11-r1.ebuild index 2f5920def90b..287b7c94ce25 100644 --- a/dev-python/gst-python/gst-python-1.24.11.ebuild +++ b/dev-python/gst-python/gst-python-1.24.11-r1.ebuild @@ -26,10 +26,15 @@ BDEPEND=" virtual/pkgconfig " +PATCHES=( + "${FILESDIR}/gstreamer_compat__ge_pygobject-3.52.3.patch" +) + src_prepare() { default - # Avoid building & testing plugin - it must NOT be multi-python as gst-inspect will map in all libpython.so versions and crash or behave mysteriously. + # Avoid building & testing plugin - it must NOT be multi-python as gst-inspect will map in all libpython.so versions + # and crash or behave mysteriously. # Python plugin support is of limited use (GIL gets in the way). If it's ever requested or needed, it should be a # separate python-single-r1 media-plugins/gst-plugins-python package that only builds the plugin directory. sed -e '/subdir.*plugin/d' -i meson.build || die |
