From 5da6cffbbf42077d05f360f325e6d54e481188720cde25ac9cc128c417c250b0 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Fri, 5 Aug 2022 12:39:42 +0000 Subject: [PATCH] Accepting request 993301 from home:mcepl:branches:hardware - Add no-pkg-resources.patch to fix the crash with missing Python pkg_resources pacakge (removd in Python 3.10). OBS-URL: https://build.opensuse.org/request/show/993301 OBS-URL: https://build.opensuse.org/package/show/hardware/libgusb?expand=0&rev=39 --- libgusb.changes | 6 ++++++ libgusb.spec | 7 ++++++- no-pkg-resources.patch | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 no-pkg-resources.patch diff --git a/libgusb.changes b/libgusb.changes index 71b8079..1229ba2 100644 --- a/libgusb.changes +++ b/libgusb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Aug 5 11:30:24 UTC 2022 - Matej Cepl + +- Add no-pkg-resources.patch to fix the crash with missing Python + pkg_resources pacakge (removd in Python 3.10). + ------------------------------------------------------------------- Mon May 9 07:58:08 UTC 2022 - Paolo Stivanin diff --git a/libgusb.spec b/libgusb.spec index b4b0c1c..6fc8404 100644 --- a/libgusb.spec +++ b/libgusb.spec @@ -25,9 +25,14 @@ Group: Development/Libraries/GNOME URL: https://github.com/hughsie/libgusb Source0: http://people.freedesktop.org/~hughsient/releases/%{name}-%{version}.tar.xz Source99: baselibs.conf +# PATCH-FIX-UPSTREAM no-pkg-resources.patch gh#hughsie/libgusb#61 mcepl@suse.com +# Don't rely on the obsolete version of pkg_resources +Patch0: no-pkg-resources.patch BuildRequires: gtk-doc BuildRequires: meson BuildRequires: pkgconfig +BuildRequires: python3-base +BuildRequires: python3-packaging BuildRequires: vala BuildRequires: pkgconfig(glib-2.0) >= 2.44.0 BuildRequires: pkgconfig(gobject-introspection-1.0) >= 1.29 @@ -69,7 +74,7 @@ asynchronous control, bulk and interrupt transfers with proper cancellation and integration into a mainloop. %prep -%setup -q +%autosetup -p1 %build %meson diff --git a/no-pkg-resources.patch b/no-pkg-resources.patch new file mode 100644 index 0000000..c540488 --- /dev/null +++ b/no-pkg-resources.patch @@ -0,0 +1,41 @@ +--- + contrib/generate-version-script.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/contrib/generate-version-script.py ++++ b/contrib/generate-version-script.py +@@ -7,7 +7,7 @@ + import sys + import xml.etree.ElementTree as ET + +-from pkg_resources import parse_version ++from packaging.version import parse + + XMLNS = '{http://www.gtk.org/introspection/core/1.0}' + XMLNS_C = '{http://www.gtk.org/introspection/c/1.0}' +@@ -54,14 +54,14 @@ class LdVersionScript: + for node in cls.findall(XMLNS + 'method'): + version_tmp = self._add_node(node) + if version_tmp: +- if not version_lowest or parse_version(version_tmp) < parse_version(version_lowest): ++ if not version_lowest or parse(version_tmp) < parse(version_lowest): + version_lowest = version_tmp + + # add the constructor + for node in cls.findall(XMLNS + 'constructor'): + version_tmp = self._add_node(node) + if version_tmp: +- if not version_lowest or parse_version(version_tmp) < parse_version(version_lowest): ++ if not version_lowest or parse(version_tmp) < parse(version_lowest): + version_lowest = version_tmp + + if '{http://www.gtk.org/introspection/glib/1.0}get-type' not in cls.attrib: +@@ -93,7 +93,7 @@ class LdVersionScript: + # output the version data to a file + verout = '# generated automatically, do not edit!\n' + oldversion = None +- for version in sorted(versions, key=parse_version): ++ for version in sorted(versions, key=parse): + symbols = sorted(self.releases[version]) + verout += '\n%s_%s {\n' % (self.library_name, version) + verout += ' global:\n'