summaryrefslogtreecommitdiff
path: root/lang/python22/patches/patch-aa
blob: 57a8cbe201a916eba0b419816eb7b4fe95b4ca19 (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
$NetBSD: patch-aa,v 1.8 2004/05/16 20:01:59 minskim Exp $

--- setup.py.orig	2003-05-22 12:36:54.000000000 -0500
+++ setup.py
@@ -210,11 +210,15 @@ class PyBuildExt(build_ext):
         return platform
 
     def detect_modules(self):
-        # Ensure that /usr/local is always used
-        if '/usr/local/lib' not in self.compiler.library_dirs:
-            self.compiler.library_dirs.insert(0, '/usr/local/lib')
-        if '/usr/local/include' not in self.compiler.include_dirs:
-            self.compiler.include_dirs.insert(0, '/usr/local/include' )
+        # Add the buildlink directories for pkgsrc
+        if os.environ.has_key('BUILDLINK_DIR'):
+            dir = os.environ['BUILDLINK_DIR']
+            libdir = dir + '/lib'
+            incdir = dir + '/include'
+            if libdir not in self.compiler.library_dirs:
+                self.compiler.library_dirs.insert(0, libdir)
+            if incdir not in self.compiler.include_dirs:
+                self.compiler.include_dirs.insert(0, incdir)
 
         try:
             have_unicode = unicode
@@ -274,7 +278,7 @@ class PyBuildExt(build_ext):
         if have_unicode:
             exts.append( Extension('unicodedata', ['unicodedata.c']) )
         # access to ISO C locale support
-        exts.append( Extension('_locale', ['_localemodule.c']) )
+#        exts.append( Extension('_locale', ['_localemodule.c']) )
 
         # Modules with some UNIX dependencies -- on by default:
         # (If you have a really backward UNIX, select and socket may not be
@@ -330,16 +334,16 @@ class PyBuildExt(build_ext):
         # These represent audio samples or images as strings:
 
         # Disabled on 64-bit platforms
-        if sys.maxint != 9223372036854775807L:
+#        if sys.maxint != 9223372036854775807L:
             # Operations on audio samples
-            exts.append( Extension('audioop', ['audioop.c']) )
+#            exts.append( Extension('audioop', ['audioop.c']) )
             # Operations on images
-            exts.append( Extension('imageop', ['imageop.c']) )
+#            exts.append( Extension('imageop', ['imageop.c']) )
             # Read SGI RGB image files (but coded portably)
-            exts.append( Extension('rgbimg', ['rgbimgmodule.c']) )
+#            exts.append( Extension('rgbimg', ['rgbimgmodule.c']) )
 
         # readline
-        if self.compiler.find_library_file(lib_dirs, 'readline'):
+        if 0 and self.compiler.find_library_file(lib_dirs, 'readline'):
             readline_libs = ['readline']
             if self.compiler.find_library_file(lib_dirs,
                                                  'ncurses'):
@@ -363,14 +367,10 @@ class PyBuildExt(build_ext):
         # socket(2)
         # Detect SSL support for the socket module
         ssl_incs = find_file('openssl/ssl.h', inc_dirs,
-                             ['/usr/local/ssl/include',
-                              '/usr/contrib/ssl/include/'
-                             ]
+                             []
                              )
         ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
-                                     ['/usr/local/ssl/lib',
-                                      '/usr/contrib/ssl/lib/'
-                                     ] )
+                                     [] )
 
         if ssl_incs is not None:
             krb5_h = find_file('krb5.h', inc_dirs,
@@ -413,9 +413,9 @@ class PyBuildExt(build_ext):
                 exts.append( Extension('dbm', ['dbmmodule.c']) )
 
         # Anthony Baxter's gdbm module.  GNU dbm(3) will require -lgdbm:
-        if (self.compiler.find_library_file(lib_dirs, 'gdbm')):
-            exts.append( Extension('gdbm', ['gdbmmodule.c'],
-                                   libraries = ['gdbm'] ) )
+        #if (self.compiler.find_library_file(lib_dirs, 'gdbm')):
+        #    exts.append( Extension('gdbm', ['gdbmmodule.c'],
+        #                           libraries = ['gdbm'] ) )
 
         # Berkeley DB interface.
         #
@@ -469,9 +469,9 @@ class PyBuildExt(build_ext):
         # FTP archive sites. One URL for it is:
         # ftp://gatekeeper.dec.com/.b/usenet/comp.sources.misc/volume40/fgmp/part01.Z
 
-        if (self.compiler.find_library_file(lib_dirs, 'gmp')):
-            exts.append( Extension('mpz', ['mpzmodule.c'],
-                                   libraries = ['gmp'] ) )
+        #if (self.compiler.find_library_file(lib_dirs, 'gmp')):
+        #    exts.append( Extension('mpz', ['mpzmodule.c'],
+        #                           libraries = ['gmp'] ) )
 
 
         # Unix-only modules
@@ -498,8 +498,8 @@ class PyBuildExt(build_ext):
 
         if (self.compiler.find_library_file(lib_dirs, 'ncurses')):
             curses_libs = ['ncurses']
-            exts.append( Extension('_curses', ['_cursesmodule.c'],
-                                   libraries = curses_libs) )
+#            exts.append( Extension('_curses', ['_cursesmodule.c'],
+#                                   libraries = curses_libs) )
         elif (self.compiler.find_library_file(lib_dirs, 'curses')
               and platform != 'darwin'):
                 # OSX has an old Berkeley curses, not good enough for
@@ -509,8 +509,8 @@ class PyBuildExt(build_ext):
             else:
                 curses_libs = ['curses', 'termcap']
 
-            exts.append( Extension('_curses', ['_cursesmodule.c'],
-                                   libraries = curses_libs) )
+#            exts.append( Extension('_curses', ['_cursesmodule.c'],
+#                                   libraries = curses_libs) )
 
         # If the curses module is enabled, check for the panel module
         if (module_enabled(exts, '_curses') and
@@ -544,23 +544,7 @@ class PyBuildExt(build_ext):
         # Andrew Kuchling's zlib module.
         # This require zlib 1.1.3 (or later).
         # See http://www.cdrom.com/pub/infozip/zlib/
-        zlib_inc = find_file('zlib.h', [], inc_dirs)
-        if zlib_inc is not None:
-            zlib_h = zlib_inc[0] + '/zlib.h'
-            version = '"0.0.0"'
-            version_req = '"1.1.3"'
-            fp = open(zlib_h)
-            while 1:
-                line = fp.readline()
-                if not line:
-                    break
-                if line.find('#define ZLIB_VERSION', 0) == 0:
-                    version = line.split()[2]
-                    break
-            if version >= version_req:
-                if (self.compiler.find_library_file(lib_dirs, 'z')):
-                    exts.append( Extension('zlib', ['zlibmodule.c'],
-                                           libraries = ['z']) )
+        exts.append(Extension('zlib', ['zlibmodule.c'], libraries = ['z']))
 
         # Interface to the Expat XML parser
         #
@@ -581,11 +565,11 @@ class PyBuildExt(build_ext):
         else:
             expat_incs = find_file('xmlparse.h', inc_dirs, [])
 
-        if (expat_incs is not None and
-            self.compiler.find_library_file(lib_dirs, 'expat')):
-            exts.append( Extension('pyexpat', ['pyexpat.c'],
-                                   define_macros = expat_defs,
-                                   libraries = ['expat']) )
+        #if (expat_incs is not None and
+        #    self.compiler.find_library_file(lib_dirs, 'expat')):
+        #    exts.append( Extension('pyexpat', ['pyexpat.c'],
+        #                           define_macros = expat_defs,
+        #                           libraries = ['expat']) )
 
         # Platform-specific libraries
         if platform == 'linux2':
@@ -808,7 +792,7 @@ def main():
           ext_modules=[Extension('struct', ['structmodule.c'])],
 
           # Scripts to install
-          scripts = ['Tools/scripts/pydoc']
+          scripts = ['Tools/scripts/pydoc2.2']
         )
 
 # --install-platlib