File: fix-distutils-under-Python-3.11.patch

package info (click to toggle)
jhbuild 3.38.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,640 kB
  • sloc: python: 11,621; sh: 4,548; makefile: 204; ansic: 19; sed: 16
file content (30 lines) | stat: -rw-r--r-- 1,158 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From: Max Schmitt <max@schmitt.mx>
Date: Tue, 18 Jul 2023 16:34:14 +0200
Subject: fix(distutils): under Python 3.11

(cherry picked from commit d0bacd28674ffac7db775804e8d96059da50f80e)
---
 jhbuild/modtypes/distutils.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/jhbuild/modtypes/distutils.py b/jhbuild/modtypes/distutils.py
index 99e13c9..4b69c32 100644
--- a/jhbuild/modtypes/distutils.py
+++ b/jhbuild/modtypes/distutils.py
@@ -80,6 +80,16 @@ class DistutilsModule(Package, DownloadableModule):
         self.process_install(buildscript, self.get_revision())
     do_install.depends = [PHASE_BUILD]
 
+    @property
+    def extra_env(self):
+        return {
+            **(super().extra_env or {}),
+            # Setuptools v60+ changes the way it builds wheels (prefix/local/lib)
+            # See https://github.com/pypa/setuptools/issues/2896
+            # See https://gitlab.gnome.org/GNOME/jhbuild/-/issues/286
+            'SETUPTOOLS_USE_DISTUTILS': 'stdlib',
+        }
+
     def xml_tag_and_attrs(self):
         return 'distutils', [('id', 'name', None),
                              ('supports-non-srcdir-builds',