summaryrefslogtreecommitdiff
path: root/lang/python23-pth
diff options
context:
space:
mode:
authorrecht <recht@pkgsrc.org>2004-11-28 13:33:19 +0000
committerrecht <recht@pkgsrc.org>2004-11-28 13:33:19 +0000
commit97217b70453a25758852a4537719f2ff1155325b (patch)
tree4d8fd15a2530125530e20bc5d7d146512e6c1bdd /lang/python23-pth
parentfc950e852c2c3a472234f723b7cb4bd7f07eed3e (diff)
downloadpkgsrc-97217b70453a25758852a4537719f2ff1155325b.tar.gz
Add patches from darwinports/fink to make the posixmodule work on Darwin/
OSX and build the libpython as dynamic library. While at it also fix the PLIST for Darwin/OSX.
Diffstat (limited to 'lang/python23-pth')
-rw-r--r--lang/python23-pth/distinfo9
-rw-r--r--lang/python23-pth/patches/patch-ah38
-rw-r--r--lang/python23-pth/patches/patch-al57
-rw-r--r--lang/python23-pth/patches/patch-da17
-rw-r--r--lang/python23-pth/patches/patch-db35
-rw-r--r--lang/python23-pth/patches/patch-dc20
6 files changed, 162 insertions, 14 deletions
diff --git a/lang/python23-pth/distinfo b/lang/python23-pth/distinfo
index 138494157d8..0265ae66477 100644
--- a/lang/python23-pth/distinfo
+++ b/lang/python23-pth/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.18 2004/06/14 02:31:13 lukem Exp $
+$NetBSD: distinfo,v 1.19 2004/11/28 13:33:20 recht Exp $
SHA1 (Python-2.3.4.tgz) = 7d47431febec704e766b57f12a1a5030bb2d03c3
Size (Python-2.3.4.tgz) = 8502738 bytes
@@ -7,10 +7,13 @@ SHA1 (patch-ab) = 111d7fa8adbb7001bacad36e3bdbe23ae6ce8b9b
SHA1 (patch-ad) = c8f6ea08e68dae3bd9ad639c38e74cf654c0b41e
SHA1 (patch-ae) = 35d27825ea4f3930cce651761e192a7302696eba
SHA1 (patch-af) = d23d42d5d5fc31aeaf1fca89448873cc4179ccf6
-SHA1 (patch-ah) = 4bc95e775a2b3f4f1997d0779c561db2e9e7b575
-SHA1 (patch-al) = 903b42991a83fe5f5f4f3a20f88abb4937174f26
+SHA1 (patch-ah) = f9a46bfe82acec594cf44afd43f359a5248edadb
+SHA1 (patch-al) = 72c155d28675c10e30a0b13f33f6d1a52457ee47
SHA1 (patch-am) = eda4c6161b4237e1281cc6b82b26c5195444dcff
SHA1 (patch-ba) = dd8f89952d7f40c9a979e362758775f093e047bc
SHA1 (patch-bb) = 7c6fe21b6328dddce2a079b0a1c7ae0bee817bae
SHA1 (patch-ca) = 95f5a515fe3dafd75d077e0591e88a34447152ff
SHA1 (patch-cb) = 301205b29db1ca60f06b2dc0423f5f911eabcd18
+SHA1 (patch-da) = b082eff79571726701aab53c37d8d53a8115e204
+SHA1 (patch-db) = ac37d14f55c165fee1d8225304d6c3c8ec203fec
+SHA1 (patch-dc) = 151159e0bafd248040ab57e5c05152a91fe44ac6
diff --git a/lang/python23-pth/patches/patch-ah b/lang/python23-pth/patches/patch-ah
index 4c5b6dc4af2..c673c5e6e73 100644
--- a/lang/python23-pth/patches/patch-ah
+++ b/lang/python23-pth/patches/patch-ah
@@ -1,17 +1,17 @@
-$NetBSD: patch-ah,v 1.3 2004/01/26 12:11:57 grant Exp $
+$NetBSD: patch-ah,v 1.4 2004/11/28 13:33:20 recht Exp $
---- Makefile.pre.in.orig 2003-11-19 06:54:00.000000000 +1100
-+++ Makefile.pre.in
-@@ -56,7 +56,7 @@ MAKESETUP= $(srcdir)/Modules/makese
+--- Makefile.pre.in.orig Tue Nov 18 20:54:00 2003
++++ Makefile.pre.in Thu Nov 11 18:54:35 2004
+@@ -56,7 +56,7 @@
OPT= @OPT@
BASECFLAGS= @BASECFLAGS@
CFLAGS= $(BASECFLAGS) $(OPT)
-CPPFLAGS= -I. -I$(srcdir)/Include
-+CPPFLAGS+= -I. -I$(srcdir)/Include
++CPPFLAGS+= @CPPFLAGS@ -I. -I$(srcdir)/Include
LDFLAGS= @LDFLAGS@
LDLAST= @LDLAST@
SGI_ABI= @SGI_ABI@
-@@ -305,7 +305,7 @@ all: $(BUILDPYTHON) oldsharedmods share
+@@ -305,7 +305,7 @@
$(BUILDPYTHON): Modules/$(MAINOBJ) $(LIBRARY) $(LDLIBRARY)
$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
Modules/$(MAINOBJ) \
@@ -20,7 +20,7 @@ $NetBSD: patch-ah,v 1.3 2004/01/26 12:11:57 grant Exp $
platform: $(BUILDPYTHON)
$(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
-@@ -345,7 +345,7 @@ $(LIBRARY): $(LIBRARY_OBJS)
+@@ -345,7 +345,7 @@
libpython$(VERSION).so: $(LIBRARY_OBJS)
if test $(INSTSONAME) != $(LDLIBRARY); then \
@@ -29,3 +29,27 @@ $NetBSD: patch-ah,v 1.3 2004/01/26 12:11:57 grant Exp $
$(LN) -f $(INSTSONAME) $@; \
else\
$(LDSHARED) -o $@ $(LIBRARY_OBJS) $(SHLIBS) $(LIBC) $(LIBM); \
+@@ -354,6 +354,9 @@
+ libpython$(VERSION).sl: $(LIBRARY_OBJS)
+ $(LDSHARED) -o $@ $(LIBRARY_OBJS) $(LIBC) $(LIBM)
+
++libpython$(VERSION).dylib: $(LIBRARY_OBJS)
++ $(LINKCC) -dynamiclib -install_name $(LIBDIR)/$@ -current_version 2.3.4 -compatibility_version 2.3 -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.
+@@ -613,7 +616,12 @@
+ (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/python23-pth/patches/patch-al b/lang/python23-pth/patches/patch-al
index 5518ba252f1..844dacc715f 100644
--- a/lang/python23-pth/patches/patch-al
+++ b/lang/python23-pth/patches/patch-al
@@ -1,7 +1,7 @@
-$NetBSD: patch-al,v 1.7 2004/06/02 12:29:28 recht Exp $
+$NetBSD: patch-al,v 1.8 2004/11/28 13:33:20 recht Exp $
---- configure.orig 2004-05-07 21:13:40.000000000 +0200
-+++ configure 2004-06-02 13:59:28.000000000 +0200
+--- configure.orig Fri May 7 21:13:40 2004
++++ configure Thu Nov 25 13:20:20 2004
@@ -1318,7 +1318,7 @@
mv confdefs.h.new confdefs.h
@@ -29,7 +29,56 @@ $NetBSD: patch-al,v 1.7 2004/06/02 12:29:28 recht Exp $
LDLIBRARY='libpython$(VERSION).so'
BLDLIBRARY='-L. -lpython$(VERSION)'
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
-@@ -13855,6 +13857,7 @@
+@@ -3624,6 +3626,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
+ # DG/UX requires some fancy ld contortions to produce a .so from an .a
+ case $MACHDEP in
+@@ -4021,7 +4031,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
+ ;;
+@@ -10082,7 +10097,7 @@
+ LDSHARED="$LDSHARED "'-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/*)
+ LDSHARED='$(CC) $(LDFLAGS) -bundle'
+@@ -10091,8 +10106,8 @@
+ LDSHARED="$LDSHARED "'-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 ;;
+ Linux*|GNU*) LDSHARED='$(CC) -shared';;
+ dgux*) LDSHARED="ld -G";;
+@@ -13855,6 +13870,7 @@
/* end confdefs.h. */
#include "confdefs.h"
diff --git a/lang/python23-pth/patches/patch-da b/lang/python23-pth/patches/patch-da
new file mode 100644
index 00000000000..a94d625a5b5
--- /dev/null
+++ b/lang/python23-pth/patches/patch-da
@@ -0,0 +1,17 @@
+$NetBSD: patch-da,v 1.1 2004/11/28 13:33:20 recht Exp $
+
+--- Misc/setuid-prog.c.orig Thu Nov 25 13:11:28 2004
++++ Misc/setuid-prog.c Thu Nov 25 13:11:27 2004
+@@ -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/python23-pth/patches/patch-db b/lang/python23-pth/patches/patch-db
new file mode 100644
index 00000000000..c5e271cafaa
--- /dev/null
+++ b/lang/python23-pth/patches/patch-db
@@ -0,0 +1,35 @@
+$NetBSD: patch-db,v 1.1 2004/11/28 13:33:20 recht Exp $
+
+--- Modules/getpath.c.orig Thu Nov 11 18:08:55 2004
++++ Modules/getpath.c Thu Nov 11 18:10:13 2004
+@@ -374,6 +374,9 @@
+ #ifdef WITH_NEXT_FRAMEWORK
+ NSModule pythonModule;
+ #endif
++#ifdef __APPLE__
++ unsigned long nsexeclength = MAXPATHLEN;
++#endif
+
+ /* If there is no slash in the argv0 path, then we have to
+ * assume python is on the user's $PATH, since there's no
+@@ -382,6 +385,20 @@
+ */
+ if (strchr(prog, SEP))
+ strncpy(progpath, prog, MAXPATHLEN);
++#ifdef __APPLE__
++ /* On Mac OS X, if a script uses an interpreter of the form
++ * "#!/opt/python2.3/bin/python", the kernel only passes "python"
++ * as argv[0], which falls through to the $PATH search below.
++ * If /opt/python2.3/bin isn't in your path, or is near the end,
++ * this algorithm may incorrectly find /usr/bin/python. To work
++ * around this, we can use _NSGetExecutablePath to get a better
++ * hint of what the intended interpreter was, although this
++ * will fail if a relative path was used. but in that case,
++ * absolutize() should help us out below
++ */
++ else if(0 == _NSGetExecutablePath(progpath, &nsexeclength) && progpath[0] == SEP)
++ ;
++#endif // __APPLE__
+ else if (path) {
+ while (1) {
+ char *delim = strchr(path, DELIM);
diff --git a/lang/python23-pth/patches/patch-dc b/lang/python23-pth/patches/patch-dc
new file mode 100644
index 00000000000..077ed6d0587
--- /dev/null
+++ b/lang/python23-pth/patches/patch-dc
@@ -0,0 +1,20 @@
+--- Modules/posixmodule.c.orig Thu Nov 25 12:56:28 2004
++++ Modules/posixmodule.c Thu Nov 25 12:57:24 2004
+@@ -304,7 +304,7 @@
+ #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().
+ */
+@@ -322,7 +322,7 @@
+ d = PyDict_New();
+ if (d == NULL)
+ return NULL;
+-#ifdef WITH_NEXT_FRAMEWORK
++#ifdef __APPLE__
+ if (environ == NULL)
+ environ = *_NSGetEnviron();
+ #endif