summaryrefslogtreecommitdiff
path: root/lang/python24-pth/patches/patch-am
diff options
context:
space:
mode:
authorrecht <recht>2004-12-05 23:28:53 +0000
committerrecht <recht>2004-12-05 23:28:53 +0000
commit2410898826815db0bb0e8132fc64ea269f47ff9b (patch)
tree260182aa4b43715dcdaf7058b7770cea07e8c2af /lang/python24-pth/patches/patch-am
parentdb2dfe964ab42cc4ccc7380c81b9ad8a43c66cdd (diff)
downloadpkgsrc-2410898826815db0bb0e8132fc64ea269f47ff9b.tar.gz
initial import of Python 2.4 (threaded version)
Python is an interpreted, interactive, object-oriented programming language that combines remarkable power with very clear syntax. For an introduction to programming in Python you are referred to the Python Tutorial. The Python Library Reference documents built-in and standard types, constants, functions and modules. Finally, the Python Reference Manual describes the syntax and semantics of the core language in (perhaps too) much detail. Python's basic power can be extended with your own modules written in C or C++. On most systems such modules may be dynamically loaded. Python is also adaptable as an exten- sion language for existing applications. See the internal documentation for hints. This package has been compiled with support for threads.
Diffstat (limited to 'lang/python24-pth/patches/patch-am')
-rw-r--r--lang/python24-pth/patches/patch-am268
1 files changed, 268 insertions, 0 deletions
diff --git a/lang/python24-pth/patches/patch-am b/lang/python24-pth/patches/patch-am
new file mode 100644
index 00000000000..c2ea5501c66
--- /dev/null
+++ b/lang/python24-pth/patches/patch-am
@@ -0,0 +1,268 @@
+$NetBSD: patch-am,v 1.1.1.1 2004/12/05 23:28:55 recht Exp $
+
+--- setup.py.orig Sat Nov 13 12:13:34 2004
++++ 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
+@@ -238,9 +238,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)
+
+ # Add paths to popular package managers on OS X/darwin
+ if sys.platform == "darwin":
+@@ -452,9 +458,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,
+@@ -462,9 +466,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):
+@@ -491,113 +493,90 @@ class PyBuildExt(build_ext):
+
+ # when sorted in reverse order, keys for this dict must appear in the
+ # order you wish to search - e.g., search for db4 before db3
+- db_try_this = {
+- 'db4': {'libs': ('db-4.2', 'db42', 'db-4.1', 'db41', 'db-4.0', 'db4',),
+- 'libdirs': ('/usr/local/BerkeleyDB.4.2/lib',
+- '/usr/local/BerkeleyDB.4.1/lib',
+- '/usr/local/BerkeleyDB.4.0/lib',
+- '/usr/local/lib',
+- '/opt/sfw',
+- '/sw/lib',
+- ),
+- 'incdirs': ('/usr/local/BerkeleyDB.4.2/include',
+- '/usr/local/include/db42',
+- '/usr/local/BerkeleyDB.4.1/include',
+- '/usr/local/include/db41',
+- '/usr/local/BerkeleyDB.4.0/include',
+- '/usr/local/include/db4',
+- '/opt/sfw/include/db4',
+- '/sw/include/db4',
+- '/usr/include/db4',
+- )},
+- 'db3': {'libs': ('db-3.3', 'db-3.2', 'db3',),
+- 'libdirs': ('/usr/local/BerkeleyDB.3.3/lib',
+- '/usr/local/BerkeleyDB.3.2/lib',
+- '/usr/local/lib',
+- '/opt/sfw/lib',
+- '/sw/lib',
+- ),
+- 'incdirs': ('/usr/local/BerkeleyDB.3.3/include',
+- '/usr/local/BerkeleyDB.3.2/include',
+- '/usr/local/include/db3',
+- '/opt/sfw/include/db3',
+- '/sw/include/db3',
+- '/usr/include/db3',
+- )},
+- }
+-
+- db_search_order = db_try_this.keys()
+- db_search_order.sort()
+- db_search_order.reverse()
++ #db_try_this = {
++ #'db4': {'libs': ('db-4.2', 'db42', 'db-4.1', 'db41', 'db-4.0', 'db4',),
++ #'libdirs': ('/usr/local/BerkeleyDB.4.2/lib',
++ #'/usr/local/BerkeleyDB.4.1/lib',
++ #'/usr/local/BerkeleyDB.4.0/lib',
++ #'/usr/local/lib',
++ #'/opt/sfw',
++ #'/sw/lib',
++ #),
++ #'incdirs': ('/usr/local/BerkeleyDB.4.2/include',
++ #'/usr/local/include/db42',
++ #'/usr/local/BerkeleyDB.4.1/include',
++ #'/usr/local/include/db41',
++ #'/usr/local/BerkeleyDB.4.0/include',
++ #'/usr/local/include/db4',
++ #'/opt/sfw/include/db4',
++ #'/sw/include/db4',
++ #'/usr/include/db4',
++ #)},
++ #'db3': {'libs': ('db-3.3', 'db-3.2', 'db3',),
++ #'libdirs': ('/usr/local/BerkeleyDB.3.3/lib',
++ #'/usr/local/BerkeleyDB.3.2/lib',
++ #'/usr/local/lib',
++ #'/opt/sfw/lib',
++ #'/sw/lib',
++ #),
++ #'incdirs': ('/usr/local/BerkeleyDB.3.3/include',
++ #'/usr/local/BerkeleyDB.3.2/include',
++ #'/usr/local/include/db3',
++ #'/opt/sfw/include/db3',
++ #'/sw/include/db3',
++ #'/usr/include/db3',
++ #)},
++ #}
++
++ #db_search_order = db_try_this.keys()
++ #db_search_order.sort()
++ #db_search_order.reverse()
+
+- class found(Exception): pass
++ class NotFound(Exception): pass
+ try:
+- # See whether there is a Sleepycat header in the standard
+- # search path.
+- std_dbinc = None
+- for d in inc_dirs:
+- f = os.path.join(d, "db.h")
++ bdb_type = os.environ['PY_BDB_TYPE']
++ db_incs = [os.environ['PY_BDB_INCDIRS']]
++ dblib_dir = None
++ dblibs = None
++
++ # check if need to use the db_185.h compat header
++ bsddb185_define_macros=[]
++ if bdb_type == "db2" or bdb_type == "db3" or bdb_type == "db4":
++ bsddb185_define_macros=[('HAVE_DB_185_H',1)]
++ dblib_dir = [os.environ['PY_BDB_LIBDIRS']]
++
++ else:
++ # check if db_incs/db.h really is db 1.85
++ f = "%s/db.h" % db_incs[0]
++
+ if os.path.exists(f):
+- f = open(f).read()
+- m = re.search(r"#define\WDB_VERSION_MAJOR\W([1-9]+)", f)
+- if m:
+- std_dbinc = 'db' + m.group(1)
+- for dbkey in db_search_order:
+- dbd = db_try_this[dbkey]
+- for dblib in dbd['libs']:
+- # Prefer version-specific includes over standard
+- # include locations.
+- db_incs = find_file('db.h', [], dbd['incdirs'])
+- dblib_dir = find_library_file(self.compiler,
+- dblib,
+- lib_dirs,
+- list(dbd['libdirs']))
+- if (db_incs or dbkey == std_dbinc) and \
+- dblib_dir is not None:
+- dblibs = [dblib]
+- raise found
+- except found:
+- dblibs = [dblib]
+- # A default source build puts Berkeley DB in something like
+- # /usr/local/Berkeley.3.3 and the lib dir under that isn't
+- # normally on ld.so's search path, unless the sysadmin has hacked
+- # /etc/ld.so.conf. We add the directory to runtime_library_dirs
+- # so the proper -R/--rpath flags get passed to the linker. This
+- # is usually correct and most trouble free, but may cause problems
+- # in some unusual system configurations (e.g. the directory is on
+- # an NFS server that goes away).
+- exts.append(Extension('_bsddb', ['_bsddb.c'],
++ data = open(f).read()
++ m = re.search(r"#s*define\s+HASHVERSION\s+2\s*", data)
++ if m is None:
++ # check for 1.85 compat header
++ if os.path.exists("%s/db_185.h" % db_incs[0]):
++ bsddb185_define_macros=[('HAVE_DB_185_H',1)]
++ else:
++ raise NotFound
++ try:
++ bltransform = os.environ['PY_BDB_TRANSFORM']
++ m = re.search(r"l:db:(db.)\s*", bltransform)
++ if m is not None and m.group(1) is not None:
++ dblibs = [m.group(1)]
++ except:
++ pass
++
++ # build the bsddb185 extension module
++ 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=dblibs))
+- else:
++ except:
+ db_incs = None
+ dblibs = []
+- dblib_dir = None
+-
+-
+- # Look for Berkeley db 1.85. Note that it is built as a different
+- # module name so it can be included even when later versions are
+- # available. A very restrictive search is performed to avoid
+- # 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"
+- 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:
+- # 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
+- if libraries is not None:
+- exts.append(Extension('bsddb185', ['bsddbmodule.c'],
+- libraries=libraries))
+- else:
+- exts.append(Extension('bsddb185', ['bsddbmodule.c']))
++ dblib_dir = None
+
+ # The standard Unix dbm module:
+ if platform not in ['cygwin']:
+@@ -610,6 +589,13 @@ class PyBuildExt(build_ext):
+ exts.append( Extension('dbm', ['dbmmodule.c'],
+ define_macros=[('HAVE_NDBM_H',None)],
+ libraries = ndbm_libs ) )
++ elif find_file("ndbm.h", db_incs, []) is not None:
++ exts.append( Extension('dbm', ['dbmmodule.c'],
++ library_dirs=dblib_dir,
++ runtime_library_dirs=dblib_dir,
++ include_dirs=db_incs,
++ define_macros=[('HAVE_NDBM_H',None)],
++ libraries=dblibs))
+ elif (self.compiler.find_library_file(lib_dirs, 'gdbm')
+ and find_file("gdbm/ndbm.h", inc_dirs, []) is not None):
+ exts.append( Extension('dbm', ['dbmmodule.c'],
+@@ -1148,8 +1134,8 @@ def main():
+ ext_modules=[Extension('struct', ['structmodule.c'])],
+
+ # Scripts to install
+- scripts = ['Tools/scripts/pydoc', 'Tools/scripts/idle',
+- 'Lib/smtpd.py']
++ scripts = ['Tools/scripts/pydoc2p4',
++ 'Lib/smtpd2p4.py']
+ )
+
+ # --install-platlib