summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lang/python24-pth/DESCR16
-rw-r--r--lang/python24-pth/Makefile14
-rw-r--r--lang/python24-pth/buildlink3.mk27
-rw-r--r--lang/python24-pth/distinfo18
-rw-r--r--lang/python24-pth/patches/patch-aa26
-rw-r--r--lang/python24-pth/patches/patch-ab22
-rw-r--r--lang/python24-pth/patches/patch-ac13
-rw-r--r--lang/python24-pth/patches/patch-ad31
-rw-r--r--lang/python24-pth/patches/patch-ae18
-rw-r--r--lang/python24-pth/patches/patch-af46
-rw-r--r--lang/python24-pth/patches/patch-ag17
-rw-r--r--lang/python24-pth/patches/patch-ah86
-rw-r--r--lang/python24-pth/patches/patch-ai15
-rw-r--r--lang/python24-pth/patches/patch-aj15
-rw-r--r--lang/python24-pth/patches/patch-ak22
-rw-r--r--lang/python24-pth/patches/patch-al90
-rw-r--r--lang/python24-pth/patches/patch-am268
-rw-r--r--lang/python24-pth/patches/patch-ba11
18 files changed, 755 insertions, 0 deletions
diff --git a/lang/python24-pth/DESCR b/lang/python24-pth/DESCR
new file mode 100644
index 00000000000..3a712368832
--- /dev/null
+++ b/lang/python24-pth/DESCR
@@ -0,0 +1,16 @@
+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.
diff --git a/lang/python24-pth/Makefile b/lang/python24-pth/Makefile
new file mode 100644
index 00000000000..d28f4f3f165
--- /dev/null
+++ b/lang/python24-pth/Makefile
@@ -0,0 +1,14 @@
+# $NetBSD: Makefile,v 1.1.1.1 2004/12/05 23:28:53 recht Exp $
+#
+
+PKGNAME= python24-pth-2.4
+
+PTHREAD_OPTS= require
+.include "../../mk/pthread.buildlink3.mk"
+.if ${PTHREAD_TYPE} == "pth"
+CONFIGURE_ARGS+= --with-pth
+.endif
+
+PY_VER_SUFFIX= 2p4
+
+.include "../../lang/python24/Makefile.common"
diff --git a/lang/python24-pth/buildlink3.mk b/lang/python24-pth/buildlink3.mk
new file mode 100644
index 00000000000..124600195b4
--- /dev/null
+++ b/lang/python24-pth/buildlink3.mk
@@ -0,0 +1,27 @@
+# $NetBSD: buildlink3.mk,v 1.1.1.1 2004/12/05 23:28:53 recht Exp $
+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
+PYTHON24_PTH_BUILDLINK3_MK:= ${PYTHON24_PTH_BUILDLINK3_MK}+
+
+.if !empty(BUILDLINK_DEPTH:M+)
+BUILDLINK_DEPENDS+= python24-pth
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Npython24-pth}
+BUILDLINK_PACKAGES+= python24-pth
+
+.if !empty(PYTHON24_PTH_BUILDLINK3_MK:M+)
+BUILDLINK_DEPENDS.python24-pth+= python24-pth>=2.4
+BUILDLINK_PKGSRCDIR.python24-pth?= ../../lang/python24-pth
+
+.if defined(BUILDLINK_DEPMETHOD.python)
+BUILDLINK_DEPMETHOD.python24pth?= ${BUILDLINK_DEPMETHOD.python}
+.endif
+
+BUILDLINK_INCDIRS.python24-pth+= include/python2p4
+BUILDLINK_LIBDIRS.python24-pth+= lib/python2p4/config
+BUILDLINK_TRANSFORM+= l:python:python2p4
+
+.endif # PYTHON24_PTH_BUILDLINK3_MK
+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/lang/python24-pth/distinfo b/lang/python24-pth/distinfo
new file mode 100644
index 00000000000..2179bc3ebb5
--- /dev/null
+++ b/lang/python24-pth/distinfo
@@ -0,0 +1,18 @@
+$NetBSD: distinfo,v 1.1.1.1 2004/12/05 23:28:53 recht Exp $
+
+SHA1 (Python-2.4.tar.bz2) = 80c06f491a4b2a629e868540150faf22c5d0e41e
+Size (Python-2.4.tar.bz2) = 7840762 bytes
+SHA1 (patch-aa) = 310309e6778fd809b7758efa8db7333ed498e5e5
+SHA1 (patch-ab) = 5402e5b8f0c8e919fdf5c2c4baab0423eb74ada5
+SHA1 (patch-ac) = 97d2dcbc93986dc13d7866025269ae5f15827a24
+SHA1 (patch-ad) = 0fa1c66fa0ad9ce345c44b13fd3897975837c72e
+SHA1 (patch-ae) = 7232b64cc3d201daf0bc00476eb58aa694a6df2a
+SHA1 (patch-af) = 82486cc06585a05a0151b3508e5bbcb3c7281681
+SHA1 (patch-ag) = 0cdc08af9d37ae7d00a06ab81c30efa021ef28ac
+SHA1 (patch-ah) = 6f5cff1f9f2482c59ef442bf019a1f3ad9fe21e8
+SHA1 (patch-ai) = 6435c5a7269c14d94eab6fb9777b9d059507e7b8
+SHA1 (patch-aj) = e471737ade95423039661b475f2dd0fc27aa9dac
+SHA1 (patch-ak) = f2e1d4087a94490bd3589a8c829ec72e04f31f72
+SHA1 (patch-al) = ebf8e77f67e69f6aec0b6da254e0169198f0ae8f
+SHA1 (patch-am) = ecb78cf1097531447af7b7fd60166b84b8aef1b4
+SHA1 (patch-ba) = d0f9d225bd3de0a7af098fef05d5b09f8319ce7f
diff --git a/lang/python24-pth/patches/patch-aa b/lang/python24-pth/patches/patch-aa
new file mode 100644
index 00000000000..60297492da1
--- /dev/null
+++ b/lang/python24-pth/patches/patch-aa
@@ -0,0 +1,26 @@
+$NetBSD: patch-aa,v 1.1.1.1 2004/12/05 23:28:56 recht Exp $
+
+--- Include/py_curses.h.orig Sun Jun 29 17:46:21 2003
++++ Include/py_curses.h
+@@ -39,6 +39,21 @@
+ #endif
+ #endif
+
++#ifdef __NetBSD__
++/*
++** On NetBSD, [n]curses.h and stdlib.h/wchar.h use different guards
++** against multiple definition of wchar_t and wint_t.
++*/
++#ifdef _XOPEN_SOURCE_EXTENDED
++#ifndef _WCHAR_T
++#define _WCHAR_T
++#endif
++#ifndef _WINT_T
++#define _WINT_T
++#endif
++#endif
++#endif
++
+ #ifdef HAVE_NCURSES_H
+ #include <ncurses.h>
+ #else
diff --git a/lang/python24-pth/patches/patch-ab b/lang/python24-pth/patches/patch-ab
new file mode 100644
index 00000000000..fac547c7a0a
--- /dev/null
+++ b/lang/python24-pth/patches/patch-ab
@@ -0,0 +1,22 @@
+$NetBSD: patch-ab,v 1.1.1.1 2004/12/05 23:28:55 recht Exp $
+
+--- Lib/distutils/command/build_ext.py.orig Sun Dec 5 22:03:11 2004
++++ Lib/distutils/command/build_ext.py Sun Dec 5 22:03:25 2004
+@@ -485,7 +485,17 @@
+ # that go into the mix.
+ if ext.extra_objects:
+ objects.extend(ext.extra_objects)
++
++ # Two possible sources for extra linker arguments:
++ # - 'extra_link_args' in Extension object
++ # - LDFLAGS environment variable
++ # The environment variable should take precedence, and
++ # any sensible compiler will give precedence to later
++ # command line args. Hence we combine them in order:
+ extra_args = ext.extra_link_args or []
++
++ if os.environ.has_key('LDFLAGS'):
++ extra_args.extend(string.split(os.environ['LDFLAGS']))
+
+ # Detect target language, if not provided
+ language = ext.language or self.compiler.detect_language(sources)
diff --git a/lang/python24-pth/patches/patch-ac b/lang/python24-pth/patches/patch-ac
new file mode 100644
index 00000000000..0ced298bca6
--- /dev/null
+++ b/lang/python24-pth/patches/patch-ac
@@ -0,0 +1,13 @@
+$NetBSD: patch-ac,v 1.1.1.1 2004/12/05 23:28:55 recht Exp $
+
+--- Lib/distutils/command/build_scripts.py.orig Sun Dec 5 22:05:11 2004
++++ Lib/distutils/command/build_scripts.py Sun Dec 5 22:05:34 2004
+@@ -104,7 +104,7 @@
+ outf.write("#!%s%s\n" %
+ (os.path.join(
+ sysconfig.get_config_var("BINDIR"),
+- "python" + sysconfig.get_config_var("EXE")),
++ "python%s" % sys.version[:3] + sysconfig.get_config_var("EXE")),
+ post_interp))
+ outf.writelines(f.readlines())
+ outf.close()
diff --git a/lang/python24-pth/patches/patch-ad b/lang/python24-pth/patches/patch-ad
new file mode 100644
index 00000000000..a0a3e49d2fc
--- /dev/null
+++ b/lang/python24-pth/patches/patch-ad
@@ -0,0 +1,31 @@
+$NetBSD: patch-ad,v 1.1.1.1 2004/12/05 23:28:55 recht Exp $
+
+--- Lib/posixfile.py.orig Wed Aug 18 17:13:40 2004
++++ Lib/posixfile.py
+@@ -183,10 +183,11 @@ class _posixfile_:
+ # additions for AIX by Vladimir.Marangozov@imag.fr
+ import sys, os
+ if sys.platform in ('netbsd1',
++ 'netbsd2',
+ 'openbsd2',
+ 'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5',
+ 'freebsd6', 'bsdos2', 'bsdos3', 'bsdos4'):
+- flock = struct.pack('lxxxxlxxxxlhh', \
++ flock = struct.pack('qqihh', \
+ l_start, l_len, os.getpid(), l_type, l_whence)
+ elif sys.platform in ['aix3', 'aix4']:
+ flock = struct.pack('hhlllii', \
+@@ -199,11 +200,12 @@ class _posixfile_:
+
+ if '?' in how:
+ if sys.platform in ('netbsd1',
++ 'netbsd2',
+ 'openbsd2',
+ 'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5',
+ 'bsdos2', 'bsdos3', 'bsdos4'):
+ l_start, l_len, l_pid, l_type, l_whence = \
+- struct.unpack('lxxxxlxxxxlhh', flock)
++ struct.unpack('qqihh', flock)
+ elif sys.platform in ['aix3', 'aix4']:
+ l_type, l_whence, l_start, l_len, l_sysid, l_pid, l_vfs = \
+ struct.unpack('hhlllii', flock)
diff --git a/lang/python24-pth/patches/patch-ae b/lang/python24-pth/patches/patch-ae
new file mode 100644
index 00000000000..8e1b8158598
--- /dev/null
+++ b/lang/python24-pth/patches/patch-ae
@@ -0,0 +1,18 @@
+$NetBSD: patch-ae,v 1.1.1.1 2004/12/05 23:28:55 recht Exp $
+
+--- Lib/test/test_fcntl.py.orig Wed Aug 18 17:13:41 2004
++++ Lib/test/test_fcntl.py
+@@ -20,11 +20,11 @@ else:
+ if sys.platform.startswith('atheos'):
+ start_len = "qq"
+
+-if sys.platform in ('netbsd1', 'Darwin1.2', 'darwin',
++if sys.platform in ('netbsd1', 'netbsd2', 'Darwin1.2', 'darwin',
+ 'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5', 'freebsd6',
+ 'bsdos2', 'bsdos3', 'bsdos4',
+ 'openbsd', 'openbsd2', 'openbsd3'):
+- lockdata = struct.pack('lxxxxlxxxxlhh', 0, 0, 0, fcntl.F_WRLCK, 0)
++ lockdata = struct.pack('qqihh', 0, 0, 0, fcntl.F_WRLCK, 0)
+ elif sys.platform in ['aix3', 'aix4', 'hp-uxB', 'unixware7']:
+ lockdata = struct.pack('hhlllii', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0)
+ elif sys.platform in ['os2emx']:
diff --git a/lang/python24-pth/patches/patch-af b/lang/python24-pth/patches/patch-af
new file mode 100644
index 00000000000..e28d9d285ee
--- /dev/null
+++ b/lang/python24-pth/patches/patch-af
@@ -0,0 +1,46 @@
+$NetBSD: patch-af,v 1.1.1.1 2004/12/05 23:28:55 recht Exp $
+
+--- Makefile.pre.in.orig Sun Sep 26 19:26:55 2004
++++ Makefile.pre.in
+@@ -56,7 +56,7 @@ MAKESETUP= $(srcdir)/Modules/makese
+ OPT= @OPT@
+ BASECFLAGS= @BASECFLAGS@
+ CFLAGS= $(BASECFLAGS) $(OPT)
+-CPPFLAGS= -I. -I$(srcdir)/Include
++CPPFLAGS+= @CPPFLAGS@ -I. -I$(srcdir)/Include
+ LDFLAGS= @LDFLAGS@
+ LDLAST= @LDLAST@
+ SGI_ABI= @SGI_ABI@
+@@ -311,7 +311,7 @@ all: $(BUILDPYTHON) oldsharedmods share
+ $(BUILDPYTHON): Modules/$(MAINOBJ) $(LIBRARY) $(LDLIBRARY)
+ $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
+ Modules/$(MAINOBJ) \
+- $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
++ $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ${LINK_ALL_LIBGCC_HACK}
+
+ platform: $(BUILDPYTHON)
+ $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
+@@ -360,6 +360,9 @@ libpython$(VERSION).so: $(LIBRARY_OBJS)
+ libpython$(VERSION).sl: $(LIBRARY_OBJS)
+ $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(LIBC) $(LIBM)
+
++libpython$(VERSION).dylib: $(LIBRARY_OBJS)
++ $(LINKCC) -dynamiclib -install_name $(LIBDIR)/$@ -current_version 2.4.0 -compatibility_version 2.4 -o $@ -flat_namespace -undefined suppress $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM)
++
+ # This rule is here for OPENSTEP/Rhapsody/MacOSX. It builds a temporary
+ # minimal framework (not including the Lib directory and such) in the current
+ # directory.
+@@ -625,7 +628,12 @@ altbininstall: $(BUILDPYTHON)
+ (cd $(DESTDIR)$(LIBDIR); $(LN) -sf $(INSTSONAME) libpython$(VERSION)$(SO)); \
+ fi \
+ fi; \
+- else true; \
++ else \
++ if test -f libpython$(VERSION).dylib; then \
++ $(INSTALL_SHARED) libpython$(VERSION).dylib $(DESTDIR)$(LIBDIR)/libpython$(VERSION).dylib; \
++ else \
++ true; \
++ fi \
+ fi
+
+ # Install the manual page
diff --git a/lang/python24-pth/patches/patch-ag b/lang/python24-pth/patches/patch-ag
new file mode 100644
index 00000000000..22ee67215b5
--- /dev/null
+++ b/lang/python24-pth/patches/patch-ag
@@ -0,0 +1,17 @@
+$NetBSD: patch-ag,v 1.1.1.1 2004/12/05 23:28:55 recht Exp $
+
+--- Misc/setuid-prog.c.orig Thu Sep 10 22:18:09 1998
++++ Misc/setuid-prog.c
+@@ -70,6 +70,12 @@
+ #define environ _environ
+ #endif
+
++#if defined(__APPLE__)
++# include <sys/time.h>
++# include <crt_externs.h>
++# define environ (*_NSGetEnviron())
++#endif /* __APPLE__ */
++
+ /* don't change def_IFS */
+ char def_IFS[] = "IFS= \t\n";
+ /* you may want to change def_PATH, but you should really change it in */
diff --git a/lang/python24-pth/patches/patch-ah b/lang/python24-pth/patches/patch-ah
new file mode 100644
index 00000000000..e045acdf3ae
--- /dev/null
+++ b/lang/python24-pth/patches/patch-ah
@@ -0,0 +1,86 @@
+$NetBSD: patch-ah,v 1.1.1.1 2004/12/05 23:28:56 recht Exp $
+
+--- Modules/_cursesmodule.c.orig Wed Aug 4 16:33:28 2004
++++ Modules/_cursesmodule.c
+@@ -313,17 +313,9 @@ Window_OneArgNoReturnFunction(wattroff,
+ Window_OneArgNoReturnFunction(wattrset, attr_t, "l;attr")
+ Window_OneArgNoReturnFunction(clearok, int, "i;True(1) or False(0)")
+ Window_OneArgNoReturnFunction(idlok, int, "i;True(1) or False(0)")
+-#if defined(__NetBSD__)
+-Window_OneArgNoReturnVoidFunction(keypad, int, "i;True(1) or False(0)")
+-#else
+ Window_OneArgNoReturnFunction(keypad, int, "i;True(1) or False(0)")
+-#endif
+ Window_OneArgNoReturnFunction(leaveok, int, "i;True(1) or False(0)")
+-#if defined(__NetBSD__)
+-Window_OneArgNoReturnVoidFunction(nodelay, int, "i;True(1) or False(0)")
+-#else
+ Window_OneArgNoReturnFunction(nodelay, int, "i;True(1) or False(0)")
+-#endif
+ Window_OneArgNoReturnFunction(notimeout, int, "i;True(1) or False(0)")
+ Window_OneArgNoReturnFunction(scrollok, int, "i;True(1) or False(0)")
+ Window_OneArgNoReturnFunction(winsdelln, int, "i;nlines")
+@@ -784,11 +776,7 @@ PyCursesWindow_GetKey(PyCursesWindowObje
+ } else if (rtn<=255)
+ return Py_BuildValue("c", rtn);
+ else
+-#if defined(__NetBSD__)
+- return PyString_FromString(unctrl(rtn));
+-#else
+ return PyString_FromString((char *)keyname(rtn));
+-#endif
+ }
+
+ static PyObject *
+@@ -1946,7 +1934,6 @@ PyCurses_IntrFlush(PyObject *self, PyObj
+ return PyCursesCheckERR(intrflush(NULL,ch), "intrflush");
+ }
+
+-#if !defined(__NetBSD__)
+ static PyObject *
+ PyCurses_KeyName(PyObject *self, PyObject *args)
+ {
+@@ -1965,7 +1952,6 @@ PyCurses_KeyName(PyObject *self, PyObjec
+
+ return PyString_FromString((knp == NULL) ? "" : (char *)knp);
+ }
+-#endif
+
+ static PyObject *
+ PyCurses_KillChar(PyObject *self)
+@@ -2410,9 +2396,7 @@ static PyMethodDef PyCurses_methods[] =
+ {"initscr", (PyCFunction)PyCurses_InitScr, METH_NOARGS},
+ {"intrflush", (PyCFunction)PyCurses_IntrFlush, METH_VARARGS},
+ {"isendwin", (PyCFunction)PyCurses_isendwin, METH_NOARGS},
+-#if !defined(__NetBSD__)
+ {"keyname", (PyCFunction)PyCurses_KeyName, METH_VARARGS},
+-#endif
+ {"killchar", (PyCFunction)PyCurses_KillChar, METH_NOARGS},
+ {"longname", (PyCFunction)PyCurses_longname, METH_NOARGS},
+ {"meta", (PyCFunction)PyCurses_Meta, METH_VARARGS},
+@@ -2511,9 +2495,7 @@ init_curses(void)
+ SetDictInt("A_DIM", A_DIM);
+ SetDictInt("A_BOLD", A_BOLD);
+ SetDictInt("A_ALTCHARSET", A_ALTCHARSET);
+-#if !defined(__NetBSD__)
+ SetDictInt("A_INVIS", A_INVIS);
+-#endif
+ SetDictInt("A_PROTECT", A_PROTECT);
+ SetDictInt("A_CHARTEXT", A_CHARTEXT);
+ SetDictInt("A_COLOR", A_COLOR);
+@@ -2585,7 +2567,6 @@ init_curses(void)
+ int key;
+ char *key_n;
+ char *key_n2;
+-#if !defined(__NetBSD__)
+ for (key=KEY_MIN;key < KEY_MAX; key++) {
+ key_n = (char *)keyname(key);
+ if (key_n == NULL || strcmp(key_n,"UNKNOWN KEY")==0)
+@@ -2609,7 +2590,6 @@ init_curses(void)
+ if (key_n2 != key_n)
+ free(key_n2);
+ }
+-#endif
+ SetDictInt("KEY_MIN", KEY_MIN);
+ SetDictInt("KEY_MAX", KEY_MAX);
+ }
diff --git a/lang/python24-pth/patches/patch-ai b/lang/python24-pth/patches/patch-ai
new file mode 100644
index 00000000000..80d527eba1f
--- /dev/null
+++ b/lang/python24-pth/patches/patch-ai
@@ -0,0 +1,15 @@
+$NetBSD: patch-ai,v 1.1.1.1 2004/12/05 23:28:56 recht Exp $
+
+--- Modules/_ssl.c.orig Wed Aug 4 16:59:00 2004
++++ Modules/_ssl.c
+@@ -7,6 +7,10 @@
+
+ */
+
++#ifdef __sgi
++#include <sys/types.h>
++#endif
++
+ #include "Python.h"
+ enum py_ssl_error {
+ /* these mirror ssl.h */
diff --git a/lang/python24-pth/patches/patch-aj b/lang/python24-pth/patches/patch-aj
new file mode 100644
index 00000000000..0c3c330c0da
--- /dev/null
+++ b/lang/python24-pth/patches/patch-aj
@@ -0,0 +1,15 @@
+$NetBSD: patch-aj,v 1.1.1.1 2004/12/05 23:28:56 recht Exp $
+
+--- Modules/bsddbmodule.c.orig Tue May 6 22:38:52 2003
++++ Modules/bsddbmodule.c
+@@ -13,6 +13,10 @@
+ www.nightmare.com/software.html
+ */
+
++#if defined(__sgi) && _COMPILER_VERSION>700 && !_SGIAPI
++#define _BSD_TYPES
++#endif
++
+ #include "Python.h"
+ #ifdef WITH_THREAD
+ #include "pythread.h"
diff --git a/lang/python24-pth/patches/patch-ak b/lang/python24-pth/patches/patch-ak
new file mode 100644
index 00000000000..082add7a4de
--- /dev/null
+++ b/lang/python24-pth/patches/patch-ak
@@ -0,0 +1,22 @@
+$NetBSD: patch-ak,v 1.1.1.1 2004/12/05 23:28:56 recht Exp $
+
+--- Modules/posixmodule.c.orig Wed Oct 13 17:30:56 2004
++++ Modules/posixmodule.c
+@@ -298,7 +298,7 @@ extern int lstat(const char *, struct st
+ #endif
+
+ /* Return a dictionary corresponding to the POSIX environment table */
+-#ifdef WITH_NEXT_FRAMEWORK
++#ifdef __APPLE__
+ /* On Darwin/MacOSX a shared library or framework has no access to
+ ** environ directly, we must obtain it with _NSGetEnviron().
+ */
+@@ -316,7 +316,7 @@ convertenviron(void)
+ d = PyDict_New();
+ if (d == NULL)
+ return NULL;
+-#ifdef WITH_NEXT_FRAMEWORK
++#ifdef __APPLE__
+ if (environ == NULL)
+ environ = *_NSGetEnviron();
+ #endif
diff --git a/lang/python24-pth/patches/patch-al b/lang/python24-pth/patches/patch-al
new file mode 100644
index 00000000000..7d0a9f86c45
--- /dev/null
+++ b/lang/python24-pth/patches/patch-al
@@ -0,0 +1,90 @@
+$NetBSD: patch-al,v 1.1.1.1 2004/12/05 23:28:56 recht Exp $
+
+--- configure.orig Sun Nov 7 02:24:12 2004
++++ configure Sun Dec 5 23:03:58 2004
+@@ -1349,7 +1349,7 @@
+ mv confdefs.h.new confdefs.h
+
+
+-VERSION=2.4
++VERSION=2p4
+
+
+ SOVERSION=1.0
+@@ -1479,6 +1479,8 @@
+ # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
+ OpenBSD/2.* | OpenBSD/3.[0123456])
+ define_xopen_source=no;;
++ NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6[A-S])
++ define_xopen_source=no;;
+ # On Solaris 2.6, sys/wait.h is inconsistent in the usage
+ # of union __?sigval. Reported by Stuart Bishop.
+ SunOS/5.6)
+@@ -3418,6 +3420,14 @@
+ BLDLIBRARY='-L. -lpython$(VERSION)'
+ RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}
+ ;;
++ Darwin*)
++ if test -z "$enable_framework"; then
++ LDLIBRARY='libpython$(VERSION).dylib'
++ BLDLIBRARY='-L. -lpython$(VERSION)'
++ RUNSHARED=DYLD_LIBRARY_PATH=`pwd`:${DYLD_LIBRARY_PATH}
++ fi
++ ;;
++
+ esac
+ else # shared is disabled
+ case $ac_sys_system in
+@@ -3816,7 +3826,12 @@
+ ;;
+ # is there any other compiler on Darwin besides gcc?
+ Darwin*)
+- BASECFLAGS="$BASECFLAGS -Wno-long-double -no-cpp-precomp -mno-fused-madd"
++ if [[ `/usr/bin/arch` = 'ppc' ]]
++ then
++ BASECFLAGS="$BASECFLAGS -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common"
++ else
++ BASECFLAGS="$BASECFLAGS -Wno-long-double -no-cpp-precomp -fno-common"
++ fi
+ ;;
+ esac
+ ;;
+@@ -10295,7 +10310,7 @@
+ LDSHARED="$LDSHARED "'-Wl,-F$(PYTHONFRAMEWORKPREFIX) -framework $(PYTHONFRAMEWORK)'
+ else
+ # No framework. Ignore undefined symbols, assuming they come from Python
+- LDSHARED="$LDSHARED -undefined suppress"
++ LDSHARED="$LDSHARED -flat_namespace -undefined suppress"
+ fi ;;
+ Darwin/1.4*|Darwin/5.*|Darwin/6.*)
+ LDSHARED='$(CC) $(LDFLAGS) -bundle'
+@@ -10305,8 +10320,8 @@
+ LDSHARED="$LDSHARED "'-Wl,-F$(PYTHONFRAMEWORKPREFIX) -framework $(PYTHONFRAMEWORK)'
+ else
+ # No framework, use the Python app as bundle-loader
+- BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
+- LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
++ BLDSHARED="$LDSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BUILDPYTHON)'
++ LDSHARED="$LDSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+ fi ;;
+ Darwin/*)
+ # Use -undefined dynamic_lookup whenever possible (10.3 and later).
+@@ -10324,8 +10339,8 @@
+ LDSHARED="$LDSHARED "'-Wl,-F$(PYTHONFRAMEWORKPREFIX) -framework $(PYTHONFRAMEWORK)'
+ else
+ # No framework, use the Python app as bundle-loader
+- BLDSHARED="$LDSHARED "'-bundle_loader $(BUILDPYTHON)'
+- LDSHARED="$LDSHARED "'-bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
++ BLDSHARED="$LDSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BUILDPYTHON)'
++ LDSHARED="$LDSHARED "'-flat_namespace -undefined suppress -bundle_loader $(BINDIR)/python$(VERSION)$(EXE)'
+ fi
+ fi
+ ;;
+@@ -14297,6 +14312,7 @@
+ /* end confdefs.h. */
+
+ #include "confdefs.h"
++#include <sys/types.h>
+ #include <sys/socket.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
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
diff --git a/lang/python24-pth/patches/patch-ba b/lang/python24-pth/patches/patch-ba
new file mode 100644
index 00000000000..4e6731b4620
--- /dev/null
+++ b/lang/python24-pth/patches/patch-ba
@@ -0,0 +1,11 @@
+--- Include/patchlevel.h.orig Sun Dec 5 21:33:50 2004
++++ Include/patchlevel.h Sun Dec 5 21:34:01 2004
+@@ -26,7 +26,7 @@
+ #define PY_RELEASE_SERIAL 0
+
+ /* Version as a string */
+-#define PY_VERSION "2.4"
++#define PY_VERSION "2p4"
+
+ /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.
+ Use this for numeric comparisons, e.g. #if PY_VERSION_HEX >= ... */