Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: GitHub Copilot <copilot@github.com>
Date: Sun, 23 Aug 2026 10:05:00 +0000
Subject: [PATCH] gdbus-codegen: drop distutils dependency

Python 3.12 removed distutils from the standard library. GLib 2.46 still
imports distutils.version in gdbus-codegen, which breaks host-libglib2 on
modern Linux distributions before the rest of the toolchain can build.

Replace the LooseVersion-based sort key with a small local parser so the
code generator keeps the same version ordering without relying on any
non-standard Python module.

Signed-off-by: GitHub Copilot <copilot@github.com>
---
gio/gdbus-2.0/codegen/utils.py | 23 +++++++++++++++++++++--
1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py
index 9eaa7f8..f16e92c 100644
--- a/gio/gdbus-2.0/codegen/utils.py
+++ b/gio/gdbus-2.0/codegen/utils.py
@@ -17,7 +17,7 @@
#
# Author: David Zeuthen <davidz@redhat.com>

-import distutils.version
+import re

def strip_dots(s):
ret = ''
@@ -81,8 +81,27 @@ def lookup_brief_docs(annotations):
return s

def version_cmp_key(key):
+ def version_part(part):
+ if part.isdigit():
+ return (0, int(part))
+ return (1, part)
+
+ def version_key(version):
+ parts = []
+ for part in re.split(r'([0-9]+|[._+-])', version):
+ if not part or part in '._+-':
+ continue
+ parts.append(version_part(part))
+ return tuple(parts)
+
# If the 'since' version is empty put a 0 in its place as this will
- # allow LooseVersion to work and will always compare lower.
+ # compare lower than any real version.
+ #
+ # Keep the comparison loose so versions like "2.74.0" and "2.74.0-1"
+ # continue to sort naturally without depending on distutils, which was
+ # removed from Python 3.12.
v = key[0] if key[0] else '0'
- return (distutils.version.LooseVersion(v), key[1])
+ return (version_key(v), key[1])
--
2.43.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff --git a/BLAS/SRC/xerbla.c b/BLAS/SRC/xerbla.c
--- a/BLAS/SRC/xerbla.c
+++ b/BLAS/SRC/xerbla.c
Comment thread
Copilot marked this conversation as resolved.
@@ -13,6 +13,7 @@
#include "f2c.h"
#include "blaswrap.h"
+#include <stdio.h>

/* Table of constant values */

Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/SRC/sgees.c b/SRC/sgees.c
--- a/SRC/sgees.c
+++ b/SRC/sgees.c
Comment thread
Copilot marked this conversation as resolved.
@@ -18,8 +18,8 @@
static integer c__1 = 1;
static integer c__0 = 0;
static integer c_n1 = -1;

-/* Subroutine */ int sgees_(char *jobvs, char *sort, L_fp select, integer *n,
+/* Subroutine */ int sgees_(char *jobvs, char *sort, L_fp selectfn, integer *n,
real *a, integer *lda, integer *sdim, real *wr, real *wi, real *vs,
Comment on lines +9 to +11

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in ff96608. I changed only the two sgges/sggesx patch files so they now apply typed selctg callback signatures (logical (*selctg)(real *, real *, real *)), which addresses the missing coverage noted in this thread.

integer *ldvs, real *work, integer *lwork, logical *bwork, integer *
info)
@@ -388,6 +388,6 @@
i__1 = *n;
for (i__ = 1; i__ <= i__1; ++i__) {
- bwork[i__] = (*select)(&wr[i__], &wi[i__]);
+ bwork[i__] = (*selectfn)(&wr[i__], &wi[i__]);
/* L10: */
}

@@ -504,6 +504,6 @@
i__1 = *n;
for (i__ = 1; i__ <= i__1; ++i__) {
- cursl = (*select)(&wr[i__], &wi[i__]);
+ cursl = (*selectfn)(&wr[i__], &wi[i__]);
if (wi[i__] == 0.f) {
if (cursl) {
++(*sdim);
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/SRC/sgeesx.c b/SRC/sgeesx.c
--- a/SRC/sgeesx.c
+++ b/SRC/sgeesx.c
Comment thread
Copilot marked this conversation as resolved.
@@ -18,9 +18,9 @@
static integer c__1 = 1;
static integer c__0 = 0;
static integer c_n1 = -1;

-/* Subroutine */ int sgeesx_(char *jobvs, char *sort, L_fp select, char *
+/* Subroutine */ int sgeesx_(char *jobvs, char *sort, L_fp selectfn, char *
sense, integer *n, real *a, integer *lda, integer *sdim, real *wr,
real *wi, real *vs, integer *ldvs, real *rconde, real *rcondv, real *
work, integer *lwork, integer *iwork, integer *liwork, logical *bwork,
integer *info)
@@ -458,6 +458,6 @@
i__1 = *n;
for (i__ = 1; i__ <= i__1; ++i__) {
- bwork[i__] = (*select)(&wr[i__], &wi[i__]);
+ bwork[i__] = (*selectfn)(&wr[i__], &wi[i__]);
/* L10: */
}

@@ -594,6 +594,6 @@
i__1 = *n;
for (i__ = 1; i__ <= i__1; ++i__) {
- cursl = (*select)(&wr[i__], &wi[i__]);
+ cursl = (*selectfn)(&wr[i__], &wi[i__]);
if (wi[i__] == 0.f) {
if (cursl) {
++(*sdim);
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/SRC/sgges.c b/SRC/sgges.c
--- a/SRC/sgges.c
+++ b/SRC/sgges.c
@@ -18,8 +18,8 @@
static integer c__1 = 1;
static integer c__0 = 0;
static integer c_n1 = -1;

-/* Subroutine */ int sgges_(char *jobvsl, char *jobvsr, char *sort, L_fp
- selctg, integer *n, real *a, integer *lda, real *b, integer *ldb,
+/* Subroutine */ int sgges_(char *jobvsl, char *jobvsr, char *sort, logical
+ (*selctg)(real *, real *, real *), integer *n, real *a, integer *lda, real *b, integer *ldb,
integer *sdim, real *alphar, real *alphai, real *beta, real *vsl,
integer *ldvsl, real *vsr, integer *ldvsr, real *work, integer *lwork,
logical *bwork, integer *info)
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/SRC/sggesx.c b/SRC/sggesx.c
--- a/SRC/sggesx.c
+++ b/SRC/sggesx.c
@@ -18,8 +18,8 @@
static integer c__1 = 1;
static integer c__0 = 0;
static integer c_n1 = -1;

-/* Subroutine */ int sggesx_(char *jobvsl, char *jobvsr, char *sort, L_fp
- selctg, char *sense, integer *n, real *a, integer *lda, real *b,
+/* Subroutine */ int sggesx_(char *jobvsl, char *jobvsr, char *sort, logical
+ (*selctg)(real *, real *, real *), char *sense, integer *n, real *a, integer *lda, real *b,
integer *ldb, integer *sdim, real *alphar, real *alphai, real *beta,
real *vsl, integer *ldvsl, real *vsr, integer *ldvsr, real *rconde,
real *rcondv, real *work, integer *lwork, integer *iwork, integer *