Sophie

Sophie

distrib > Mageia > 9 > armv7hl > media > core-release-src > by-pkgid > d8c679353daa984effd8ef75a56451e3 > files > 7

mingw-python3-3.10.9-1.mga9.src.rpm

diff -rupN --no-dereference Python-3.10.9/Modules/Setup Python-3.10.9-new/Modules/Setup
--- Python-3.10.9/Modules/Setup	2022-12-08 09:36:59.937024874 +0100
+++ Python-3.10.9-new/Modules/Setup	2022-12-08 09:36:59.942024874 +0100
@@ -103,8 +103,6 @@ PYTHONPATH=$(COREPYTHONPATH)
 
 posix -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal posixmodule.c # posix (UNIX) system calls
 errno errnomodule.c			# posix (UNIX) errno values
-pwd pwdmodule.c				# this is needed to find out the user's home dir
-					# if $HOME is not set
 _sre -DPy_BUILD_CORE_BUILTIN _sre.c	# Fredrik Lundh's new regular expressions
 _codecs _codecsmodule.c			# access to the builtin codecs and codec registry
 _weakref _weakref.c			# weak references
diff -rupN --no-dereference Python-3.10.9/setup.py Python-3.10.9-new/setup.py
--- Python-3.10.9/setup.py	2022-12-08 09:36:59.938024874 +0100
+++ Python-3.10.9-new/setup.py	2022-12-08 09:36:59.943024874 +0100
@@ -990,13 +990,22 @@ class PyBuildExt(build_ext):
         if (self.config_h_vars.get('FLOCK_NEEDS_LIBBSD', False)):
             # May be necessary on AIX for flock function
             libs = ['bsd']
-        self.add(Extension('fcntl', ['fcntlmodule.c'],
-                           libraries=libs))
+        if not HOST_PLATFORM.startswith(('mingw', 'win')):
+            self.add(Extension('fcntl', ['fcntlmodule.c'],
+                               libraries=libs))
+        else:
+            self.missing.append('fcntl')
         # pwd(3)
-        self.add(Extension('pwd', ['pwdmodule.c']))
+        if not HOST_PLATFORM.startswith(('mingw', 'win')):
+            self.add(Extension('pwd', ['pwdmodule.c']))
+        else:
+            self.missing.append('pwd')
         # grp(3)
         if not VXWORKS:
-            self.add(Extension('grp', ['grpmodule.c']))
+            if not HOST_PLATFORM.startswith(('mingw', 'win')):
+                self.add(Extension('grp', ['grpmodule.c']))
+            else:
+                self.missing.append('grp')
         # spwd, shadow passwords
         if (self.config_h_vars.get('HAVE_GETSPNAM', False) or
                 self.config_h_vars.get('HAVE_GETSPENT', False)):
@@ -1014,7 +1023,10 @@ class PyBuildExt(build_ext):
 
         # Lance Ellinghaus's syslog module
         # syslog daemon interface
-        self.add(Extension('syslog', ['syslogmodule.c']))
+        if not HOST_PLATFORM.startswith(('mingw', 'win')):
+            self.add(Extension('syslog', ['syslogmodule.c']))
+        else:
+            self.missing.append('syslog')
 
         # Python interface to subinterpreter C-API.
         self.add(Extension('_xxsubinterpreters', ['_xxsubinterpretersmodule.c']))
@@ -1040,8 +1052,12 @@ class PyBuildExt(build_ext):
         self.add(Extension('_csv', ['_csv.c']))
 
         # POSIX subprocess module helper.
-        self.add(Extension('_posixsubprocess', ['_posixsubprocess.c'],
+        if not HOST_PLATFORM.startswith(('mingw', 'win')):
+            self.add(Extension('_posixsubprocess', ['_posixsubprocess.c'],
                            extra_compile_args=['-DPy_BUILD_CORE_MODULE']))
+        else:
+            self.missing.append('_posixsubprocess')
+
 
     def detect_test_extensions(self):
         # Python C API test module
@@ -1080,8 +1096,10 @@ class PyBuildExt(build_ext):
                 readline_lib = 'edit'
             else:
                 readline_lib = 'readline'
-            do_readline = self.compiler.find_library_file(self.lib_dirs,
-                readline_lib)
+            if not HOST_PLATFORM.startswith(('mingw', 'win')):
+                do_readline = self.compiler.find_library_file(self.lib_dirs, readline_lib)
+            else:
+                do_readline = False
             if CROSS_COMPILING:
                 ret = run_command("%s -d %s | grep '(NEEDED)' > %s"
                                 % (sysconfig.get_config_var('READELF'),
@@ -1233,12 +1251,14 @@ class PyBuildExt(build_ext):
             self.missing.append('_crypt')
             return
 
-        if self.compiler.find_library_file(self.lib_dirs, 'crypt'):
-            libs = ['crypt']
+        if not HOST_PLATFORM.startswith(('mingw', 'win')):
+            if self.compiler.find_library_file(self.lib_dirs, 'crypt'):
+                libs = ['crypt']
+            else:
+                libs = []
+            self.add(Extension('_crypt', ['_cryptmodule.c'], libraries=libs))
         else:
-            libs = []
-
-        self.add(Extension('_crypt', ['_cryptmodule.c'], libraries=libs))
+            self.missing.append('_crypt')
 
     def detect_socket(self):
         # socket(2)
@@ -1486,7 +1506,7 @@ class PyBuildExt(build_ext):
             if dbm_args:
                 dbm_order = [arg.split('=')[-1] for arg in dbm_args][-1].split(":")
             else:
-                dbm_order = "ndbm:gdbm:bdb".split(":")
+                dbm_order = []
             dbmext = None
             for cand in dbm_order:
                 if cand == "ndbm":
@@ -1674,7 +1694,7 @@ class PyBuildExt(build_ext):
 
     def detect_platform_specific_exts(self):
         # Unix-only modules
-        if not MS_WINDOWS:
+        if not HOST_PLATFORM.startswith(('mingw', 'win')):
             if not VXWORKS:
                 # Steen Lumholt's termios module
                 self.add(Extension('termios', ['termios.c']))