head 1.10; access; symbols pkgsrc-2013Q2:1.10.0.10 pkgsrc-2013Q2-base:1.10 pkgsrc-2012Q4:1.10.0.8 pkgsrc-2012Q4-base:1.10 pkgsrc-2011Q4:1.10.0.6 pkgsrc-2011Q4-base:1.10 pkgsrc-2011Q2:1.10.0.4 pkgsrc-2011Q2-base:1.10 pkgsrc-2009Q4:1.10.0.2 pkgsrc-2009Q4-base:1.10 pkgsrc-2008Q4:1.9.0.34 pkgsrc-2008Q4-base:1.9 pkgsrc-2008Q3:1.9.0.32 pkgsrc-2008Q3-base:1.9 cube-native-xorg:1.9.0.30 cube-native-xorg-base:1.9 pkgsrc-2008Q2:1.9.0.28 pkgsrc-2008Q2-base:1.9 cwrapper:1.9.0.26 pkgsrc-2008Q1:1.9.0.24 pkgsrc-2008Q1-base:1.9 pkgsrc-2007Q4:1.9.0.22 pkgsrc-2007Q4-base:1.9 pkgsrc-2007Q3:1.9.0.20 pkgsrc-2007Q3-base:1.9 pkgsrc-2007Q2:1.9.0.18 pkgsrc-2007Q2-base:1.9 pkgsrc-2007Q1:1.9.0.16 pkgsrc-2007Q1-base:1.9 pkgsrc-2006Q4:1.9.0.14 pkgsrc-2006Q4-base:1.9 pkgsrc-2006Q3:1.9.0.12 pkgsrc-2006Q3-base:1.9 pkgsrc-2006Q2:1.9.0.10 pkgsrc-2006Q2-base:1.9 pkgsrc-2006Q1:1.9.0.8 pkgsrc-2006Q1-base:1.9 pkgsrc-2005Q4:1.9.0.6 pkgsrc-2005Q4-base:1.9 pkgsrc-2005Q3:1.9.0.4 pkgsrc-2005Q3-base:1.9 pkgsrc-2005Q2:1.9.0.2 pkgsrc-2005Q2-base:1.9 pkgsrc-2005Q1:1.5.0.8 pkgsrc-2005Q1-base:1.5 pkgsrc-2004Q4:1.5.0.6 pkgsrc-2004Q4-base:1.5 pkgsrc-2004Q3:1.5.0.4 pkgsrc-2004Q3-base:1.5 pkgsrc-2004Q2:1.5.0.2 pkgsrc-2004Q2-base:1.5 pkgsrc-2004Q1:1.4.0.12 pkgsrc-2004Q1-base:1.4 pkgsrc-2003Q4:1.4.0.10 pkgsrc-2003Q4-base:1.4 netbsd-1-6-1:1.4.0.6 netbsd-1-6-1-base:1.4 netbsd-1-6:1.4.0.8 netbsd-1-6-RELEASE-base:1.4 pkgviews:1.4.0.4 pkgviews-base:1.4 buildlink2:1.4.0.2 buildlink2-base:1.4 netbsd-1-5-PATCH003:1.4; locks; strict; comment @# @; 1.10 date 2009.02.09.21.09.21; author joerg; state dead; branches; next 1.9; 1.9 date 2005.05.29.08.41.34; author minskim; state Exp; branches; next 1.8; 1.8 date 2005.05.29.08.03.25; author minskim; state Exp; branches; next 1.7; 1.7 date 2005.05.29.07.35.54; author minskim; state Exp; branches; next 1.6; 1.6 date 2005.05.29.06.39.12; author minskim; state Exp; branches; next 1.5; 1.5 date 2004.05.16.20.01.59; author minskim; state Exp; branches; next 1.4; 1.4 date 2002.04.09.04.23.23; author jlam; state Exp; branches; next 1.3; 1.3 date 2002.04.09.04.14.41; author jlam; state Exp; branches; next 1.2; 1.2 date 2002.01.28.09.09.16; author drochner; state Exp; branches; next 1.1; 1.1 date 2002.01.22.13.05.05; author drochner; state Exp; branches; next ; desc @@ 1.10 log @Remove Python 2.1 support. @ text @$NetBSD: patch-ac,v 1.9 2005/05/29 08:41:34 minskim Exp $ --- setup.py.orig 2001-12-27 15:51:02.000000000 -0600 +++ setup.py @@@@ -14,7 +14,7 @@@@ from distutils.core import Extension, se from distutils.command.build_ext import build_ext # 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 find_file(filename, std_dirs, paths): """Searches for the directory where a given file is located, @@@@ -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): @@@@ -322,19 +323,6 @@@@ class PyBuildExt(build_ext): # implementation independent wrapper for these; dumbdbm.py provides # similar functionality (but slower of course) implemented in Python. - # The standard Unix dbm module: - if platform not in ['cygwin']: - if (self.compiler.find_library_file(lib_dirs, 'ndbm')): - exts.append( Extension('dbm', ['dbmmodule.c'], - libraries = ['ndbm'] ) ) - else: - 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'] ) ) - # Berkeley DB interface. # # This requires the Berkeley DB code, see @@@@ -346,16 +334,20 @@@@ class PyBuildExt(build_ext): # (See http://electricrain.com/greg/python/bsddb3/ for an interface to # BSD DB 3.x.) + bdb_type = os.environ['PY_BDB_TYPE'] + dblib_dir = [os.environ['PY_BDB_LIBDIRS']] dblib = [] - if self.compiler.find_library_file(lib_dirs, 'db'): + if self.compiler.find_library_file(dblib_dir, 'db'): dblib = ['db'] + elif self.compiler.find_library_file(dblib_dir, bdb_type): + dblib = [bdb_type] - db185_incs = find_file('db_185.h', inc_dirs, - ['/usr/include/db3', '/usr/include/db2']) - db_inc = find_file('db.h', inc_dirs, ['/usr/include/db1']) - if db185_incs is not None: + db_inc = [os.environ['PY_BDB_INCDIRS']] + if bdb_type in ['db2', 'db3', 'db4']: exts.append( Extension('bsddb', ['bsddbmodule.c'], - include_dirs = db185_incs, + include_dirs = db_inc, + library_dirs = dblib_dir, + runtime_library_dirs = dblib_dir, define_macros=[('HAVE_DB_185_H',1)], libraries = dblib ) ) elif db_inc is not None: @@@@ -363,6 +355,36 @@@@ class PyBuildExt(build_ext): include_dirs = db_inc, libraries = dblib) ) + # The standard Unix dbm module: + if platform not in ['cygwin']: + if find_file("ndbm.h", inc_dirs, []) is not None: + if (self.compiler.find_library_file(lib_dirs, 'ndbm')): + ndbm_libs = ['ndbm'] + else: + ndbm_libs = [] + exts.append( Extension('dbm', ['dbmmodule.c'], + libraries = ndbm_libs ) ) + elif find_file("ndbm.h", db_inc, []) is not None: + exts.append( Extension('dbm', ['dbmmodule.c'], + library_dirs=dblib_dir, + runtime_library_dirs=dblib_dir, + include_dirs=db_inc, + define_macros=[('HAVE_NDBM_H',None)], + libraries=dblib)) + elif db_inc is not None: + exts.append( Extension('dbm', ['dbmmodule.c'], + library_dirs=dblib_dir, + runtime_library_dirs=dblib_dir, + include_dirs=db_inc, + define_macros=[('HAVE_BERKDB_H',None), + ('DB_DBM_HSEARCH',None)], + libraries=dblib)) + + # 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'] ) ) + # The mpz module interfaces to the GNU Multiple Precision library. # You need to ftp the GNU MP library. # This was originally written and tested against GMP 1.2 and 1.3.2. @@@@ -408,8 +430,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 +439,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 +473,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 +615,7 @@@@ def main(): ext_modules=[Extension('struct', ['structmodule.c'])], # Scripts to install - scripts = ['Tools/scripts/pydoc'] + scripts = ['Tools/scripts/pydoc2.1'] ) # --install-platlib @ 1.9 log @Make the dbm module build when pkgsrc bdb is used. @ text @d1 1 a1 1 $NetBSD$ @ 1.8 log @Make the bsddb module build when pkgsrc bdb is used. @ text @d71 21 a91 1 @@@@ -346,16 +347,20 @@@@ class PyBuildExt(build_ext): d118 38 a155 1 @@@@ -408,8 +413,8 @@@@ class PyBuildExt(build_ext): d166 1 a166 1 @@@@ -417,8 +422,8 @@@@ class PyBuildExt(build_ext): d177 1 a177 1 @@@@ -451,23 +456,7 @@@@ class PyBuildExt(build_ext): d202 1 a202 1 @@@@ -609,7 +598,7 @@@@ def main(): @ 1.7 log @Explicitly disable modules that should not be built. @ text @d71 28 a98 1 @@@@ -408,8 +409,8 @@@@ class PyBuildExt(build_ext): d109 1 a109 1 @@@@ -417,8 +418,8 @@@@ class PyBuildExt(build_ext): d120 1 a120 1 @@@@ -451,23 +452,7 @@@@ class PyBuildExt(build_ext): d145 1 a145 1 @@@@ -609,7 +594,7 @@@@ def main(): @ 1.6 log @Explicitly disable the tkinter module, which is provided by x11/py-Tk. @ text @d5 9 a117 9 @@@@ -515,7 +500,7 @@@@ class PyBuildExt(build_ext): self.extensions.extend(exts) # Call the method for detecting whether _tkinter can be compiled - self.detect_tkinter(inc_dirs, lib_dirs) + #self.detect_tkinter(inc_dirs, lib_dirs) def detect_tkinter(self, inc_dirs, lib_dirs): @ 1.5 log @Build python module for zlib unconditionally. This makes python2[12]{,-pth} build on platforms where zlib.h is not in /usr/include. @ text @d109 9 @ 1.4 log @Uses spaces instead of tabs to match the rest of the file (not sure if it matters, and I don't want to chance it). @ text @d1 1 a1 1 $NetBSD: patch-ac,v 1.3 2002/04/09 04:14:41 jlam Exp $ d3 1 a3 1 --- setup.py.orig Thu Dec 27 16:51:02 2001 d5 1 a5 1 @@@@ -145,11 +145,16 @@@@ d27 1 a27 1 @@@@ -265,13 +270,13 @@@@ d45 1 a45 1 @@@@ -296,14 +301,10 @@@@ d62 1 a62 1 @@@@ -408,8 +409,8 @@@@ d73 1 a73 1 @@@@ -417,8 +418,8 @@@@ d84 26 a109 1 @@@@ -609,7 +610,7 @@@@ @ 1.3 log @Teach the extension building process about buildlink, and allow passing LDFLAGS to the linker command when linking a python extension. This lets us pass the right flags to correctly find libraries required for certain extensions, e.g. zlib.so. Also explicitly comment out a few extensions that aren't being built and should never be. @ text @d1 1 a1 1 $NetBSD$ d15 1 a15 1 + if os.environ.has_key('BUILDLINK_DIR'): @ 1.2 log @don't build curses module - it doesn't work with our curses @ text @d3 25 a27 3 --- setup.py.orig Thu Dec 27 22:51:02 2001 +++ setup.py Sun Jan 27 15:53:18 2002 @@@@ -265,13 +265,13 @@@@ d45 29 a73 1 @@@@ -417,8 +417,8 @@@@ d84 1 a84 1 @@@@ -609,7 +609,7 @@@@ @ 1.1 log @-update to 2.1.2 - except one method addition (socket.sendall()) this is a pure bugfix release -install the "pydoc" script as "pydoc2.1" and make sure the corresponding python version is used -disable the audioop, imageop and rgbimg extensions - these don't work on 64-bit platforms anyway, I haven't seen a place where they are used yet, and in case a need shows up, we better make an own extension pkg from it which is marked FOR_PLATFORM_ONLY @ text @d4 1 a4 1 +++ setup.py Tue Jan 22 11:11:35 2002 d23 11 @