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
|
$NetBSD: patch-am,v 1.4 2004/03/22 06:33:58 minskim Exp $
--- setup.py.orig 2003-10-21 15:01:21.000000000 -0500
+++ setup.py
@@ -15,7 +15,7 @@ from distutils.command.install import in
from distutils.command.install_lib import install_lib
# This global variable is used to hold the list of modules to be disabled.
-disabled_module_list = []
+disabled_module_list = ["_bsddb", "_curses", "_curses_panel", "_tkinter", "gdbm", "mpz", "pyexpat", "readline"]
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
@@ -240,9 +240,15 @@ class PyBuildExt(build_ext):
return sys.platform
def detect_modules(self):
- # Ensure that /usr/local is always used
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
- add_dir_to_list(self.compiler.include_dirs, '/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)
# fink installs lots of goodies in /sw/... - make sure we
# check there
@@ -436,9 +442,7 @@ class PyBuildExt(build_ext):
depends = ['socketmodule.h']) )
# Detect SSL support for the socket module (via _ssl)
ssl_incs = find_file('openssl/ssl.h', inc_dirs,
- ['/usr/local/ssl/include',
- '/usr/contrib/ssl/include/'
- ]
+ []
)
if ssl_incs is not None:
krb5_h = find_file('krb5.h', inc_dirs,
@@ -446,9 +450,7 @@ class PyBuildExt(build_ext):
if krb5_h:
ssl_incs += krb5_h
ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
- ['/usr/local/ssl/lib',
- '/usr/contrib/ssl/lib/'
- ] )
+ [] )
if (ssl_incs is not None and
ssl_libs is not None):
@@ -515,6 +517,7 @@ class PyBuildExt(build_ext):
'/usr/include/db3',
)},
}
+ db_try_this = {}
db_search_order = db_try_this.keys()
db_search_order.sort()
@@ -562,9 +565,11 @@ class PyBuildExt(build_ext):
include_dirs=db_incs,
libraries=dblibs))
else:
- db_incs = None
- dblibs = []
- dblib_dir = None
+ db_incs =['%%DB185_INCS%%']
+ dblibs = ['%%DB185_LIBS%%']
+ dblib_dir = ['%%DB185_LIBDIR%%']
+ if len(dblibs) > 0 and dblibs[0] == '':
+ dblibs = []
# Look for Berkeley db 1.85. Note that it is built as a different
@@ -573,21 +578,30 @@ class PyBuildExt(build_ext):
# accidentally building this module with a later version of the
# underlying db library. May BSD-ish Unixes incorporate db 1.85
# symbols into libc and place the include file in /usr/include.
- f = "/usr/include/db.h"
+ f = "%%DB185_H%%"
if os.path.exists(f):
data = open(f).read()
m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
if m is not None:
+ bsddb185_define_macros = []
+ if f.split("/")[-1] == "db_185.h":
+ bsddb185_define_macros=[('HAVE_DB_185_H',1)]
# bingo - old version used hash file format version 2
### XXX this should be fixed to not be platform-dependent
### but I don't have direct access to an osf1 platform and
### seemed to be muffing the search somehow
- libraries = platform == "osf1" and ['db'] or None
+ #libraries = platform == "osf1" and ['db'] or None
+ libraries = dblibs
if libraries is not None:
exts.append(Extension('bsddb185', ['bsddbmodule.c'],
+ library_dirs=dblib_dir,
+ runtime_library_dirs=dblib_dir,
+ include_dirs=db_incs,
+ define_macros=bsddb185_define_macros,
libraries=libraries))
else:
- exts.append(Extension('bsddb185', ['bsddbmodule.c']))
+ exts.append(Extension('bsddb185', ['bsddbmodule.c'],
+ define_macros=bsddb185_define_macros))
# The standard Unix dbm module:
if platform not in ['cygwin']:
@@ -770,7 +784,7 @@ class PyBuildExt(build_ext):
# Linux-specific modules
exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
- if platform in ('linux2', 'freebsd4'):
+ if platform in ('linux2', 'freebsd4', 'freebsd5'):
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
if platform == 'sunos5':
@@ -1140,7 +1154,7 @@ def main():
ext_modules=[Extension('struct', ['structmodule.c'])],
# Scripts to install
- scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle']
+ scripts = ['Tools/scripts/pydoc2.3']
)
# --install-platlib
|