[packages/python-gstreamer] - updated to 1.6.0 - added nosegv patch to avoid rpm gstreamer provides detector crashes when python

qboosh qboosh at pld-linux.org
Thu Oct 8 20:57:15 CEST 2015


commit 81a9e032b8dc2a6e587a0e1446aea55b06d7a578
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Oct 8 20:58:27 2015 +0200

    - updated to 1.6.0
    - added nosegv patch to avoid rpm gstreamer provides detector crashes when python-gstreamer* are not already installed

 python-gstreamer-nosegv.patch | 33 +++++++++++++++++++++
 python-gstreamer.spec         | 68 +++++++++++++++++++++++--------------------
 2 files changed, 69 insertions(+), 32 deletions(-)
---
diff --git a/python-gstreamer.spec b/python-gstreamer.spec
index 20b6e32..72b0e76 100644
--- a/python-gstreamer.spec
+++ b/python-gstreamer.spec
@@ -1,28 +1,20 @@
 #
 # Conditional build:
-%bcond_without	python2		# CPython 2.x module
-%bcond_without	python3		# CPython 3.x module
-%bcond_with	pluginpy3	# use Python 3 instead of 2 for plugin
+%bcond_without	python2		# CPython 2.x module and plugin
+%bcond_without	python3		# CPython 3.x module and plugin
 
-%define		gst_ver	1.4.0
+%define		gst_ver	1.6.0
 %define		pname	gst-python
-%if %{without python2}
-%define		with_pluginpy3	1
-%endif
-%if %{with pluginpy3}
-%define		pluginpython	python3
-%else
-%define		pluginpython	python
-%endif
 Summary:	GStreamer Python 2 bindings
 Summary(pl.UTF-8):	Wiązania języka Python 2 do GStreamera
 Name:		python-gstreamer
-Version:	1.4.0
-Release:	4
+Version:	1.6.0
+Release:	1
 License:	LGPL v2+
 Group:		Libraries/Python
 Source0:	http://gstreamer.freedesktop.org/src/gst-python/%{pname}-%{version}.tar.xz
-# Source0-md5:	72e3ba811db671366162bbf75a01ed37
+# Source0-md5:	498792e9e1b61a90de1e28cf04e88a9e
+Patch0:		%{name}-nosegv.patch
 URL:		http://gstreamer.freedesktop.org/modules/gst-python.html
 BuildRequires:	autoconf >= 2.68
 BuildRequires:	automake >= 1:1.11
@@ -52,6 +44,18 @@ GStreamer Python 2 bindings.
 %description -l pl.UTF-8
 Wiązania języka Python 2 do GStreamera.
 
+%package -n gstreamer-python
+Summary:	GStreamer plugin to load plugins written in Python 2
+Summary(pl.UTF-8):	Wtyczka GStreamera do wczytywania wtyczek napisanych w Pythonie 2
+Group:		Libraries
+Requires:	python-gstreamer = %{version}-%{release}
+
+%description -n gstreamer-python
+GStreamer plugin to load plugins written in Python 2.
+
+%description -n gstreamer-python -l pl.UTF-8
+Wtyczka GStreamera do wczytywania wtyczek napisanych w Pythonie 2.
+
 %package -n python3-gstreamer
 Summary:	GStreamer Python 3 bindings
 Summary(pl.UTF-8):	Wiązania języka Python 3 do GStreamera
@@ -65,20 +69,21 @@ GStreamer Python 3 bindings.
 %description -n python3-gstreamer -l pl.UTF-8
 Wiązania języka Python 3 do GStreamera.
 
-%package -n gstreamer-%{pluginpython}
-Summary:	GStreamer plugin to load plugins written in Python
-Summary(pl.UTF-8):	Wtyczka GStreamera do wczytywania wtyczek napisanych w Pythonie
+%package -n gstreamer-python3
+Summary:	GStreamer plugin to load plugins written in Python 3
+Summary(pl.UTF-8):	Wtyczka GStreamera do wczytywania wtyczek napisanych w Pythonie 3
 Group:		Libraries
-Requires:	%{pluginpython}-gstreamer = %{version}-%{release}
+Requires:	python3-gstreamer = %{version}-%{release}
 
