Skip to content

Commit

Permalink
Fix distutils not found with Python 3.12
Browse files Browse the repository at this point in the history
(cherry picked from commit c815292)
  • Loading branch information
danyeaw authored and pbor committed Mar 28, 2024
1 parent 8d5e456 commit bad88d4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
25 changes: 25 additions & 0 deletions gvsbuild/patches/glib/002-python-312-distutils-to-packaging.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Subject: [PATCH] Replace distutils with packaging
---
Index: gio/gdbus-2.0/codegen/utils.py
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/gio/gdbus-2.0/codegen/utils.py b/gio/gdbus-2.0/codegen/utils.py
--- a/gio/gdbus-2.0/codegen/utils.py (revision e93fd4cfc39167cf0ceb9c531238d9800d3d9edb)
+++ b/gio/gdbus-2.0/codegen/utils.py (date 1705782834785)
@@ -19,7 +19,7 @@
#
# Author: David Zeuthen <davidz@redhat.com>

-import distutils.version
+import packaging.version
import os
import sys

@@ -166,4 +166,4 @@
v = str(key[0])
else:
v = "0"
- return (distutils.version.LooseVersion(v), key[1])
+ return (packaging.version.Version(v), key[1])
3 changes: 2 additions & 1 deletion gvsbuild/projects/glib.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def __init__(self):
"pcre2",
],
patches=[
"glib-package-installation-directory.patch",
"001-glib-package-installation-directory.patch",
"002-python-312-distutils-to-packaging.patch",
],
)
self.add_param("-Dman=false")
Expand Down

0 comments on commit bad88d4

Please sign in to comment.