summarylogtreecommitdiffstats
path: root/0020-MINGW-exclude-unix-only-modules.patch
blob: 233bfbf862498f7c54ce774908106f53209d93eb (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
From 43127485a0b9ef0e6eb88436cbd3691114203324 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
 <alexey.pawlow@gmail.com>
Date: Thu, 17 Jun 2021 18:51:31 +0530
Subject: [PATCH 020/N] MINGW exclude unix only modules
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Co-authored-by: Алексей <alexey.pawlow@gmail.com>
---
 setup.py | 41 +++++++++++++++++++++++++++++------------
 1 file changed, 29 insertions(+), 12 deletions(-)

diff --git a/setup.py b/setup.py
index c8242ac..f317bf3 100644
--- a/setup.py
+++ b/setup.py
@@ -889,13 +889,21 @@ 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 MS_WINDOWS:
+            self.add(Extension('fcntl', ['fcntlmodule.c'],
+                               libraries=libs))
+        else:
+            self.missing.append('fcntl')
         # pwd(3)
-        self.add(Extension('pwd', ['pwdmodule.c']))
+        if not MS_WINDOWS:
+            self.add(Extension('pwd', ['pwdmodule.c']))
+        else:
+            self.missing.append('pwd')
         # grp(3)
-        if not VXWORKS:
+        if not VXWORKS and not MS_WINDOWS:
             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)):
@@ -920,7 +928,10 @@ class PyBuildExt(build_ext):
 
         # Lance Ellinghaus's syslog module
         # syslog daemon interface
-        self.add(Extension('syslog', ['syslogmodule.c']))
+        if not MS_WINDOWS:
+            self.add(Extension('syslog', ['syslogmodule.c']))
+        else:
+            self.missing.append('syslog')
 
         # Python interface to subinterpreter C-API.
         self.add(Extension('_xxsubinterpreters', ['_xxsubinterpretersmodule.c']))
@@ -946,7 +957,10 @@ class PyBuildExt(build_ext):
         self.add(Extension('_csv', ['_csv.c']))
 
         # POSIX subprocess module helper.
-        self.add(Extension('_posixsubprocess', ['_posixsubprocess.c']))
+        if not MS_WINDOWS:
+            self.add(Extension('_posixsubprocess', ['_posixsubprocess.c']))
+        else:
+            self.missing.append('_posixsubprocess')
 
     def detect_test_extensions(self):
         # Python C API test module
@@ -1128,13 +1142,16 @@ class PyBuildExt(build_ext):
             # the encryption.
             return
 
-        if self.compiler.find_library_file(self.lib_dirs, 'crypt'):
-            libs = ['crypt']
-        else:
-            libs = []
+        if not MS_WINDOWS:
+            if self.compiler.find_library_file(self.lib_dirs, 'crypt'):
+                libs = ['crypt']
+            else:
+                libs = []
 
-        self.add(Extension('_crypt', ['_cryptmodule.c'],
-                               libraries=libs))
+            self.add(Extension('_crypt', ['_cryptmodule.c'],
+                                   libraries=libs))
+        else:
+            self.missing.append('_crypt')
 
     def detect_socket(self):
         # socket(2)
-- 
2.33.0