commit:     d2a3cfe3b625829a894f700da57795327a9cbe92
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 22 11:25:05 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jan 22 11:26:10 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2a3cfe3

dev-util/gdbus-codegen: patch out distutils use

Just like the fix from bug #922654, but utils.py gets installed, so we need
to make sure we both patch it here too & add dev-python/packaging to RDEPEND.

Thanks to leio for pointing it out.

Bug: https://bugs.gentoo.org/919904
Bug: https://bugs.gentoo.org/922654
Fixes: 214971a1af7edd43d423a590d17f8cff8f36526e
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/gdbus-codegen-2.78.4-distutils.patch     | 36 ++++++++++++++++++++++
 ....78.4.ebuild => gdbus-codegen-2.78.4-r1.ebuild} |  8 ++++-
 2 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/dev-util/gdbus-codegen/files/gdbus-codegen-2.78.4-distutils.patch 
b/dev-util/gdbus-codegen/files/gdbus-codegen-2.78.4-distutils.patch
new file mode 100644
index 000000000000..38fbe0e1a9b5
--- /dev/null
+++ b/dev-util/gdbus-codegen/files/gdbus-codegen-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/utils.py
++++ b/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-util/gdbus-codegen/gdbus-codegen-2.78.4.ebuild 
b/dev-util/gdbus-codegen/gdbus-codegen-2.78.4-r1.ebuild
similarity index 93%
rename from dev-util/gdbus-codegen/gdbus-codegen-2.78.4.ebuild
rename to dev-util/gdbus-codegen/gdbus-codegen-2.78.4-r1.ebuild
index a859319309e2..00234d0e217a 100644
--- a/dev-util/gdbus-codegen/gdbus-codegen-2.78.4.ebuild
+++ b/dev-util/gdbus-codegen/gdbus-codegen-2.78.4-r1.ebuild
@@ -17,7 +17,12 @@ LICENSE="LGPL-2+"
 SLOT="0"
 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 
~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
 
-RDEPEND="${PYTHON_DEPS}"
+RDEPEND="
+       ${PYTHON_DEPS}
+       $(python_gen_cond_dep '
+               dev-python/packaging[${PYTHON_USEDEP}]
+       ')
+"
 DEPEND="${RDEPEND}"
 BDEPEND="
        dev-libs/libxslt
@@ -29,6 +34,7 @@ S="${WORKDIR}/glib-${PV}/gio/gdbus-2.0/codegen"
 python_prepare_all() {
        PATCHES=(
                "${FILESDIR}/${PN}-2.56.1-sitedir.patch"
+               "${FILESDIR}/${PN}-2.78.4-distutils.patch"
        )
        distutils-r1_python_prepare_all
 

Reply via email to