commit:     11641c3d40b399e3eacef4cecf256b5f2b4b5aa3
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 22 05:51:57 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jan 22 05:51:57 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11641c3d

dev-libs/glib: fix Python 3.12 build w/o setuptools

Closes: https://bugs.gentoo.org/922654
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/glib/files/glib-2.78.4-distutils.patch    | 36 ++++++++++++++++++++++
 .../{glib-2.78.4.ebuild => glib-2.78.4-r1.ebuild}  |  8 +++++
 2 files changed, 44 insertions(+)

diff --git a/dev-libs/glib/files/glib-2.78.4-distutils.patch 
b/dev-libs/glib/files/glib-2.78.4-distutils.patch
new file mode 100644
index 000000000000..70ceebcf7095
--- /dev/null
+++ b/dev-libs/glib/files/glib-2.78.4-distutils.patch
@@ -0,0 +1,36 @@
+https://bugs.gentoo.org/922654
+https://gitlab.gnome.org/GNOME/glib/-/issues/3134
+https://gitlab.gnome.org/GNOME/glib/-/commit/6ef967a0f930ce37a8c9b5aff969693b34714291
+
+[sam: Trimmed the CI changes.]
+
+From 6ef967a0f930ce37a8c9b5aff969693b34714291 Mon Sep 17 00:00:00 2001
+From: Jordan Williams <[email protected]>
+Date: Fri, 1 Dec 2023 09:53:50 -0600
+Subject: [PATCH] Switch from the deprecated distutils module to the packaging
+ module
+
+The distutils module was removed in Python 3.12.
+---
+
+--- a/gio/gdbus-2.0/codegen/utils.py
++++ b/gio/gdbus-2.0/codegen/utils.py
+@@ -19,7 +19,7 @@
+ #
+ # Author: David Zeuthen <[email protected]>
+ 
+-import distutils.version
++import packaging.version
+ import os
+ import sys
+ 
+@@ -166,4 +166,4 @@ def version_cmp_key(key):
+         v = str(key[0])
+     else:
+         v = "0"
+-    return (distutils.version.LooseVersion(v), key[1])
++    return (packaging.version.Version(v), key[1])
+-- 
+GitLab
+
+

diff --git a/dev-libs/glib/glib-2.78.4.ebuild 
b/dev-libs/glib/glib-2.78.4-r1.ebuild
similarity index 98%
rename from dev-libs/glib/glib-2.78.4.ebuild
rename to dev-libs/glib/glib-2.78.4-r1.ebuild
index 6fdf95422485..ec81f416256d 100644
--- a/dev-libs/glib/glib-2.78.4.ebuild
+++ b/dev-libs/glib/glib-2.78.4-r1.ebuild
@@ -51,6 +51,9 @@ BDEPEND="
                app-text/docbook-xml-dtd:4.5 )
        systemtap? ( >=dev-debug/systemtap-1.3 )
        ${PYTHON_DEPS}
+       $(python_gen_any_dep '
+               dev-python/packaging[${PYTHON_USEDEP}]
+       ')
        test? ( >=sys-apps/dbus-1.2.14 )
        virtual/pkgconfig
 "
@@ -69,8 +72,13 @@ MULTILIB_CHOST_TOOLS=(
 
 PATCHES=(
        "${FILESDIR}"/${PN}-2.64.1-mark-gdbus-server-auth-test-flaky.patch
+       "${FILESDIR}"/${PN}-2.78.4-distutils.patch
 )
 
+python_check_deps() {
+       python_has_version "dev-python/packaging[${PYTHON_USEDEP}]"
+}
+
 pkg_setup() {
        if use kernel_linux ; then
                CONFIG_CHECK="~INOTIFY_USER"

Reply via email to