From 35565686c2c82919510d6a171e1250ed7f597671 Mon Sep 17 00:00:00 2001 From: James Antill Date: Thu, 23 Feb 2023 12:41:01 -0500 Subject: [PATCH] Import rpm: 9f812b56e5c844bac7d1b1157e5be4a2ec3e9938 --- .gitignore | 2 +- ...rning-on-accessing-NULL-gobject-prop.patch | 28 +++++ fix-gio-flags.patch | 49 ++++++++ pygobject2.spec | 111 +++++++----------- sources | 2 +- 5 files changed, 122 insertions(+), 70 deletions(-) create mode 100644 0001-Fix-set_qdata-warning-on-accessing-NULL-gobject-prop.patch create mode 100644 fix-gio-flags.patch diff --git a/.gitignore b/.gitignore index 6e74330..08b8707 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/pygobject-2.28.7.tar.xz +SOURCES/pygobject-2.28.6.tar.bz2 diff --git a/0001-Fix-set_qdata-warning-on-accessing-NULL-gobject-prop.patch b/0001-Fix-set_qdata-warning-on-accessing-NULL-gobject-prop.patch new file mode 100644 index 0000000..e20c7be --- /dev/null +++ b/0001-Fix-set_qdata-warning-on-accessing-NULL-gobject-prop.patch @@ -0,0 +1,28 @@ +From 42d871eb0b08ee6d55e95cc7e4b90844919555b9 Mon Sep 17 00:00:00 2001 +From: Ivan Stankovic +Date: Tue, 21 Feb 2012 12:24:58 +0100 +Subject: [PATCH] Fix set_qdata warning on accessing NULL gobject property + +https://bugzilla.gnome.org/show_bug.cgi?id=661155 +--- + gobject/pygobject.c | 4 +++- + 1 files changed, 3 insertions(+), 1 deletions(-) + +diff --git a/gobject/pygobject.c b/gobject/pygobject.c +index 6c2f06c..70dc89a 100644 +--- a/gobject/pygobject.c ++++ b/gobject/pygobject.c +@@ -991,7 +991,9 @@ pygobject_new(GObject *obj) + PyObject * + pygobject_new_sunk(GObject *obj) + { +- g_object_set_qdata (obj, pygobject_ref_sunk_key, GINT_TO_POINTER (1)); ++ if (obj) ++ g_object_set_qdata (obj, pygobject_ref_sunk_key, GINT_TO_POINTER (1)); ++ + return pygobject_new_full(obj, TRUE, NULL); + } + +-- +1.7.1 + diff --git a/fix-gio-flags.patch b/fix-gio-flags.patch new file mode 100644 index 0000000..95b9114 --- /dev/null +++ b/fix-gio-flags.patch @@ -0,0 +1,49 @@ +From 42d01f060c5d764baa881d13c103d68897163a49 Mon Sep 17 00:00:00 2001 +From: Ryan Lortie +Date: Mon, 12 Mar 2012 16:44:14 -0400 +Subject: [PATCH] gio-types.defs: change some enums to flags + +These flags types were originally incorrectly handled in glib as being +enums. That bug was fixed, but they're still enums here, leading to +warnings about the mismatch. + +Change them to flags. + +https://bugzilla.gnome.org/show_bug.cgi?id=668522 +--- + gio/gio-types.defs | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/gio/gio-types.defs b/gio/gio-types.defs +index 331e0bc..7eee5c8 100644 +--- a/gio/gio-types.defs ++++ b/gio/gio-types.defs +@@ -526,7 +526,7 @@ + ) + ) + +-(define-enum MountMountFlags ++(define-flags MountMountFlags + (in-module "gio") + (c-name "GMountMountFlags") + (gtype-id "G_TYPE_MOUNT_MOUNT_FLAGS") +@@ -545,7 +545,7 @@ + ) + ) + +-(define-enum DriveStartFlags ++(define-flags DriveStartFlags + (in-module "gio") + (c-name "GDriveStartFlags") + (gtype-id "G_TYPE_DRIVE_START_FLAGS") +@@ -770,7 +770,7 @@ + ) + ) + +-(define-enum SocketMsgFlags ++(define-flags SocketMsgFlags + (in-module "gio") + (c-name "GSocketMsgFlags") + (gtype-id "G_TYPE_SOCKET_MSG_FLAGS") +-- +1.7.9.1 \ No newline at end of file diff --git a/pygobject2.spec b/pygobject2.spec index 21c388b..4a6a4d2 100644 --- a/pygobject2.spec +++ b/pygobject2.spec @@ -1,17 +1,28 @@ ### Abstract ### Name: pygobject2 -Version: 2.28.7 -Release: 4%{?dist} -License: LGPLv2+, MIT +Version: 2.28.6 +Release: 11%{?dist} +License: LGPLv2+ +Group: Development/Languages Summary: Python 2 bindings for GObject URL: http://www.pygtk.org/ +BuildRoot: %{_tmppath}/%{name}-%{version}-root #VCS: git:git://git.gnome.org/pygobject -Source0: http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/pygobject-%{version}.tar.xz +Source: http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/pygobject-%{version}.tar.bz2 + +### Patches ### +# Fix this warning on startup: +# ** WARNING **: Trying to register gtype 'GMountMountFlags' as enum when +# in fact it is of type 'GFlags' +# using upstream patch (rhbz#790053) +Patch1: fix-gio-flags.patch +Patch2: 0001-Fix-set_qdata-warning-on-accessing-NULL-gobject-prop.patch ### Build Dependencies ### BuildRequires: pkgconfig(gio-unix-2.0) +BuildRequires: pkgconfig(gobject-introspection-1.0) BuildRequires: pkgconfig(python2) BuildRequires: pkgconfig(cairo-gobject) @@ -24,12 +35,14 @@ for use in Python programs. %package codegen Summary: The code generation program for PyGObject +Group: Development/Languages %description codegen The package contains the C code generation program for PyGObject. %package devel Summary: Development files for building add-on libraries +Group: Development/Languages Requires: %{name} = %{version}-%{release} Requires: %{name}-codegen = %{version}-%{release} Requires: %{name}-doc = %{version}-%{release} @@ -43,60 +56,60 @@ libraries such as pygtk2. %package doc Summary: Documentation files for %{name} +Group: Development/Languages %description doc This package contains documentation files for %{name}. %prep -export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 %setup -q -n pygobject-%{version} +%patch1 -p1 +%patch2 -p1 -find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python2}|' +find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|' %build -export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 -PYTHON=%{__python2} +PYTHON=%{__python} export PYTHON %configure --disable-introspection make %{?_smp_mflags} %install -export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 +rm -rf $RPM_BUILD_ROOT + make DESTDIR=$RPM_BUILD_ROOT install find $RPM_BUILD_ROOT -name '*.la' -delete find $RPM_BUILD_ROOT -name '*.a' -delete rm examples/Makefile* -# Fix python shebangs -# This needs to be changed when converted to python3 -for i in `grep -r -l '#!.*python.*' %{buildroot}`; do - sed -i 's|#!.*/usr/bin/env python.*|#!%{__python2}|' $i -done - %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files +%defattr(644, root, root, 755) %doc AUTHORS NEWS README %doc examples -%{_libdir}/libpyglib-2.0-python2.so* -%dir %{python2_sitearch}/gtk-2.0 -%dir %{python2_sitearch}/gobject -%dir %{python2_sitearch}/glib +%{_libdir}/libpyglib-2.0-python.so* +%dir %{python_sitearch}/gtk-2.0 +%dir %{python_sitearch}/gobject +%dir %{python_sitearch}/glib -%{python2_sitearch}/gtk-2.0/* -%{python2_sitearch}/pygtk.* -%{python2_sitearch}/gobject/* -%{python2_sitearch}/glib/* +%{python_sitearch}/gtk-2.0/* +%{python_sitearch}/pygtk.* +%{python_sitearch}/gobject/* +%{python_sitearch}/glib/* %files codegen +%defattr(755, root, root, 755) %{_bindir}/pygobject-codegen-2.0 +%defattr(644, root, root, 755) %dir %{_datadir}/pygobject/2.0 %{_datadir}/pygobject/2.0/codegen %files devel +%defattr(644, root, root, 755) %dir %{_datadir}/pygobject %dir %{_includedir}/pygtk-2.0 %{_datadir}/pygobject/2.0/defs @@ -105,54 +118,16 @@ done %{_libdir}/pkgconfig/pygobject-2.0.pc %files doc +%defattr(644, root, root, 755) %{_datadir}/gtk-doc/html/pygobject %{_datadir}/pygobject/xsl %changelog -* Mon Aug 13 2018 Josef Ridky - 2.28.7-4 -- update python macro to python2 +* Fri Jan 24 2014 Daniel Mach - 2.28.6-11 +- Mass rebuild 2014-01-24 -* Thu Aug 09 2018 Josef Ridky - 2.28.7-3 -- Add MIT license - -* Fri Jun 22 2018 Troy Dawson - 2.28.7-2.1 -- Fix python shebangs (#1580854) - -* Fri Feb 09 2018 Fedora Release Engineering - 2.28.7-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild - -* Mon Dec 11 2017 Kalev Lember - 2.28.7-1 -- Update to 2.28.7 - -* Thu Aug 03 2017 Fedora Release Engineering - 2.28.6-19 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild - -* Thu Jul 27 2017 Fedora Release Engineering - 2.28.6-18 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild - -* Sat Feb 11 2017 Fedora Release Engineering - 2.28.6-17 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild - -* Tue Jul 19 2016 Fedora Release Engineering - 2.28.6-16 -- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages - -* Thu Feb 04 2016 Fedora Release Engineering - 2.28.6-15 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild - -* Thu Jun 18 2015 Fedora Release Engineering - 2.28.6-14 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild - -* Sun Aug 17 2014 Fedora Release Engineering - 2.28.6-13 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild - -* Sat Jun 07 2014 Fedora Release Engineering - 2.28.6-12 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild - -* Thu Sep 19 2013 Tomáš Mráz - 2.28.6-11 -- allow old pygtk applications to work with pygobject 2.28.x and glib 2.35.x - -* Sun Aug 04 2013 Fedora Release Engineering - 2.28.6-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild +* Fri Dec 27 2013 Daniel Mach - 2.28.6-10 +- Mass rebuild 2013-12-27 * Thu Feb 14 2013 Fedora Release Engineering - 2.28.6-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild @@ -217,10 +192,10 @@ done * Mon Feb 28 2011 John (J5) Palmieri - 2.27.91-1 - update to upstream version 2.27.91 -* Fri Feb 11 2011 John (J5) Palmieri - 2.27.90-2 +* Fri Feb 09 2011 John (J5) Palmieri - 2.27.90-2 - update files manifest to reflect files that moved around -* Fri Feb 11 2011 John (J5) Palmieri - 2.27.90-1 +* Fri Feb 09 2011 John (J5) Palmieri - 2.27.90-1 - update to upstream version 2.27.90 * Tue Feb 08 2011 Fedora Release Engineering - 2.27.0-2 diff --git a/sources b/sources index 5c6316b..0473ef3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (pygobject-2.28.7.tar.xz) = a5f3ae39f8156bd6234fb6d0ea31eba782fbdd4c292656c31b33e098abe3dcf0774d492cf602a4637cb679af9ecd511b24263349fbfd25708ca70f16cb052dfb +SHA1 (pygobject-2.28.6.tar.bz2) = 4eda7d2b97f495a2ad7d4cdc234d08ca5408d9d5