diff --git a/1c78286f8aef7ed411efc159a7abb1edcf744102.patch b/1c78286f8aef7ed411efc159a7abb1edcf744102.patch new file mode 100644 index 0000000..c5cd0c3 --- /dev/null +++ b/1c78286f8aef7ed411efc159a7abb1edcf744102.patch @@ -0,0 +1,44 @@ +From 1c78286f8aef7ed411efc159a7abb1edcf744102 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 7 Jun 2019 16:28:54 +0200 +Subject: [PATCH] tests: remove usage of time.clock(), no longer available in + py3.8 + +--- + tests/test_overrides_gtk.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/tests/test_overrides_gtk.py b/tests/test_overrides_gtk.py +index 627d5760..d96d8fe8 100644 +--- a/tests/test_overrides_gtk.py ++++ b/tests/test_overrides_gtk.py +@@ -6,10 +6,10 @@ from __future__ import absolute_import + + import contextlib + import unittest +-import time + import sys + import gc + import warnings ++import timeit + + import pytest + +@@ -2260,12 +2260,12 @@ class TestTreeModel(unittest.TestCase): + model = Gtk.ListStore(int, str) + + iterations = 2000 +- start = time.clock() ++ start = timeit.default_timer() + i = iterations + while i > 0: + model.append([1, 'hello']) + i -= 1 +- end = time.clock() ++ end = timeit.default_timer() + sys.stderr.write('[%.0f µs/append] ' % ((end - start) * 1000000 / iterations)) + + def test_filter_new_default(self): +-- +2.21.0 + diff --git a/ab596da7991dc5b91b047fc741c9da23ae051e1a.patch b/ab596da7991dc5b91b047fc741c9da23ae051e1a.patch new file mode 100644 index 0000000..5365225 --- /dev/null +++ b/ab596da7991dc5b91b047fc741c9da23ae051e1a.patch @@ -0,0 +1,67 @@ +From ab596da7991dc5b91b047fc741c9da23ae051e1a Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 7 Jun 2019 16:50:53 +0200 +Subject: [PATCH] build: don't use -Wdeclaration-after-statement with Python 3 + +The headers of Python 3.8 trigger the warning and PEP7 states that +Python is depending on this now. + +As far as I remember this was mostly added to keep the code compatible +with ancient py2 MSVC, so only use it with Python 2. +--- + meson.build | 7 ++++++- + setup.py | 6 +++++- + 2 files changed, 11 insertions(+), 2 deletions(-) + +diff --git a/meson.build b/meson.build +index 1beda259..2064d254 100644 +--- a/meson.build ++++ b/meson.build +@@ -72,7 +72,6 @@ else + '-Wall', + '-Warray-bounds', + '-Wcast-align', +- '-Wdeclaration-after-statement', + '-Wduplicated-branches', + '-Wextra', + '-Wformat=2', +@@ -104,6 +103,12 @@ else + '-Wwrite-strings', + ] + ++ if python.language_version().split('.')[0] == '2' ++ main_c_args += [ ++ '-Wdeclaration-after-statement', ++ ] ++ endif ++ + main_c_args += [ + '-Wno-incompatible-pointer-types-discards-qualifiers', + '-Wno-missing-field-initializers', +diff --git a/setup.py b/setup.py +index 47cc1050..b9172131 100755 +--- a/setup.py ++++ b/setup.py +@@ -975,7 +975,6 @@ def add_ext_compiler_flags(ext, compiler, _cache={}): + "-Wall", + "-Warray-bounds", + "-Wcast-align", +- "-Wdeclaration-after-statement", + "-Wduplicated-branches", + "-Wextra", + "-Wformat=2", +@@ -1007,6 +1006,11 @@ def add_ext_compiler_flags(ext, compiler, _cache={}): + "-Wwrite-strings", + ] + ++ if sys.version_info[0] == 2: ++ args += [ ++ "-Wdeclaration-after-statement", ++ ] ++ + args += [ + "-Wno-incompatible-pointer-types-discards-qualifiers", + "-Wno-missing-field-initializers", +-- +2.21.0 + diff --git a/b99640a50e165e2a241fdbadca8a537c5930bdd1.patch b/b99640a50e165e2a241fdbadca8a537c5930bdd1.patch new file mode 100644 index 0000000..64029ed --- /dev/null +++ b/b99640a50e165e2a241fdbadca8a537c5930bdd1.patch @@ -0,0 +1,31 @@ +From b99640a50e165e2a241fdbadca8a537c5930bdd1 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 7 Jun 2019 16:31:23 +0200 +Subject: [PATCH] Don't use PyTypeObject.tp_print with Python 3 + +It was only used with Python 2 and unused/reserved with Python 3. +Python 3.8 has renamed the slot and is now using it for something different +which breaks our build. +--- + gi/pygobject-object.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/gi/pygobject-object.c b/gi/pygobject-object.c +index dbf46e1e..39c03ca3 100644 +--- a/gi/pygobject-object.c ++++ b/gi/pygobject-object.c +@@ -878,7 +878,10 @@ pygobject_inherit_slots(PyTypeObject *type, PyObject *bases, gboolean check_for_ + offsetof(PyTypeObject, tp_iter), + offsetof(PyTypeObject, tp_repr), + offsetof(PyTypeObject, tp_str), +- offsetof(PyTypeObject, tp_print) }; ++#if PY_VERSION_HEX < 0x03000000 ++ offsetof(PyTypeObject, tp_print), ++#endif ++ }; + gsize i; + + /* Happens when registering gobject.GObject itself, at least. */ +-- +2.21.0 + diff --git a/dea99de09f273a54244af1f3250f6699cfede637.patch b/dea99de09f273a54244af1f3250f6699cfede637.patch new file mode 100644 index 0000000..65fe16c --- /dev/null +++ b/dea99de09f273a54244af1f3250f6699cfede637.patch @@ -0,0 +1,60 @@ +From dea99de09f273a54244af1f3250f6699cfede637 Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Fri, 7 Jun 2019 16:43:38 +0200 +Subject: [PATCH] build: drop some checks for unsupported Python versions + +--- + meson.build | 7 +------ + setup.py | 6 +----- + 2 files changed, 2 insertions(+), 11 deletions(-) + +diff --git a/meson.build b/meson.build +index 50355814..1beda259 100644 +--- a/meson.build ++++ b/meson.build +@@ -98,6 +98,7 @@ else + '-Wsign-compare', + '-Wstrict-aliasing', + '-Wstrict-prototypes', ++ '-Wswitch-default', + '-Wundef', + '-Wunused-but-set-variable', + '-Wwrite-strings', +@@ -118,12 +119,6 @@ else + '-fvisibility=hidden', + ] + +- if not ['3.3', '3.4'].contains(python.language_version()) +- main_c_args += [ +- '-Wswitch-default', +- ] +- endif +- + main_c_args = cc.get_supported_arguments(main_c_args) + endif + +diff --git a/setup.py b/setup.py +index 1e5fe769..47cc1050 100755 +--- a/setup.py ++++ b/setup.py +@@ -1001,16 +1001,12 @@ def add_ext_compiler_flags(ext, compiler, _cache={}): + "-Wsign-compare", + "-Wstrict-aliasing", + "-Wstrict-prototypes", ++ "-Wswitch-default", + "-Wundef", + "-Wunused-but-set-variable", + "-Wwrite-strings", + ] + +- if sys.version_info[:2] != (3, 4): +- args += [ +- "-Wswitch-default", +- ] +- + args += [ + "-Wno-incompatible-pointer-types-discards-qualifiers", + "-Wno-missing-field-initializers", +-- +2.21.0 + diff --git a/pygobject3.spec b/pygobject3.spec index 0478c4d..96b1753 100644 --- a/pygobject3.spec +++ b/pygobject3.spec @@ -12,13 +12,18 @@ Name: pygobject3 Version: 3.32.1 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Python bindings for GObject Introspection License: LGPLv2+ and MIT URL: https://wiki.gnome.org/Projects/PyGObject Source0: https://download.gnome.org/sources/pygobject/3.32/pygobject-%{version}.tar.xz +Patch0: https://gitlab.gnome.org/GNOME/pygobject/commit/1c78286f8aef7ed411efc159a7abb1edcf744102.patch +Patch1: https://gitlab.gnome.org/GNOME/pygobject/commit/b99640a50e165e2a241fdbadca8a537c5930bdd1.patch +Patch2: https://gitlab.gnome.org/GNOME/pygobject/commit/dea99de09f273a54244af1f3250f6699cfede637.patch +Patch3: https://gitlab.gnome.org/GNOME/pygobject/commit/ab596da7991dc5b91b047fc741c9da23ae051e1a.patch + BuildRequires: glib2-devel >= %{glib2_version} BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version} BuildRequires: meson @@ -118,7 +123,7 @@ Requires: gobject-introspection-devel%{?_isa} This package contains files required to embed PyGObject %prep -%setup -q -n pygobject-%{version} +%autosetup -n pygobject-%{version} -p1 %if 0%{?with_python3} rm -rf %{py3dir} @@ -201,6 +206,9 @@ xvfb-run make DESTDIR=$RPM_BUILD_ROOT check V=1 %{_libdir}/pkgconfig/pygobject-3.0.pc %changelog +* Tue Jun 18 2019 Zbigniew Jędrzejewski-Szmek - 3.32.1-2 +- Fix build under python3.8 (#1717655) + * Mon May 06 2019 Kalev Lember - 3.32.1-1 - Update to 3.32.1