33baa81356
python2[12]{,-pth} build on platforms where zlib.h is not in /usr/include.
117 lines
5.2 KiB
Text
117 lines
5.2 KiB
Text
$NetBSD: patch-ac,v 1.5 2004/05/16 20:01:59 minskim Exp $
|
|
|
|
--- setup.py.orig 2001-12-27 15:51:02.000000000 -0600
|
|
+++ setup.py
|
|
@@ -145,11 +145,16 @@ 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)
|
|
+
|
|
|
|
# lib_dirs and inc_dirs are used to search for files;
|
|
# if a file is found in one of those directories, it can
|
|
@@ -265,13 +270,13 @@ 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'):
|
|
@@ -296,14 +301,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 and
|
|
ssl_libs is not None):
|
|
@@ -408,8 +409,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[:6] != 'darwin':
|
|
# OSX has an old Berkeley curses, not good enough for the _curses module.
|
|
if (self.compiler.find_library_file(lib_dirs, 'terminfo')):
|
|
@@ -417,8 +418,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 (os.path.exists('Modules/_curses_panel.c') and
|
|
@@ -451,23 +452,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
|
|
#
|
|
@@ -609,7 +594,7 @@ def main():
|
|
ext_modules=[Extension('struct', ['structmodule.c'])],
|
|
|
|
# Scripts to install
|
|
- scripts = ['Tools/scripts/pydoc']
|
|
+ scripts = ['Tools/scripts/pydoc2.1']
|
|
)
|
|
|
|
# --install-platlib
|