diff --git a/.gitignore b/.gitignore index ffdebd3..f779e54 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/pygobject-3.14.0.tar.xz +SOURCES/pygobject-3.22.0.tar.xz diff --git a/.pygobject3.metadata b/.pygobject3.metadata index ba05893..2d1dbba 100644 --- a/.pygobject3.metadata +++ b/.pygobject3.metadata @@ -1 +1 @@ -638302e7b97a7a8f7bc1f9014f2765cf22dd197e SOURCES/pygobject-3.14.0.tar.xz +a8eb98b56defa47fa0644a7a1c5578973e02137b SOURCES/pygobject-3.22.0.tar.xz diff --git a/SOURCES/0001-Avoid-a-silent-long-to-int-truncation.patch b/SOURCES/0001-Avoid-a-silent-long-to-int-truncation.patch deleted file mode 100644 index c1f17f1..0000000 --- a/SOURCES/0001-Avoid-a-silent-long-to-int-truncation.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 060dbac3d191cacc558d7ee5fcd6f3e38de48dd6 Mon Sep 17 00:00:00 2001 -From: Rui Matos -Date: Thu, 21 May 2015 17:53:17 +0200 -Subject: [PATCH] Avoid a silent long to int truncation - -If the python object contains a value bigger than MAXUINT we'd -silently truncate it when assigning to 'val' and the if condition -would always be true. - -This was caught but a coverity scan. - -https://bugzilla.gnome.org/show_bug.cgi?id=749698 ---- - gi/pygi-value.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/gi/pygi-value.c b/gi/pygi-value.c -index 9d5d0ca..7fdf767 100644 ---- a/gi/pygi-value.c -+++ b/gi/pygi-value.c -@@ -382,7 +382,7 @@ pyg_value_from_pyobject_with_error(GValue *value, PyObject *obj) - case G_TYPE_UINT: - { - if (PYGLIB_PyLong_Check(obj)) { -- guint val; -+ gulong val; - - /* check that number is not negative */ - if (PyLong_AsLongLong(obj) < 0) -@@ -390,7 +390,7 @@ pyg_value_from_pyobject_with_error(GValue *value, PyObject *obj) - - val = PyLong_AsUnsignedLong(obj); - if (val <= G_MAXUINT) -- g_value_set_uint(value, val); -+ g_value_set_uint(value, (guint) val); - else - return -1; - } else { --- -2.4.0 - diff --git a/SOURCES/pygobject-3.14.0-allow-static-module-import.patch b/SOURCES/pygobject-3.14.0-allow-static-module-import.patch deleted file mode 100644 index ddbc32a..0000000 --- a/SOURCES/pygobject-3.14.0-allow-static-module-import.patch +++ /dev/null @@ -1,79 +0,0 @@ -diff -up pygobject-3.14.0/gi/__init__.py.allow-static-module-import pygobject-3.14.0/gi/__init__.py ---- pygobject-3.14.0/gi/__init__.py.allow-static-module-import 2014-09-10 18:10:32.000000000 -0400 -+++ pygobject-3.14.0/gi/__init__.py 2015-09-15 12:23:51.240053648 -0400 -@@ -27,17 +27,12 @@ __path__ = extend_path(__path__, __name_ - import sys - import os - import importlib --import types -- --_static_binding_error = ('When using gi.repository you must not import static ' -- 'modules like "gobject". Please change all occurrences ' -- 'of "import gobject" to "from gi.repository import GObject". ' -- 'See: https://bugzilla.gnome.org/show_bug.cgi?id=709183') - - # we can't have pygobject 2 loaded at the same time we load the internal _gobject - if 'gobject' in sys.modules: -- raise ImportError(_static_binding_error) -- -+ raise ImportError('When using gi.repository you must not import static ' -+ 'modules like "gobject". Please change all occurrences ' -+ 'of "import gobject" to "from gi.repository import GObject".') - - from . import _gi - from ._gi import _gobject -@@ -55,20 +50,6 @@ version_info = _gobject.pygobject_versio - __version__ = "{0}.{1}.{2}".format(*version_info) - - --class _DummyStaticModule(types.ModuleType): -- __path__ = None -- -- def __getattr__(self, name): -- raise AttributeError(_static_binding_error) -- -- --sys.modules['glib'] = _DummyStaticModule('glib', _static_binding_error) --sys.modules['gobject'] = _DummyStaticModule('gobject', _static_binding_error) --sys.modules['gio'] = _DummyStaticModule('gio', _static_binding_error) --sys.modules['gtk'] = _DummyStaticModule('gtk', _static_binding_error) --sys.modules['gtk.gdk'] = _DummyStaticModule('gtk.gdk', _static_binding_error) -- -- - def check_version(version): - if isinstance(version, str): - version_list = tuple(map(int, version.split("."))) -diff -up pygobject-3.14.0/tests/test_import_machinery.py.allow-static-module-import pygobject-3.14.0/tests/test_import_machinery.py ---- pygobject-3.14.0/tests/test_import_machinery.py.allow-static-module-import 2015-09-15 12:24:21.601235349 -0400 -+++ pygobject-3.14.0/tests/test_import_machinery.py 2015-09-15 12:24:47.674390896 -0400 -@@ -58,30 +58,6 @@ class TestModule(unittest.TestCase): - # Restore the previous cache - gi.module._introspection_modules = old_modules - -- def test_static_binding_protection(self): -- # Importing old static bindings once gi has been imported should not -- # crash but instead give back a dummy module which produces RuntimeErrors -- # on access. -- with self.assertRaises(AttributeError): -- import gobject -- gobject.anything -- -- with self.assertRaises(AttributeError): -- import glib -- glib.anything -- -- with self.assertRaises(AttributeError): -- import gio -- gio.anything -- -- with self.assertRaises(AttributeError): -- import gtk -- gtk.anything -- -- with self.assertRaises(AttributeError): -- import gtk.gdk -- gtk.gdk.anything -- - - class TestImporter(unittest.TestCase): - def test_invalid_repository_module_name(self): diff --git a/SOURCES/pygobject-3.22.0-allow-static-module-import.patch b/SOURCES/pygobject-3.22.0-allow-static-module-import.patch new file mode 100644 index 0000000..f5a5e54 --- /dev/null +++ b/SOURCES/pygobject-3.22.0-allow-static-module-import.patch @@ -0,0 +1,77 @@ +--- pygobject-3.22.0/gi/__init__.py.allow-static-module-import 2016-07-06 08:17:26.000000000 +0200 ++++ pygobject-3.22.0/gi/__init__.py 2017-02-08 16:53:17.446776839 +0100 +@@ -27,17 +27,12 @@ + import sys + import os + import importlib +-import types +- +-_static_binding_error = ('When using gi.repository you must not import static ' +- 'modules like "gobject". Please change all occurrences ' +- 'of "import gobject" to "from gi.repository import GObject". ' +- 'See: https://bugzilla.gnome.org/show_bug.cgi?id=709183') + + # we can't have pygobject 2 loaded at the same time we load the internal _gobject + if 'gobject' in sys.modules: +- raise ImportError(_static_binding_error) +- ++ raise ImportError('When using gi.repository you must not import static ' ++ 'modules like "gobject". Please change all occurrences ' ++ 'of "import gobject" to "from gi.repository import GObject".') + + from . import _gi + from ._gi import _gobject +@@ -57,20 +52,6 @@ + __version__ = "{0}.{1}.{2}".format(*version_info) + + +-class _DummyStaticModule(types.ModuleType): +- __path__ = None +- +- def __getattr__(self, name): +- raise AttributeError(_static_binding_error) +- +- +-sys.modules['glib'] = _DummyStaticModule('glib', _static_binding_error) +-sys.modules['gobject'] = _DummyStaticModule('gobject', _static_binding_error) +-sys.modules['gio'] = _DummyStaticModule('gio', _static_binding_error) +-sys.modules['gtk'] = _DummyStaticModule('gtk', _static_binding_error) +-sys.modules['gtk.gdk'] = _DummyStaticModule('gtk.gdk', _static_binding_error) +- +- + def check_version(version): + if isinstance(version, str): + version_list = tuple(map(int, version.split("."))) +--- pygobject-3.22.0/tests/test_import_machinery.py.allow-static-module-import 2016-08-25 16:36:12.000000000 +0200 ++++ pygobject-3.22.0/tests/test_import_machinery.py 2017-02-08 16:53:17.473776850 +0100 +@@ -90,30 +90,6 @@ + self.assertIn('gi.repository.Gio', sys.modules) + self.assertIn('gi.repository.GIMarshallingTests', sys.modules) + +- def test_static_binding_protection(self): +- # Importing old static bindings once gi has been imported should not +- # crash but instead give back a dummy module which produces RuntimeErrors +- # on access. +- with self.assertRaises(AttributeError): +- import gobject +- gobject.anything +- +- with self.assertRaises(AttributeError): +- import glib +- glib.anything +- +- with self.assertRaises(AttributeError): +- import gio +- gio.anything +- +- with self.assertRaises(AttributeError): +- import gtk +- gtk.anything +- +- with self.assertRaises(AttributeError): +- import gtk.gdk +- gtk.gdk.anything +- + + class TestImporter(unittest.TestCase): + def test_invalid_repository_module_name(self): diff --git a/SPECS/pygobject3.spec b/SPECS/pygobject3.spec index 13b6e1e..3c38043 100644 --- a/SPECS/pygobject3.spec +++ b/SPECS/pygobject3.spec @@ -1,51 +1,38 @@ -# Last updated for version 3.14.0 +# Last updated for version 3.18.0 %define glib2_version 2.38.0 -%define gobject_introspection_version 1.39.0 -%define python2_version 2.3.5 +%define gobject_introspection_version 1.46.0 +%define python2_version 2.7 %if 0%{?fedora} > 12 %global with_python3 1 %define python3_version 3.1 %endif -%if 1 - # Verbose build - %global verbosity V=1 -%else - # Quiet build - %global verbosity %{nil} -%endif - %global with_check 0 -### Abstract ### - -Name: pygobject3 -Version: 3.14.0 -Release: 3%{?dist} -License: LGPLv2+ and MIT -Group: Development/Languages -Summary: Python 2 bindings for GObject Introspection -URL: https://live.gnome.org/PyGObject -#VCS: git:git://git.gnome.org/pygobject -Source: http://ftp.gnome.org/pub/GNOME/sources/pygobject/3.14/pygobject-%{version}.tar.xz +Name: pygobject3 +Version: 3.22.0 +Release: 1%{?dist} +Summary: Python bindings for GObject Introspection -Patch0: 0001-Avoid-a-silent-long-to-int-truncation.patch +License: LGPLv2+ and MIT +URL: https://wiki.gnome.org/Projects/PyGObject +Source0: https://download.gnome.org/sources/pygobject/3.22/pygobject-%{version}.tar.xz # https://bugzilla.redhat.com/1247996 # which reverts https://bugzilla.gnome.org/709183 -Patch1: pygobject-3.14.0-allow-static-module-import.patch +Patch1: pygobject-3.22.0-allow-static-module-import.patch -BuildRequires: glib2-devel >= %{glib2_version} -BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version} -BuildRequires: python2-devel >= %{python2_version} +BuildRequires: glib2-devel >= %{glib2_version} +BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version} +BuildRequires: python2-devel >= %{python2_version} %if 0%{?with_python3} -BuildRequires: python3-devel >= %{python3_version} -BuildRequires: python3-cairo-devel +BuildRequires: python3-devel >= %{python3_version} +BuildRequires: python3-cairo-devel %endif # if with_python3 -BuildRequires: cairo-gobject-devel -BuildRequires: pycairo-devel +BuildRequires: cairo-gobject-devel +BuildRequires: pycairo-devel # Required by the upstream selftest suite: %if %{with_check} @@ -53,67 +40,86 @@ BuildRequires: pycairo-devel # Temporarily disabled pyflakes tests to avoid the build failing due to too new # pyflakes 0.7.2 in F19 # https://bugzilla.gnome.org/show_bug.cgi?id=701009 -#BuildRequires: pyflakes -BuildRequires: python-pep8 +#BuildRequires: pyflakes +BuildRequires: python-pep8 %endif ## for the Gdk and Gtk typelibs, used during the test suite: -BuildRequires: gtk3 +BuildRequires: gtk3 ## for xvfb-run: -BuildRequires: xorg-x11-server-Xvfb -BuildRequires: dejavu-sans-fonts -BuildRequires: dejavu-sans-mono-fonts -BuildRequires: dejavu-serif-fonts +BuildRequires: xorg-x11-server-Xvfb +BuildRequires: dejavu-sans-fonts +BuildRequires: dejavu-sans-mono-fonts +BuildRequires: dejavu-serif-fonts ## for dbus-launch, used by test_gdbus: -BuildRequires: dbus-x11 +BuildRequires: dbus-x11 %endif # with_check -Requires: %{name}-base%{?_isa} = %{version}-%{release} - -# The cairo override module depends on this -Requires: pycairo%{?_isa} - %description The %{name} package provides a convenient wrapper for the GObject library for use in Python programs. -%package base -Summary: Python 2 bindings for GObject Introspection base package -Group: Development/Languages -Requires: gobject-introspection%{?_isa} >= %{gobject_introspection_version} +%package -n python-gobject +Summary: Python 2 bindings for GObject Introspection +Requires: python-gobject-base%{?_isa} = %{version}-%{release} +# The cairo override module depends on this +Requires: pycairo%{?_isa} -%description base -This package provides the non-cairo specific bits of the GObject Introspection -library. +Obsoletes: %{name} < 3.17.90-2 +Provides: %{name} = %{version}-%{release} +Provides: %{name}%{?_isa} = %{version}-%{release} -%package devel -Summary: Development files for embedding PyGObject introspection support -Group: Development/Languages -Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: gobject-introspection-devel%{?_isa} +%description -n python-gobject +The python-gobject package provides a convenient wrapper for the GObject +library and and other libraries that are compatible with GObject Introspection, +for use in Python 2 programs. -%description devel -This package contains files required to embed PyGObject +%package -n python-gobject-base +Summary: Python 2 bindings for GObject Introspection base package +Requires: gobject-introspection%{?_isa} >= %{gobject_introspection_version} -%if 0%{?with_python3} -%package -n python3-gobject -Summary: Python 3 bindings for GObject Introspection -Group: Development/Languages +Obsoletes: %{name}-base < 3.17.90-2 +Provides: %{name}-base = %{version}-%{release} +Provides: %{name}-base%{?_isa} = %{version}-%{release} +%description -n python-gobject-base +This package provides the non-cairo specific bits of the GObject Introspection +library. + +%if 0%{?with_python3} +%package -n python3-gobject +Summary: Python 3 bindings for GObject Introspection +Requires: python3-gobject-base%{?_isa} = %{version}-%{release} # The cairo override module depends on this -Requires: python3-cairo%{?_isa} -Requires: gobject-introspection%{?_isa} >= %{gobject_introspection_version} +Requires: python3-cairo%{?_isa} %description -n python3-gobject The python3-gobject package provides a convenient wrapper for the GObject library and and other libraries that are compatible with GObject Introspection, for use in Python 3 programs. +%package -n python3-gobject-base +Summary: Python 3 bindings for GObject Introspection base package +Requires: gobject-introspection%{?_isa} >= %{gobject_introspection_version} + +%description -n python3-gobject-base +This package provides the non-cairo specific bits of the GObject Introspection +library. + %endif # with_python3 +%package devel +Summary: Development files for embedding PyGObject introspection support +Requires: python-gobject%{?_isa} = %{version}-%{release} +%if 0%{?with_python3} +Requires: python3-gobject%{?_isa} = %{version}-%{release} +%endif +Requires: gobject-introspection-devel%{?_isa} + +%description devel +This package contains files required to embed PyGObject + %prep %setup -q -n pygobject-%{version} - -%patch0 -p1 -b .avoid-long-trunc %patch1 -p1 -b .allow-static-module-import %if 0%{?with_python3} @@ -128,14 +134,14 @@ find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python}|' PYTHON=%{__python} export PYTHON %configure -make %{?_smp_mflags} %{verbosity} +make %{?_smp_mflags} V=1 %if 0%{?with_python3} pushd %{py3dir} PYTHON=%{__python3} export PYTHON %configure -make %{_smp_mflags} %{verbosity} +make %{?_smp_mflags} V=1 popd %endif # with_python3 @@ -144,14 +150,13 @@ popd pushd %{py3dir} PYTHON=%{__python3} export PYTHON -make DESTDIR=$RPM_BUILD_ROOT install %{verbosity} +%make_install popd %endif # with_python3 -make DESTDIR=$RPM_BUILD_ROOT install %{verbosity} +%make_install find $RPM_BUILD_ROOT -name '*.la' -delete -find $RPM_BUILD_ROOT -name '*.a' -delete # Don't include makefiles in the installed docs, in order to avoid creating # multilib conflicts @@ -161,7 +166,6 @@ cp -a examples _docs rm _docs/examples/Makefile* %check - %if %{with_check} # Run the selftests under a temporary xvfb X server (so that they can # initialize Gdk etc): @@ -176,50 +180,51 @@ rm _docs/examples/Makefile* pushd %{py3dir} PYTHON=%{__python3} export PYTHON -xvfb-run make DESTDIR=$RPM_BUILD_ROOT check %{verbosity} +xvfb-run make DESTDIR=$RPM_BUILD_ROOT check V=1 popd %endif # with_python3 -xvfb-run make DESTDIR=$RPM_BUILD_ROOT check %{verbosity} +xvfb-run make DESTDIR=$RPM_BUILD_ROOT check V=1 %endif # with_check -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - -%files -%defattr(644, root, root, 755) +%files -n python-gobject %{python_sitearch}/gi/_gi_cairo.so -%files base -%defattr(644, root, root, 755) -%doc AUTHORS NEWS README COPYING +%files -n python-gobject-base +%license COPYING +%doc AUTHORS NEWS README %dir %{python_sitearch}/gi %{python_sitearch}/gi/* %exclude %{python_sitearch}/gi/_gi_cairo.so %{python_sitearch}/pygobject-*.egg-info %{python_sitearch}/pygtkcompat/ -%files devel -%defattr(644, root, root, 755) -%doc _docs/* -%dir %{_includedir}/pygobject-3.0/ -%{_includedir}/pygobject-3.0/pygobject.h -%{_libdir}/pkgconfig/pygobject-3.0.pc - %if 0%{?with_python3} %files -n python3-gobject -%defattr(644, root, root, 755) -%doc AUTHORS NEWS README COPYING +%{python3_sitearch}/gi/_gi_cairo*.so + +%files -n python3-gobject-base +%license COPYING +%doc AUTHORS NEWS README %dir %{python3_sitearch}/gi %{python3_sitearch}/gi/* +%exclude %{python3_sitearch}/gi/_gi_cairo*.so %{python3_sitearch}/pygobject-*.egg-info %{python3_sitearch}/pygtkcompat/ - %endif # with_python3 +%files devel +%doc _docs/* +%dir %{_includedir}/pygobject-3.0/ +%{_includedir}/pygobject-3.0/pygobject.h +%{_libdir}/pkgconfig/pygobject-3.0.pc + %changelog +* Mon Sep 19 2016 Kalev Lember - 3.22.0-1 +- Update to 3.22.0 +- Resolves: #1387039 + * Tue Sep 15 2015 Matthew Barnes - 3.14.0-3 - Allow importing static modules to fix RHEL7 rebase regressions