From cbc5ca48b8ff12f9c3adb06b3a941c5703f5ab64e94be6507f2626276be30393 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Lie?= Date: Mon, 18 Jan 2021 13:16:18 +0000 Subject: [PATCH] Accepting request 863409 from home:bnavigator:branches:GNOME:Factory - Recompile python cache files after removal of components, include cache files in correct subpackage - Fix supplements declarations, where possible. Disable for -gdk. OBS-URL: https://build.opensuse.org/request/show/863409 OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/python-gobject?expand=0&rev=125 --- python-gobject.changes | 7 +++++++ python-gobject.spec | 44 +++++++++++++++++++++++++++++++++--------- 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/python-gobject.changes b/python-gobject.changes index 1ab680e..5545ac0 100644 --- a/python-gobject.changes +++ b/python-gobject.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jan 13 12:59:29 UTC 2021 - Benjamin Greiner + +- Recompile python cache files after removal of components, include + cache files in correct subpackage +- Fix supplements declarations, where possible. Disable for -gdk. + ------------------------------------------------------------------- Wed Jan 13 08:28:34 UTC 2021 - Dominique Leuenberger diff --git a/python-gobject.spec b/python-gobject.spec index 8ce0e47..d8dd9ed 100644 --- a/python-gobject.spec +++ b/python-gobject.spec @@ -17,6 +17,12 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} +# Define these before the call of python_subpackages +%define introspection_real_package %(rpm -q --qf '%%{NAME}' -f $(readlink %{_libdir}/libgirepository-1.0.so -f)) +%define cairo_real_package %(rpm -q --qf '%%{NAME}' --whatprovides cairo) +# Don't BuildRequire pkgconfig(gdk-3.0) to find the real package for libgdk-3! +# It produces a dependency cycle: avahi - gtk3-devel - python-dbus-python +#%%define gdk_real_package %%(rpm -q --qf '%%{NAME}' -f $(readlink %%{_libdir}/libgdk-3.so -f)) # This figures in an error message %global __requires_exclude typelib\\(%%namespaces\\) %global __requires_exclude_from ^%{_libdir}/python.*/site-packages/gi/__init__.py$ @@ -41,9 +47,11 @@ BuildRequires: pkgconfig(cairo) BuildRequires: pkgconfig(cairo-gobject) BuildRequires: pkgconfig(gio-2.0) >= 2.38.0 BuildRequires: pkgconfig(glib-2.0) >= 2.38.0 +# build cycle! +# BuildRequires: pkgconfig(gdk-3.0) >= 2.38.0 BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.46.0 -# Trigger an automatic installation of python(3)?-gobject when python and libgirepository are installed. -Supplements: packageand(python:%{gdk_real_package}) +# Trigger an automatic installation of python(2|3.*)-gobject when python and libgirepository are installed. +Supplements: packageand(python:%{introspection_real_package}) %python_subpackages %description @@ -51,12 +59,12 @@ Pygobjects is an extension module for python that gives you access to GLib's GObjects. %package Gdk -%define gdk_real_package %(rpm -q --qf '%%{NAME}' -f $(readlink %{_libdir}/libgdk-3.so -f)) Summary: Python bindings for GObject/Gdk Group: Development/Languages/Python Requires: %{name} = %{version} Requires: %{name}-cairo = %{version} -Supplements: packageand(python-gobject:%{gdk_real_package}) +# See above +#Supplements: packageand(python-gobject:%%{gdk_real_package}) %description Gdk Pygobjects is an extension module for python that gives you access to @@ -65,7 +73,6 @@ GLib's GObjects. This package contains the Python Gdk bindings for GObject. %package cairo -%define cairo_real_package %(rpm -q --qf '%%{NAME}' --whatprovides cairo) Summary: Python bindings for GObject/Cairo Group: Development/Languages/Python Requires: %{name} = %{version} @@ -116,15 +123,22 @@ export CFLAGS="%{optflags}" %install %python_install + +%{python_expand # delete unwanted python scripts and their compiled cache files # Drop pygtkcompat layer - It's useless and we lack other stuff for it to work -%python_expand rm %{buildroot}%{$python_sitearch}/gi/pygtkcompat.py* -%python_expand rm -r %{buildroot}%{$python_sitearch}/pygtkcompat/ +rm -v %{buildroot}%{$python_sitearch}/gi/pygtkcompat.py* +rm -vf %{buildroot}%{$python_sitearch}/gi/__pycache__/pygtkcompat* +rm -vr %{buildroot}%{$python_sitearch}/pygtkcompat/ # Drop GIMarshallingTests - It's test suite remainders that should not be installed -find %{buildroot}%{_prefix} -name GIMarshallingTests.py* -delete -print +find %{buildroot}%{$python_sitearch} -name GIMarshallingTests* -delete -print +} find %{buildroot} "(" -name '*.la' -or -name '*.a' ")" -delete -%fdupes %{buildroot}/%{_prefix} + +%{?python_compileall} +%python_expand %fdupes %{buildroot}%{$python_sitearch} + %files %{python_files} %license COPYING @@ -141,6 +155,12 @@ find %{buildroot} "(" -name '*.la' -or -name '*.a' ")" -delete %exclude %{python_sitearch}/gi/overrides/Gtk.* %exclude %{python_sitearch}/gi/overrides/keysyms.* %exclude %{python_sitearch}/gi/overrides/Pango.* +%pycache_only %exclude %{python_sitearch}/gi/__pycache__/_gtktemplate* +%pycache_only %exclude %{python_sitearch}/gi/overrides/__pycache__/Gdk.* +%pycache_only %exclude %{python_sitearch}/gi/overrides/__pycache__/GdkPixbuf.* +%pycache_only %exclude %{python_sitearch}/gi/overrides/__pycache__/Gtk.* +%pycache_only %exclude %{python_sitearch}/gi/overrides/__pycache__/keysyms.* +%pycache_only %exclude %{python_sitearch}/gi/overrides/__pycache__/Pango.* %files %{python_files Gdk} %{python_sitearch}/gi/_gtktemplate.py @@ -149,6 +169,12 @@ find %{buildroot} "(" -name '*.la' -or -name '*.a' ")" -delete %{python_sitearch}/gi/overrides/Gtk.* %{python_sitearch}/gi/overrides/keysyms.* %{python_sitearch}/gi/overrides/Pango.* +%pycache_only %{python_sitearch}/gi/__pycache__/_gtktemplate* +%pycache_only %{python_sitearch}/gi/overrides/__pycache__/Gdk.* +%pycache_only %{python_sitearch}/gi/overrides/__pycache__/GdkPixbuf.* +%pycache_only %{python_sitearch}/gi/overrides/__pycache__/Gtk.* +%pycache_only %{python_sitearch}/gi/overrides/__pycache__/keysyms.* +%pycache_only %{python_sitearch}/gi/overrides/__pycache__/Pango.* %files %{python_files cairo} %{python_sitearch}/gi/_gi_cairo*.so