-%description -n gstreamer-%{pluginpython}
-GStreamer plugin to load plugins written in Python.
+%description -n gstreamer-python3
+GStreamer plugin to load plugins written in Python 3.
 
-%description -n gstreamer-%{pluginpython} -l pl.UTF-8
-Wtyczka GStreamera do wczytywania wtyczek napisanych w Pythonie.
+%description -n gstreamer-python3 -l pl.UTF-8
+Wtyczka GStreamera do wczytywania wtyczek napisanych w Pythonie 3.
 
 %prep
 %setup -q -n %{pname}-%{version}
+%patch0 -p1
 
 %build
 %{__libtoolize}
@@ -125,12 +130,6 @@ rm -rf $RPM_BUILD_ROOT
 	DESTDIR=$RPM_BUILD_ROOT
 
 %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/gi/overrides/*.la
-
-%if %{without pluginpy3}
-# if both modules are installed and py2 plugin is selected, reinstall py2 version of plugin
-%{__make} -C python2/plugin install \
-	DESTDIR=$RPM_BUILD_ROOT
-%endif
 %endif
 
 %{__rm} $RPM_BUILD_ROOT%{_libdir}/gstreamer-1.0/libgstpythonplugin.la
@@ -146,6 +145,11 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{py_sitedir}/gi/overrides/_gi_gst.so
 %{py_sitedir}/gi/overrides/Gst.py[co]
 %{py_sitedir}/gi/overrides/GstPbutils.py[co]
+
+%files -n gstreamer-python
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/gstreamer-1.0/libgstpythonplugin.so
+%dir %{_libdir}/gstreamer-1.0/python
 %endif
 
 %if %{with python3}
@@ -157,9 +161,9 @@ rm -rf $RPM_BUILD_ROOT
 %{py3_sitedir}/gi/overrides/GstPbutils.py
 %{py3_sitedir}/gi/overrides/__pycache__/Gst.*.py[co]
 %{py3_sitedir}/gi/overrides/__pycache__/GstPbutils.*.py[co]
-%endif
 
-%files -n gstreamer-%{pluginpython}
+%files -n gstreamer-python3
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/gstreamer-1.0/libgstpythonplugin.so
+%attr(755,root,root) %{_libdir}/gstreamer-1.0/libgstpythonplugin.cpython-3*.so
 %dir %{_libdir}/gstreamer-1.0/python
+%endif
diff --git a/python-gstreamer-nosegv.patch b/python-gstreamer-nosegv.patch
new file mode 100644
index 0000000..1fe414b
--- /dev/null
+++ b/python-gstreamer-nosegv.patch
@@ -0,0 +1,33 @@
+--- gst-python-1.6.0/plugin/gstpythonplugin.c.orig	2014-10-20 11:18:17.000000000 +0200
++++ gst-python-1.6.0/plugin/gstpythonplugin.c	2015-10-08 20:48:36.028154982 +0200
+@@ -262,18 +262,26 @@
+   }
+ 
+   gst = PyImport_ImportModule ("gi.repository.Gst");
++  if (gst == NULL) {
++    GST_ERROR ("Gst import failed");
++    return FALSE;
++  }
+   if (we_initialized) {
+-    PyObject *tmp;
++    PyObject *tmp, *itmp;
+ 
+     dict = PyModule_GetDict (gst);
+     if (!dict) {
+       GST_ERROR ("no dict?!");
++      return FALSE;
+     }
+ 
+-
++    itmp = PyMapping_GetItemString (dict, "_introspection_module");
++    if (!itmp) {
++      GST_ERROR ("no _introspection_module?");
++      return FALSE;
++    }
+     tmp =
+-        PyObject_GetAttr (PyMapping_GetItemString (dict,
+-            "_introspection_module"), PyUnicode_FromString ("__dict__"));
++        PyObject_GetAttr (itmp, PyUnicode_FromString ("__dict__"));
+ 
+     _PyGstElement_Type = PyMapping_GetItemString (tmp, "Element");
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python-gstreamer.git/commitdiff/81a9e032b8dc2a6e587a0e1446aea55b06d7a578



More information about the pld-cvs-commit mailing list