eaa3c34823
Thanks a lot to landry@, fgsch@ for feedback. Need tests before doing this version the default.
177 lines
7.4 KiB
Plaintext
177 lines
7.4 KiB
Plaintext
$OpenBSD: patch-setup_py,v 1.1.1.1 2011/04/24 09:31:44 rpointel Exp $
|
|
--- setup.py.orig Sun Oct 31 17:40:21 2010
|
|
+++ setup.py Sat Apr 23 13:48:23 2011
|
|
@@ -23,6 +23,11 @@
|
|
# This global variable is used to hold the list of modules to be disabled.
|
|
disabled_module_list = []
|
|
|
|
+def usrlocal(p):
|
|
+ return os.path.join(os.environ['LOCALBASE'], p)
|
|
+def usrx11r6(p):
|
|
+ return os.path.join(os.environ['X11BASE'], p)
|
|
+
|
|
def add_dir_to_list(dirlist, dir):
|
|
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
|
|
1) 'dir' is not already in 'dirlist'
|
|
@@ -347,8 +352,8 @@
|
|
|
|
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_dir_to_list(self.compiler.library_dirs, usrlocal('lib'))
|
|
+ add_dir_to_list(self.compiler.include_dirs, usrlocal('include'))
|
|
|
|
# Add paths specified in the environment variables LDFLAGS and
|
|
# CPPFLAGS for header and library files.
|
|
@@ -680,8 +685,6 @@
|
|
depends = ['socketmodule.h']) )
|
|
# Detect SSL support for the socket module (via _ssl)
|
|
search_for_ssl_incs_in = [
|
|
- '/usr/local/ssl/include',
|
|
- '/usr/contrib/ssl/include/'
|
|
]
|
|
ssl_incs = find_file('openssl/ssl.h', inc_dirs,
|
|
search_for_ssl_incs_in
|
|
@@ -692,9 +695,7 @@
|
|
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):
|
|
@@ -793,7 +794,7 @@
|
|
# BerkeleyDB 4.6.x is not stable on many architectures.
|
|
arch = platform_machine()
|
|
if arch not in ('i386', 'i486', 'i586', 'i686',
|
|
- 'x86_64', 'ia64'):
|
|
+ 'x86_64', 'amd64', 'ia64'):
|
|
return False
|
|
return True
|
|
|
|
@@ -856,6 +857,7 @@
|
|
std_variants.append(os.path.join(dn, "db3.%d"%x))
|
|
|
|
db_inc_paths = std_variants + db_inc_paths
|
|
+ db_inc_paths = [ usrlocal('include/db4') ]
|
|
db_inc_paths = [p for p in db_inc_paths if os.path.exists(p)]
|
|
|
|
db_ver_inc_map = {}
|
|
@@ -919,6 +921,7 @@
|
|
db_incdir.replace("include", 'lib64'),
|
|
db_incdir.replace("include", 'lib'),
|
|
]
|
|
+ db_dirs_to_check = [usrlocal('lib/db4')]
|
|
|
|
if sys.platform != 'darwin':
|
|
db_dirs_to_check = filter(os.path.isdir, db_dirs_to_check)
|
|
@@ -941,6 +944,7 @@
|
|
# symlink to more general names?
|
|
for dblib in (('db-%d.%d' % db_ver),
|
|
('db%d%d' % db_ver),
|
|
+ ('db'),
|
|
('db%d' % db_ver[0])):
|
|
dblib_file = self.compiler.find_library_file(
|
|
db_dirs_to_check + lib_dirs, dblib )
|
|
@@ -988,6 +992,7 @@
|
|
'/usr/local/include/sqlite',
|
|
'/usr/local/include/sqlite3',
|
|
]
|
|
+ sqlite_inc_paths = [ usrlocal('include') ]
|
|
MIN_SQLITE_VERSION_NUMBER = (3, 0, 8)
|
|
MIN_SQLITE_VERSION = ".".join([str(x)
|
|
for x in MIN_SQLITE_VERSION_NUMBER])
|
|
@@ -1033,6 +1038,7 @@
|
|
os.path.join(sqlite_incdir, '..', '..', 'lib64'),
|
|
os.path.join(sqlite_incdir, '..', '..', 'lib'),
|
|
]
|
|
+ sqlite_dirs_to_check = [ usrlocal('lib') ]
|
|
sqlite_libfile = self.compiler.find_library_file(
|
|
sqlite_dirs_to_check + lib_dirs, 'sqlite3')
|
|
if sqlite_libfile:
|
|
@@ -1097,7 +1103,7 @@
|
|
sysroot = macosx_sdk_root()
|
|
f = os.path.join(sysroot, f[1:])
|
|
|
|
- if os.path.exists(f) and not db_incs:
|
|
+ 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:
|
|
@@ -1416,7 +1422,11 @@
|
|
libraries = []
|
|
|
|
elif platform.startswith('openbsd'):
|
|
- macros = dict()
|
|
+ macros = dict( # OpenBSD
|
|
+ HAVE_SEM_OPEN=0, # Not implemented
|
|
+ HAVE_SEM_TIMEDWAIT=0,
|
|
+ HAVE_FD_TRANSFER=1,
|
|
+ )
|
|
libraries = []
|
|
|
|
elif platform.startswith('netbsd'):
|
|
@@ -1464,6 +1474,9 @@
|
|
'freebsd7', 'freebsd8')
|
|
or platform.startswith("gnukfreebsd")):
|
|
exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) )
|
|
+ if platform.startswith('openbsd'):
|
|
+ exts.append( Extension('ossaudiodev', ['ossaudiodev.c'],
|
|
+ libraries = ['ossaudio'],) )
|
|
else:
|
|
missing.append('ossaudiodev')
|
|
|
|
@@ -1637,7 +1650,7 @@
|
|
# For 8.4a2, the X11 headers are not included. Rather than include a
|
|
# complicated search, this is a hard-coded path. It could bail out
|
|
# if X11 libs are not found...
|
|
- include_dirs.append('/usr/X11R6/include')
|
|
+ include_dirs.append(usrx11r6('include'))
|
|
frameworks = ['-framework', 'Tcl', '-framework', 'Tk']
|
|
|
|
# All existing framework builds of Tcl/Tk don't support 64-bit
|
|
@@ -1687,8 +1700,7 @@
|
|
# The versions with dots are used on Unix, and the versions without
|
|
# dots on Windows, for detection by cygwin.
|
|
tcllib = tklib = tcl_includes = tk_includes = None
|
|
- for version in ['8.6', '86', '8.5', '85', '8.4', '84', '8.3', '83',
|
|
- '8.2', '82', '8.1', '81', '8.0', '80']:
|
|
+ for version in ['85']:
|
|
tklib = self.compiler.find_library_file(lib_dirs,
|
|
'tk' + version)
|
|
tcllib = self.compiler.find_library_file(lib_dirs,
|
|
@@ -1731,17 +1743,9 @@
|
|
if platform == 'sunos5':
|
|
include_dirs.append('/usr/openwin/include')
|
|
added_lib_dirs.append('/usr/openwin/lib')
|
|
- elif os.path.exists('/usr/X11R6/include'):
|
|
- include_dirs.append('/usr/X11R6/include')
|
|
- added_lib_dirs.append('/usr/X11R6/lib64')
|
|
- added_lib_dirs.append('/usr/X11R6/lib')
|
|
- elif os.path.exists('/usr/X11R5/include'):
|
|
- include_dirs.append('/usr/X11R5/include')
|
|
- added_lib_dirs.append('/usr/X11R5/lib')
|
|
- else:
|
|
- # Assume default location for X11
|
|
- include_dirs.append('/usr/X11/include')
|
|
- added_lib_dirs.append('/usr/X11/lib')
|
|
+ elif True:
|
|
+ include_dirs.append(usrx11r6('include'))
|
|
+ added_lib_dirs.append(usrx11r6('lib'))
|
|
|
|
# If Cygwin, then verify that X is installed before proceeding
|
|
if platform == 'cygwin':
|
|
@@ -2045,7 +2049,7 @@
|
|
# Scripts to install
|
|
scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
|
|
'Tools/scripts/2to3',
|
|
- 'Lib/smtpd.py']
|
|
+ ]
|
|
)
|
|
|
|
# --install-platlib
|