summaryrefslogtreecommitdiffstats
path: root/python/python3-pygame/setup.patch
blob: c8c0782f792a39f454c12d25f6b3638fd4ec43cc (plain)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- pygame-2.5.2/setup.orig	2024-01-06 19:06:26.065813273 +0200
+++ pygame-2.5.2/setup.py	2024-01-06 19:29:38.623909698 +0200
@@ -7,6 +7,7 @@
 #     python setup.py install
 
 import glob
+import distro
 import platform
 import sysconfig
 
@@ -125,7 +126,7 @@
     distutils.ccompiler.CCompiler.spawn = spawn
 
 # A (bit hacky) fix for https://github.com/pygame/pygame/issues/2613
-# This is due to the fact that distutils uses command line args to 
+# This is due to the fact that distutils uses command line args to
 # export PyInit_* functions on windows, but those functions are already exported
 # and that is why compiler gives warnings
 from distutils.command.build_ext import build_ext
@@ -140,12 +141,10 @@
     """
     the_system = platform.system()
     if the_system == 'Linux':
-        if hasattr(platform, 'linux_distribution'):
-            distro = platform.linux_distribution()
-            if distro[0].lower() == 'ubuntu':
-                the_system = 'Ubuntu'
-            elif distro[0].lower() == 'debian':
-                the_system = 'Debian'
+        if distro.name().lower() == 'ubuntu':
+            the_system = 'Ubuntu'
+        elif distro.name().lower() == 'slackware':
+            the_system = 'Slackware'
 
     help_urls = {
         'Linux': 'https://www.pygame.org/wiki/Compilation',
@@ -299,7 +298,7 @@
     for i, kwargs in enumerate(queue):
         kwargs['progress'] = f'[{i + 1}/{count}] '
         cythonize_one(**kwargs)
-    
+
     if cython_only:
         sys.exit(0)
 
@@ -458,7 +457,7 @@
 
     if "freetype" in e.name and sys.platform not in ("darwin", "win32"):
         # TODO: fix freetype issues here
-        if sysconfig.get_config_var("MAINCC") != "clang":        
+        if sysconfig.get_config_var("MAINCC") != "clang":
             e.extra_compile_args.append("-Wno-error=unused-but-set-variable")
 
     if "mask" in e.name and sys.platform == "win32":