Compare commits

...

No commits in common. 'c9' and 'c8' have entirely different histories.
c9 ... c8

2
.gitignore vendored

@ -1 +1 @@
SOURCES/pygobject-3.40.1.tar.xz
SOURCES/pygobject-3.28.3.tar.xz

@ -1 +1 @@
2c12bc5732a38b055bcc2bcdeefdc8663380f3c9 SOURCES/pygobject-3.40.1.tar.xz
bd173699b62832163ad23f8e076ec9513d875d2d SOURCES/pygobject-3.28.3.tar.xz

@ -1,4 +1,4 @@
From 1212d1cd3d4b47294770408a7abd18bc4c578a64 Mon Sep 17 00:00:00 2001
From eb791e7cca0998bc75e0b3f7e8ecf2672c96d7f8 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Wed, 10 Jun 2020 18:04:07 -0400
Subject: [PATCH] IntrospectionModule: handle two threads loading type at same
@ -16,93 +16,17 @@ on each others toes.
gi/module.py | 110 +++++++++++++++++++++++++++------------------------
1 file changed, 58 insertions(+), 52 deletions(-)
diff --git a/gi/module.py b/gi/module.py
index f9e26bc2..93b8e6a3 100644
--- a/gi/module.py
+++ b/gi/module.py
@@ -1,53 +1,54 @@
# -*- Mode: Python; py-indent-offset: 4 -*-
# vim: tabstop=4 shiftwidth=4 expandtab
#
# Copyright (C) 2007-2009 Johan Dahlin <johan@gnome.org>
#
# module.py: dynamic module for introspected libraries.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
# USA
--- a/gi/module.py 2020-06-10 18:09:19.292409072 -0400
+++ b/gi/module.py 2020-06-10 18:11:24.727045466 -0400
@@ -24,6 +24,7 @@ from __future__ import absolute_import
import sys
import importlib
+from threading import Lock
import gi
from ._gi import \
Repository, \
FunctionInfo, \
RegisteredTypeInfo, \
EnumInfo, \
ObjectInfo, \
InterfaceInfo, \
ConstantInfo, \
StructInfo, \
UnionInfo, \
CallbackInfo, \
Struct, \
Boxed, \
CCallback, \
enum_add, \
enum_register_new_gtype_and_add, \
flags_add, \
flags_register_new_gtype_and_add, \
GInterface
from .types import \
GObjectMeta, \
StructMeta
from ._constants import \
TYPE_NONE, \
TYPE_BOXED, \
TYPE_POINTER, \
@@ -90,152 +91,157 @@ def get_interfaces_for_object(object_info):
namespace = interface_info.get_namespace()
name = interface_info.get_name()
module = importlib.import_module('gi.repository.' + namespace)
interfaces.append(getattr(module, name))
return interfaces
class IntrospectionModule(object):
"""An object which wraps an introspection typelib.
This wrapping creates a python module like representation of the typelib
using gi repository as a foundation. Accessing attributes of the module
will dynamically pull them in and create wrappers for the members.
These members are then cached on this introspection module.
"""
def __init__(self, namespace, version=None):
"""Might raise gi._gi.RepositoryError"""
repository.require(namespace, version)
self._namespace = namespace
self._version = version
self.__name__ = 'gi.repository.' + namespace
path = repository.get_typelib_path(self._namespace)
self.__path__ = [path]
_have_py3 = (sys.version_info[0] >= 3)
@@ -131,6 +132,8 @@ class IntrospectionModule(object):
if self._version is None:
self._version = repository.get_version(self._namespace)
@ -111,12 +35,13 @@ index f9e26bc2..93b8e6a3 100644
def __getattr__(self, name):
info = repository.find_by_name(self._namespace, name)
if not info:
raise AttributeError("%r object has no attribute %r" % (
self.__name__, name))
@@ -139,39 +142,40 @@ class IntrospectionModule(object):
if isinstance(info, EnumInfo):
g_type = info.get_g_type()
- wrapper = g_type.pytype
+ with self._lock:
+ wrapper = g_type.pytype
- if wrapper is None:
- if info.is_flags():
@ -128,9 +53,6 @@ index f9e26bc2..93b8e6a3 100644
- else:
- if g_type.is_a(TYPE_ENUM):
- wrapper = enum_add(g_type)
+ with self._lock:
+ wrapper = g_type.pytype
+
+ if wrapper is None:
+ if info.is_flags():
+ if g_type.is_a(TYPE_FLAGS):
@ -148,7 +70,7 @@ index f9e26bc2..93b8e6a3 100644
- # Don't use upper() here to avoid locale specific
- # identifier conversion (e. g. in Turkish 'i'.upper() == 'i')
- # see https://bugzilla.gnome.org/show_bug.cgi?id=649165
- ascii_upper_trans = ''.maketrans(
- ascii_upper_trans = maketrans(
- 'abcdefgjhijklmnopqrstuvwxyz',
- 'ABCDEFGJHIJKLMNOPQRSTUVWXYZ')
- for value_info in info.get_values():
@ -156,9 +78,6 @@ index f9e26bc2..93b8e6a3 100644
- setattr(wrapper, value_name, wrapper(value_info.get_value()))
- for method_info in info.get_methods():
- setattr(wrapper, method_info.__name__, method_info)
-
- if g_type != TYPE_NONE:
- g_type.pytype = wrapper
+ if g_type.is_a(TYPE_ENUM):
+ wrapper = enum_add(g_type)
+ else:
@ -171,7 +90,7 @@ index f9e26bc2..93b8e6a3 100644
+ # Don't use upper() here to avoid locale specific
+ # identifier conversion (e. g. in Turkish 'i'.upper() == 'i')
+ # see https://bugzilla.gnome.org/show_bug.cgi?id=649165
+ ascii_upper_trans = ''.maketrans(
+ ascii_upper_trans = maketrans(
+ 'abcdefgjhijklmnopqrstuvwxyz',
+ 'ABCDEFGJHIJKLMNOPQRSTUVWXYZ')
+ for value_info in info.get_values():
@ -179,36 +98,15 @@ index f9e26bc2..93b8e6a3 100644
+ setattr(wrapper, value_name, wrapper(value_info.get_value()))
+ for method_info in info.get_methods():
+ setattr(wrapper, method_info.__name__, method_info)
+
- if g_type != TYPE_NONE:
- g_type.pytype = wrapper
+ if g_type != TYPE_NONE:
+ g_type.pytype = wrapper
elif isinstance(info, RegisteredTypeInfo):
g_type = info.get_g_type()
# Create a wrapper.
if isinstance(info, ObjectInfo):
parent = get_parent_for_object(info)
interfaces = tuple(interface for interface in get_interfaces_for_object(info)
if not issubclass(parent, interface))
bases = (parent,) + interfaces
metaclass = GObjectMeta
elif isinstance(info, CallbackInfo):
bases = (CCallback,)
metaclass = GObjectMeta
elif isinstance(info, InterfaceInfo):
bases = (GInterface,)
metaclass = GObjectMeta
elif isinstance(info, (StructInfo, UnionInfo)):
if g_type.is_a(TYPE_BOXED):
bases = (Boxed,)
elif (g_type.is_a(TYPE_POINTER) or
g_type == TYPE_NONE or
g_type.fundamental == g_type):
bases = (Struct,)
else:
raise TypeError("unable to create a wrapper for %s.%s" % (info.get_namespace(), info.get_name()))
metaclass = StructMeta
@@ -202,27 +206,28 @@ class IntrospectionModule(object):
else:
raise NotImplementedError(info)
@ -258,33 +156,3 @@ index f9e26bc2..93b8e6a3 100644
elif isinstance(info, FunctionInfo):
wrapper = info
elif isinstance(info, ConstantInfo):
wrapper = info.get_value()
else:
raise NotImplementedError(info)
# Cache the newly created wrapper which will then be
# available directly on this introspection module instead of being
# lazily constructed through the __getattr__ we are currently in.
self.__dict__[name] = wrapper
return wrapper
def __repr__(self):
path = repository.get_typelib_path(self._namespace)
return "<IntrospectionModule %r from %r>" % (self._namespace, path)
def __dir__(self):
# Python's default dir() is just dir(self.__class__) + self.__dict__.keys()
result = set(dir(self.__class__))
result.update(self.__dict__.keys())
# update *set* because some repository attributes have already been
# wrapped by __getattr__() and included in self.__dict__; but skip
# Callback types, as these are not real objects which we can actually
# get
namespace_infos = repository.get_infos(self._namespace)
result.update(info.get_name() for info in namespace_infos if
not isinstance(info, CallbackInfo))
--
2.31.1

@ -1,31 +1,45 @@
%define glib2_version 2.56.0
%define gobject_introspection_version 1.56.0
%define pycairo_version 1.16.0
%define python2_version 2.7
# Last updated for version 3.27.5
%define glib2_version 2.38.0
%define gobject_introspection_version 1.46.0
%define pycairo_version 1.11.1
%global with_python3 1
%define python3_version 3.4
%global with_check 0
Name: pygobject3
Version: 3.40.1
Release: 6%{?dist}
Version: 3.28.3
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.40/pygobject-%{version}.tar.xz
Source0: https://download.gnome.org/sources/pygobject/3.28/pygobject-%{version}.tar.xz
BuildRequires: cairo-gobject-devel
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version}
BuildRequires: meson
BuildRequires: python3-devel >= %{python3_version}
BuildRequires: python3-cairo-devel >= %{pycairo_version}
BuildRequires: python3-setuptools
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#_byte_compilation_reproducibility
%global py_reproducible_pyc_path %{buildroot}%{python3_sitelib}
BuildRequires: /usr/bin/marshalparser
BuildRequires: cairo-gobject-devel
Patch10001: 0001-IntrospectionModule-handle-two-threads-loading-type-.patch
# Required by the upstream selftest suite:
%if %{with_check}
BuildRequires: python3-pyflakes
BuildRequires: python3-pep8
## for the Gdk and Gtk typelibs, used during the test suite:
BuildRequires: gtk3
## for xvfb-run:
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
%endif # with_check
Patch0: 0001-IntrospectionModule-handle-two-threads-loading-type-.patch
%description
The %{name} package provides a convenient wrapper for the GObject library
@ -45,201 +59,88 @@ 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}
Requires: python3-gobject-base-noarch = %{version}-%{release}
%description -n python3-gobject-base
This package provides the non-cairo specific bits of the GObject Introspection
library that are architecture specific.
%package -n python3-gobject-base-noarch
Summary: Python 3 bindings for GObject Introspection base (not architecture dependent)
BuildArch: noarch
Requires: python3-gobject-base = %{version}-%{release}
%description -n python3-gobject-base-noarch
This package provides the non-cairo specific bits of the GObject Introspection
library that are not architecture specific.
library.
%package -n python3-gobject-devel
%package devel
Summary: Development files for embedding PyGObject introspection support
Requires: python3-gobject%{?_isa} = %{version}-%{release}
Requires: gobject-introspection-devel%{?_isa}
# Renamed in F31
Obsoletes: pygobject3-devel < 3.34.0-2
Provides: pygobject3-devel = %{version}-%{release}
%description -n python3-gobject-devel
%description devel
This package contains files required to embed PyGObject
%prep
%autosetup -n pygobject-%{version} -p1
%setup -q -n pygobject-%{version}
%patch0 -p1 -b .lockablock
find -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%build
%meson -Dpython=%{__python3}
%meson_build
PYTHON=%{__python3}
export PYTHON
%configure
make %{?_smp_mflags} V=1
%install
%meson_install
PYTHON=%{__python3}
export PYTHON
%make_install
find $RPM_BUILD_ROOT -name '*.la' -delete
# Don't include makefiles in the installed docs, in order to avoid creating
# multilib conflicts
rm -rf _docs
mkdir _docs
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):
PYTHON=%{__python3}
export PYTHON
xvfb-run make DESTDIR=$RPM_BUILD_ROOT check V=1
xvfb-run make DESTDIR=$RPM_BUILD_ROOT check V=1
%endif # with_check
%files -n python3-gobject
%{python3_sitearch}/gi/_gi_cairo*.so
%files -n python3-gobject-base
%dir %{python3_sitearch}/gi/
%pycached %{python3_sitearch}/gi/*.py
%{python3_sitearch}/gi/_gi.*.so
%{python3_sitearch}/PyGObject-*.egg-info
%files -n python3-gobject-base-noarch
%license COPYING
%doc NEWS
%dir %{python3_sitelib}/gi/
%{python3_sitelib}/gi/overrides/
%{python3_sitelib}/gi/repository/
%{python3_sitelib}/pygtkcompat/
%files -n python3-gobject-devel
%dir %{python3_sitearch}/gi
%{python3_sitearch}/gi/*
%exclude %{python3_sitearch}/gi/_gi_cairo*.so
%{python3_sitearch}/pygobject-*.egg-info
%{python3_sitearch}/pygtkcompat/
%files devel
%doc _docs/*
%dir %{_includedir}/pygobject-3.0/
%{_includedir}/pygobject-3.0/pygobject.h
%{_libdir}/pkgconfig/pygobject-3.0.pc
%changelog
* Tue Jun 14 2022 Tomas Popela <tpopela@redhat.com> - 3.40.1-6
- Fix the multilib problems by backporting fixes done by mhroncok from Fedora:
- Move pure Python modules to a noarch subpackage
- Ensure Python bytecode installed in multilib packages is bit-to-bit identical
Resolves: rhbz#1915764
* Thu Aug 19 2021 DJ Delorie <dj@redhat.com> - 3.40.1-5
- Rebuilt for libffi 3.4.2 SONAME transition.
Related: rhbz#1891914
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 3.40.1-4
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Wed May 05 2021 Ray Strode <rstrode@redhat.com> - 3.40.1-3
- Add concurrency fix
Related: #1957130
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 3.40.1-2
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Mar 30 2021 Kalev Lember <klember@redhat.com> - 3.40.1-1
- Update to 3.40.1
* Mon Mar 22 2021 Kalev Lember <klember@redhat.com> - 3.40.0-1
- Update to 3.40.0
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.38.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Oct 05 2020 Kalev Lember <klember@redhat.com> - 3.38.0-2
- Explicity BuildRequire python3-setuptools
* Sat Sep 12 2020 Kalev Lember <klember@redhat.com> - 3.38.0-1
- Update to 3.38.0
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.36.1-4
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.36.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri May 22 2020 Miro Hrončok <mhroncok@redhat.com> - 3.36.1-2
- Rebuilt for Python 3.9
* Thu May 07 2020 Kalev Lember <klember@redhat.com> - 3.36.1-1
- Update to 3.36.1
* Thu Jun 11 2020 Ray Strode <rstrode@redhat.com> - 3.28.3-2
- Add lock to avoid two type object wrappers getting generated at
the same time in multi-threaded programs.
Resolves: #1844578
* Sun Mar 08 2020 Kalev Lember <klember@redhat.com> - 3.36.0-2
- Drop pkgconfig provides filtering as we no longer ship the Python 2 package
* Sun Mar 08 2020 Kalev Lember <klember@redhat.com> - 3.36.0-1
- Update to 3.36.0
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.34.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jan 16 2020 Miro Hrončok <mhroncok@redhat.com> - 3.34.0-4
- Subpackages python2-gobject, python2-gobject-base, python2-gobject-devel have been removed
See https://fedoraproject.org/wiki/Changes/RetirePython2
* Wed Sep 25 2019 Kalev Lember <klember@redhat.com> - 3.34.0-3
- Don't add pkgconfig provides to python2-gobject-devel
* Sat Sep 21 2019 Kalev Lember <klember@redhat.com> - 3.34.0-2
- Drop Python 3 conditionals
- Split pygobject3-devel into python2-gobject-devel and python3-gobject-devel
(#1749589)
* Mon Sep 09 2019 Kalev Lember <klember@redhat.com> - 3.34.0-1
- Update to 3.34.0
* Mon Aug 19 2019 Kalev Lember <klember@redhat.com> - 3.33.1-1
- Update to 3.33.1
* Thu Aug 15 2019 Miro Hrončok <mhroncok@redhat.com> - 3.32.2-3
- Rebuilt for Python 3.8
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.32.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Mon Jun 24 2019 Kalev Lember <klember@redhat.com> - 3.32.2-1
- Update to 3.32.2
* Tue Jun 18 2019 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 3.32.1-2
- Fix build under python3.8 (#1717655)
* Mon May 06 2019 Kalev Lember <klember@redhat.com> - 3.32.1-1
- Update to 3.32.1
* Mon Mar 11 2019 Kalev Lember <klember@redhat.com> - 3.32.0-1
- Update to 3.32.0
* Thu Mar 07 2019 Kalev Lember <klember@redhat.com> - 3.31.4-1
- Update to 3.31.4
* Mon Feb 04 2019 Kalev Lember <klember@redhat.com> - 3.31.3-1
- Update to 3.31.3
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.31.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Jan 23 2019 Kalev Lember <klember@redhat.com> - 3.31.2-1
- Update to 3.31.2
* Sat Dec 01 2018 Kalev Lember <klember@redhat.com> - 3.30.4-1
- Update to 3.30.4
* Tue Nov 27 2018 Kalev Lember <klember@redhat.com> - 3.30.3-1
- Update to 3.30.3
* Mon Nov 12 2018 Kalev Lember <klember@redhat.com> - 3.30.2-1
- Update to 3.30.2
* Fri Sep 14 2018 Kalev Lember <klember@redhat.com> - 3.30.1-1
- Update to 3.30.1
* Fri Sep 14 2018 Dan Horák <dan[at]danny.cz> - 3.30.0-2
- Include temporary big endian fix (#1623547)
* Thu Sep 06 2018 Kalev Lember <klember@redhat.com> - 3.30.0-1
- Update to 3.30.0
* Mon Aug 13 2018 Kalev Lember <klember@redhat.com> - 3.29.2-1
- Update to 3.29.2
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 3.28.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Jun 15 2018 Miro Hrončok <mhroncok@redhat.com> - 3.28.3-2
- Rebuilt for Python 3.7
* Fri Jun 01 2018 Kalev Lember <klember@redhat.com> - 3.28.3-1
* Fri Aug 10 2018 Kalev Lember <klember@redhat.com> - 3.28.3-1
- Update to 3.28.3
* Tue Aug 07 2018 Petr Viktorin <pviktori@redhat.com> - 3.28.2-2
- Remove the python2 subpackages
https://bugzilla.redhat.com/show_bug.cgi?id=1590819
* Wed Mar 28 2018 Kalev Lember <klember@redhat.com> - 3.28.2-1
- Update to 3.28.2

Loading…
Cancel
Save