mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-14 15:50:07 +02:00
Apply several fixes to python.
* Adjust site-packages to be writable (by moving it into non-packaged hierarch). * Add vendor-packages directory, where packaged python modules shall be installed. * Add support for automatically installing modules into vendor directory when HAIKU_USE_VENDOR_DIRECTORIES is set. * Drop references to 'common'-hierarchy.
This commit is contained in:
@@ -1,84 +1,14 @@
|
||||
diff -urN orig/Python-2.6.8/configure.in Python-2.6.8/configure.in
|
||||
--- orig/Python-2.6.8/configure.in 2012-04-10 17:32:11.008650752 +0200
|
||||
+++ Python-2.6.8/configure.in 2013-05-04 00:18:11.912523264 +0200
|
||||
@@ -745,7 +745,7 @@
|
||||
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
|
||||
INSTSONAME="$LDLIBRARY".$SOVERSION
|
||||
;;
|
||||
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
|
||||
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|Haiku*)
|
||||
LDLIBRARY='libpython$(VERSION).so'
|
||||
BLDLIBRARY='-L. -lpython$(VERSION)'
|
||||
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
|
||||
@@ -753,6 +753,9 @@
|
||||
FreeBSD*)
|
||||
SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
|
||||
;;
|
||||
+ Haiku*)
|
||||
+ RUNSHARED=LIBRARY_PATH=`pwd`:${LIBRARY_PATH}
|
||||
+ ;;
|
||||
esac
|
||||
INSTSONAME="$LDLIBRARY".$SOVERSION
|
||||
;;
|
||||
@@ -823,7 +826,7 @@
|
||||
AC_SUBST(LN)
|
||||
if test -z "$LN" ; then
|
||||
case $ac_sys_system in
|
||||
- BeOS*) LN="ln -s";;
|
||||
+ BeOS*|Haiku*) LN="ln -s";;
|
||||
CYGWIN*) LN="ln -s";;
|
||||
atheos*) LN="ln -s";;
|
||||
*) LN=ln;;
|
||||
@@ -1829,7 +1832,7 @@
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
- Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
|
||||
+ Linux*|GNU*|QNX*|Haiku*) LDSHARED='$(CC) -shared';;
|
||||
BSD/OS*/4*) LDSHARED="gcc -shared";;
|
||||
FreeBSD*)
|
||||
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
|
||||
@@ -1883,7 +1886,7 @@
|
||||
then CCSHARED="-fPIC";
|
||||
else CCSHARED="+z";
|
||||
fi;;
|
||||
- Linux*|GNU*) CCSHARED="-fPIC";;
|
||||
+ Linux*|GNU*|Haiku*) CCSHARED="-fPIC";;
|
||||
BSD/OS*/4*) CCSHARED="-fpic";;
|
||||
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
|
||||
OpenUNIX*|UnixWare*)
|
||||
@@ -1916,7 +1919,7 @@
|
||||
LINKFORSHARED="-Wl,-E -Wl,+s";;
|
||||
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
|
||||
BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
|
||||
- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
|
||||
+ Linux*|GNU*|Haiku*) LINKFORSHARED="-Xlinker -export-dynamic";;
|
||||
# -u libsys_s pulls in all symbols in libsys
|
||||
Darwin/*)
|
||||
# -u _PyMac_Error is needed to pull in the mac toolbox glue,
|
||||
@@ -2035,6 +2038,9 @@
|
||||
BeOS*)
|
||||
AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
|
||||
;;
|
||||
+Haiku*)
|
||||
+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # Haiku
|
||||
+;;
|
||||
esac
|
||||
|
||||
AC_MSG_CHECKING(for --with-libs)
|
||||
@@ -3265,7 +3271,7 @@
|
||||
AC_SUBST(LIBM)
|
||||
case $ac_sys_system in
|
||||
Darwin) ;;
|
||||
-BeOS) ;;
|
||||
+BeOS|Haiku) ;;
|
||||
*) LIBM=-lm
|
||||
esac
|
||||
AC_MSG_CHECKING(for --with-libm=STRING)
|
||||
diff -urN orig/Python-2.6.8/Lib/distutils/command/build_ext.py Python-2.6.8/Lib/distutils/command/build_ext.py
|
||||
--- orig/Python-2.6.8/Lib/distutils/command/build_ext.py 2012-04-10 17:32:04.018087936 +0200
|
||||
+++ Python-2.6.8/Lib/distutils/command/build_ext.py 2013-05-04 00:18:11.913833984 +0200
|
||||
@@ -234,9 +234,13 @@
|
||||
From 5ccf5800d437d3abbfd13b4f2ccf86b1606deb8c Mon Sep 17 00:00:00 2001
|
||||
From: Oliver Tappe <zooey@hirschkaefer.de>
|
||||
Date: Sat, 12 Oct 2013 17:37:25 +0200
|
||||
Subject: applying patch python-2.6.8.patch
|
||||
|
||||
|
||||
diff --git a/Lib/distutils/command/build_ext.py b/Lib/distutils/command/build_ext.py
|
||||
index aeb6b74..2edcc48 100644
|
||||
--- a/Lib/distutils/command/build_ext.py
|
||||
+++ b/Lib/distutils/command/build_ext.py
|
||||
@@ -234,9 +234,13 @@ class build_ext (Command):
|
||||
|
||||
# for extensions under Linux or Solaris with a shared Python library,
|
||||
# Python's library directory must be appended to library_dirs
|
||||
@@ -93,10 +23,11 @@ diff -urN orig/Python-2.6.8/Lib/distutils/command/build_ext.py Python-2.6.8/Lib/
|
||||
and sysconfig.get_config_var('Py_ENABLE_SHARED')):
|
||||
if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
|
||||
# building third party extensions
|
||||
diff -urN orig/Python-2.6.8/Lib/distutils/sysconfig.py Python-2.6.8/Lib/distutils/sysconfig.py
|
||||
--- orig/Python-2.6.8/Lib/distutils/sysconfig.py 2012-04-10 17:32:04.014942208 +0200
|
||||
+++ Python-2.6.8/Lib/distutils/sysconfig.py 2013-05-04 00:31:41.977534976 +0200
|
||||
@@ -85,7 +85,8 @@
|
||||
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
|
||||
index 46d23ec..5354cf1 100644
|
||||
--- a/Lib/distutils/sysconfig.py
|
||||
+++ b/Lib/distutils/sysconfig.py
|
||||
@@ -85,7 +85,8 @@ def get_python_inc(plat_specific=0, prefix=None):
|
||||
# Include is located in the srcdir
|
||||
inc_dir = os.path.join(srcdir, "Include")
|
||||
return inc_dir
|
||||
@@ -106,9 +37,11 @@ diff -urN orig/Python-2.6.8/Lib/distutils/sysconfig.py Python-2.6.8/Lib/distutil
|
||||
elif os.name == "nt":
|
||||
return os.path.join(prefix, "include")
|
||||
elif os.name == "mac":
|
||||
diff -urN orig/Python-2.6.8/Lib/plat-haiku1/IN.py Python-2.6.8/Lib/plat-haiku1/IN.py
|
||||
--- orig/Python-2.6.8/Lib/plat-haiku1/IN.py 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ Python-2.6.8/Lib/plat-haiku1/IN.py 2013-05-04 00:18:11.917766144 +0200
|
||||
diff --git a/Lib/plat-haiku1/IN.py b/Lib/plat-haiku1/IN.py
|
||||
new file mode 100644
|
||||
index 0000000..362cb41
|
||||
--- /dev/null
|
||||
+++ b/Lib/plat-haiku1/IN.py
|
||||
@@ -0,0 +1,327 @@
|
||||
+# Generated by h2py from /boot/develop/headers/be/net/netinet/in.h
|
||||
+
|
||||
@@ -437,9 +370,11 @@ diff -urN orig/Python-2.6.8/Lib/plat-haiku1/IN.py Python-2.6.8/Lib/plat-haiku1/I
|
||||
+def _FDMSKNO(fd): return ((fd) / NFDBITS)
|
||||
+
|
||||
+def _FDBITNO(fd): return ((fd) % NFDBITS)
|
||||
diff -urN orig/Python-2.6.8/Lib/plat-haiku1/regen Python-2.6.8/Lib/plat-haiku1/regen
|
||||
--- orig/Python-2.6.8/Lib/plat-haiku1/regen 1970-01-01 01:00:00.000000000 +0100
|
||||
+++ Python-2.6.8/Lib/plat-haiku1/regen 2013-05-04 00:18:11.918552576 +0200
|
||||
diff --git a/Lib/plat-haiku1/regen b/Lib/plat-haiku1/regen
|
||||
new file mode 100644
|
||||
index 0000000..d9da80c
|
||||
--- /dev/null
|
||||
+++ b/Lib/plat-haiku1/regen
|
||||
@@ -0,0 +1,7 @@
|
||||
+#! /bin/sh
|
||||
+
|
||||
@@ -448,10 +383,11 @@ diff -urN orig/Python-2.6.8/Lib/plat-haiku1/regen Python-2.6.8/Lib/plat-haiku1/r
|
||||
+
|
||||
+set -v
|
||||
+python $H2PY -i '(u_long)' $HEADERS/posix/netinet/in.h
|
||||
diff -urN orig/Python-2.6.8/Lib/test/test_fileio.py Python-2.6.8/Lib/test/test_fileio.py
|
||||
--- orig/Python-2.6.8/Lib/test/test_fileio.py 2012-04-10 17:32:07.061865984 +0200
|
||||
+++ Python-2.6.8/Lib/test/test_fileio.py 2013-05-04 00:18:11.920911872 +0200
|
||||
@@ -152,6 +152,7 @@
|
||||
diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py
|
||||
index 7eeef7b..b1938fd 100644
|
||||
--- a/Lib/test/test_fileio.py
|
||||
+++ b/Lib/test/test_fileio.py
|
||||
@@ -152,6 +152,7 @@ class OtherFileTests(unittest.TestCase):
|
||||
self.assertEquals(f.writable(), True)
|
||||
if sys.platform != "darwin" and \
|
||||
'bsd' not in sys.platform and \
|
||||
@@ -459,10 +395,11 @@ diff -urN orig/Python-2.6.8/Lib/test/test_fileio.py Python-2.6.8/Lib/test/test_f
|
||||
not sys.platform.startswith('sunos'):
|
||||
# Somehow /dev/tty appears seekable on some BSDs
|
||||
self.assertEquals(f.seekable(), False)
|
||||
diff -urN orig/Python-2.6.8/Makefile.pre.in Python-2.6.8/Makefile.pre.in
|
||||
--- orig/Python-2.6.8/Makefile.pre.in 2012-04-10 17:32:08.065798144 +0200
|
||||
+++ Python-2.6.8/Makefile.pre.in 2013-05-04 00:18:11.922222592 +0200
|
||||
@@ -90,7 +90,7 @@
|
||||
diff --git a/Makefile.pre.in b/Makefile.pre.in
|
||||
index ce4fbdc..aba9464 100644
|
||||
--- a/Makefile.pre.in
|
||||
+++ b/Makefile.pre.in
|
||||
@@ -90,7 +90,7 @@ BINDIR= @bindir@
|
||||
LIBDIR= @libdir@
|
||||
MANDIR= @mandir@
|
||||
INCLUDEDIR= @includedir@
|
||||
@@ -471,10 +408,11 @@ diff -urN orig/Python-2.6.8/Makefile.pre.in Python-2.6.8/Makefile.pre.in
|
||||
SCRIPTDIR= $(prefix)/lib
|
||||
|
||||
# Detailed destination directories
|
||||
diff -urN orig/Python-2.6.8/Modules/bz2module.c Python-2.6.8/Modules/bz2module.c
|
||||
--- orig/Python-2.6.8/Modules/bz2module.c 2012-04-10 17:32:09.049545216 +0200
|
||||
+++ Python-2.6.8/Modules/bz2module.c 2013-05-04 00:18:11.923533312 +0200
|
||||
@@ -9,7 +9,7 @@
|
||||
diff --git a/Modules/bz2module.c b/Modules/bz2module.c
|
||||
index cfd8d71..89d9002 100644
|
||||
--- a/Modules/bz2module.c
|
||||
+++ b/Modules/bz2module.c
|
||||
@@ -9,7 +9,7 @@ Copyright (c) 2002 Python Software Foundation; All Rights Reserved
|
||||
|
||||
#include "Python.h"
|
||||
#include <stdio.h>
|
||||
@@ -483,10 +421,11 @@ diff -urN orig/Python-2.6.8/Modules/bz2module.c Python-2.6.8/Modules/bz2module.c
|
||||
#include "structmember.h"
|
||||
|
||||
#ifdef WITH_THREAD
|
||||
diff -urN orig/Python-2.6.8/Modules/resource.c Python-2.6.8/Modules/resource.c
|
||||
--- orig/Python-2.6.8/Modules/resource.c 2012-04-10 17:32:10.008388608 +0200
|
||||
+++ Python-2.6.8/Modules/resource.c 2013-05-04 00:18:11.926679040 +0200
|
||||
@@ -86,6 +86,7 @@
|
||||
diff --git a/Modules/resource.c b/Modules/resource.c
|
||||
index 9993b93..f8befde 100644
|
||||
--- a/Modules/resource.c
|
||||
+++ b/Modules/resource.c
|
||||
@@ -86,6 +86,7 @@ resource_getrusage(PyObject *self, PyObject *args)
|
||||
PyFloat_FromDouble(doubletime(ru.ru_utime)));
|
||||
PyStructSequence_SET_ITEM(result, 1,
|
||||
PyFloat_FromDouble(doubletime(ru.ru_stime)));
|
||||
@@ -494,7 +433,7 @@ diff -urN orig/Python-2.6.8/Modules/resource.c Python-2.6.8/Modules/resource.c
|
||||
PyStructSequence_SET_ITEM(result, 2, PyInt_FromLong(ru.ru_maxrss));
|
||||
PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(ru.ru_ixrss));
|
||||
PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(ru.ru_idrss));
|
||||
@@ -100,7 +101,7 @@
|
||||
@@ -100,7 +101,7 @@ resource_getrusage(PyObject *self, PyObject *args)
|
||||
PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(ru.ru_nsignals));
|
||||
PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(ru.ru_nvcsw));
|
||||
PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(ru.ru_nivcsw));
|
||||
@@ -503,10 +442,11 @@ diff -urN orig/Python-2.6.8/Modules/resource.c Python-2.6.8/Modules/resource.c
|
||||
if (PyErr_Occurred()) {
|
||||
Py_DECREF(result);
|
||||
return NULL;
|
||||
diff -urN orig/Python-2.6.8/Modules/socketmodule.c Python-2.6.8/Modules/socketmodule.c
|
||||
--- orig/Python-2.6.8/Modules/socketmodule.c 2012-04-10 17:32:10.017825792 +0200
|
||||
+++ Python-2.6.8/Modules/socketmodule.c 2013-05-04 00:18:11.929824768 +0200
|
||||
@@ -4661,7 +4661,9 @@
|
||||
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
|
||||
index a28116c..62c5813 100644
|
||||
--- a/Modules/socketmodule.c
|
||||
+++ b/Modules/socketmodule.c
|
||||
@@ -4661,7 +4661,9 @@ init_socket(void)
|
||||
#ifndef __BEOS__
|
||||
/* We have incomplete socket support. */
|
||||
PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW);
|
||||
@@ -517,10 +457,11 @@ diff -urN orig/Python-2.6.8/Modules/socketmodule.c Python-2.6.8/Modules/socketmo
|
||||
#if defined(SOCK_RDM)
|
||||
PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM);
|
||||
#endif
|
||||
diff -urN orig/Python-2.6.8/Modules/socketmodule.h Python-2.6.8/Modules/socketmodule.h
|
||||
--- orig/Python-2.6.8/Modules/socketmodule.h 2012-04-10 17:32:10.024379392 +0200
|
||||
+++ Python-2.6.8/Modules/socketmodule.h 2013-05-04 00:18:11.930349056 +0200
|
||||
@@ -47,6 +47,10 @@
|
||||
diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h
|
||||
index 9b85773..8e35a64 100644
|
||||
--- a/Modules/socketmodule.h
|
||||
+++ b/Modules/socketmodule.h
|
||||
@@ -47,6 +47,10 @@ typedef int socklen_t;
|
||||
# undef AF_NETLINK
|
||||
#endif
|
||||
|
||||
@@ -531,10 +472,11 @@ diff -urN orig/Python-2.6.8/Modules/socketmodule.h Python-2.6.8/Modules/socketmo
|
||||
#ifdef HAVE_BLUETOOTH_BLUETOOTH_H
|
||||
#include <bluetooth/bluetooth.h>
|
||||
#include <bluetooth/rfcomm.h>
|
||||
diff -urN orig/Python-2.6.8/Modules/spwdmodule.c Python-2.6.8/Modules/spwdmodule.c
|
||||
--- orig/Python-2.6.8/Modules/spwdmodule.c 2012-04-10 17:32:10.051904512 +0200
|
||||
+++ Python-2.6.8/Modules/spwdmodule.c 2013-05-04 00:18:11.932446208 +0200
|
||||
@@ -79,7 +79,9 @@
|
||||
diff --git a/Modules/spwdmodule.c b/Modules/spwdmodule.c
|
||||
index 957de58..69be5bb 100644
|
||||
--- a/Modules/spwdmodule.c
|
||||
+++ b/Modules/spwdmodule.c
|
||||
@@ -79,7 +79,9 @@ static PyObject *mkspent(struct spwd *p)
|
||||
|
||||
SETS(setIndex++, p->sp_namp);
|
||||
SETS(setIndex++, p->sp_pwdp);
|
||||
@@ -544,9 +486,10 @@ diff -urN orig/Python-2.6.8/Modules/spwdmodule.c Python-2.6.8/Modules/spwdmodule
|
||||
SETI(setIndex++, p->sp_min);
|
||||
SETI(setIndex++, p->sp_max);
|
||||
SETI(setIndex++, p->sp_warn);
|
||||
diff -urN orig/Python-2.6.8/Python/bltinmodule.c Python-2.6.8/Python/bltinmodule.c
|
||||
--- orig/Python-2.6.8/Python/bltinmodule.c 2012-04-10 17:32:11.066060288 +0200
|
||||
+++ Python-2.6.8/Python/bltinmodule.c 2013-05-04 00:18:11.936378368 +0200
|
||||
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
|
||||
index 57d9df8..83c9a2e 100644
|
||||
--- a/Python/bltinmodule.c
|
||||
+++ b/Python/bltinmodule.c
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
#if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T)
|
||||
@@ -556,10 +499,108 @@ diff -urN orig/Python-2.6.8/Python/bltinmodule.c Python-2.6.8/Python/bltinmodule
|
||||
const char *Py_FileSystemDefaultEncoding = "utf-8";
|
||||
#else
|
||||
const char *Py_FileSystemDefaultEncoding = NULL; /* use default */
|
||||
diff -urN orig/Python-2.6.8/setup.py Python-2.6.8/setup.py
|
||||
--- orig/Python-2.6.8/setup.py 2012-04-10 17:32:11.008388608 +0200
|
||||
+++ Python-2.6.8/setup.py 2013-05-04 00:18:11.938737664 +0200
|
||||
@@ -428,6 +428,15 @@
|
||||
diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py
|
||||
index 63e7336..65cd21f 100755
|
||||
--- a/Tools/scripts/h2py.py
|
||||
+++ b/Tools/scripts/h2py.py
|
||||
@@ -1,4 +1,4 @@
|
||||
-#! /usr/bin/env python
|
||||
+#! /bin/env python
|
||||
|
||||
# Read #define's and translate to Python code.
|
||||
# Handle #include statements.
|
||||
@@ -50,7 +50,7 @@ except KeyError:
|
||||
searchdirs=os.environ['INCLUDE'].split(';')
|
||||
except KeyError:
|
||||
try:
|
||||
- if sys.platform.find("beos") == 0:
|
||||
+ if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0:
|
||||
searchdirs=os.environ['BEINCLUDES'].split(';')
|
||||
elif sys.platform.startswith("atheos"):
|
||||
searchdirs=os.environ['C_INCLUDE_PATH'].split(':')
|
||||
diff --git a/configure.in b/configure.in
|
||||
index f3d34f2..aedd433 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -745,7 +745,7 @@ if test $enable_shared = "yes"; then
|
||||
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
|
||||
INSTSONAME="$LDLIBRARY".$SOVERSION
|
||||
;;
|
||||
- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*)
|
||||
+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|Haiku*)
|
||||
LDLIBRARY='libpython$(VERSION).so'
|
||||
BLDLIBRARY='-L. -lpython$(VERSION)'
|
||||
RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH}
|
||||
@@ -753,6 +753,9 @@ if test $enable_shared = "yes"; then
|
||||
FreeBSD*)
|
||||
SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
|
||||
;;
|
||||
+ Haiku*)
|
||||
+ RUNSHARED=LIBRARY_PATH=`pwd`:${LIBRARY_PATH}
|
||||
+ ;;
|
||||
esac
|
||||
INSTSONAME="$LDLIBRARY".$SOVERSION
|
||||
;;
|
||||
@@ -823,7 +826,7 @@ AC_PROG_INSTALL
|
||||
AC_SUBST(LN)
|
||||
if test -z "$LN" ; then
|
||||
case $ac_sys_system in
|
||||
- BeOS*) LN="ln -s";;
|
||||
+ BeOS*|Haiku*) LN="ln -s";;
|
||||
CYGWIN*) LN="ln -s";;
|
||||
atheos*) LN="ln -s";;
|
||||
*) LN=ln;;
|
||||
@@ -1829,7 +1832,7 @@ then
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
- Linux*|GNU*|QNX*) LDSHARED='$(CC) -shared';;
|
||||
+ Linux*|GNU*|QNX*|Haiku*) LDSHARED='$(CC) -shared';;
|
||||
BSD/OS*/4*) LDSHARED="gcc -shared";;
|
||||
FreeBSD*)
|
||||
if [[ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]]
|
||||
@@ -1883,7 +1886,7 @@ then
|
||||
then CCSHARED="-fPIC";
|
||||
else CCSHARED="+z";
|
||||
fi;;
|
||||
- Linux*|GNU*) CCSHARED="-fPIC";;
|
||||
+ Linux*|GNU*|Haiku*) CCSHARED="-fPIC";;
|
||||
BSD/OS*/4*) CCSHARED="-fpic";;
|
||||
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
|
||||
OpenUNIX*|UnixWare*)
|
||||
@@ -1916,7 +1919,7 @@ then
|
||||
LINKFORSHARED="-Wl,-E -Wl,+s";;
|
||||
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
|
||||
BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";;
|
||||
- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
|
||||
+ Linux*|GNU*|Haiku*) LINKFORSHARED="-Xlinker -export-dynamic";;
|
||||
# -u libsys_s pulls in all symbols in libsys
|
||||
Darwin/*)
|
||||
# -u _PyMac_Error is needed to pull in the mac toolbox glue,
|
||||
@@ -2035,6 +2038,9 @@ case "$ac_sys_system" in
|
||||
BeOS*)
|
||||
AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS
|
||||
;;
|
||||
+Haiku*)
|
||||
+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # Haiku
|
||||
+;;
|
||||
esac
|
||||
|
||||
AC_MSG_CHECKING(for --with-libs)
|
||||
@@ -3265,7 +3271,7 @@ fi],
|
||||
AC_SUBST(LIBM)
|
||||
case $ac_sys_system in
|
||||
Darwin) ;;
|
||||
-BeOS) ;;
|
||||
+BeOS|Haiku) ;;
|
||||
*) LIBM=-lm
|
||||
esac
|
||||
AC_MSG_CHECKING(for --with-libm=STRING)
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 4fe1f45..930a368 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -428,6 +428,15 @@ class PyBuildExt(build_ext):
|
||||
inc_dirs += ['/system/include', '/atheos/autolnk/include']
|
||||
inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
|
||||
|
||||
@@ -575,7 +616,7 @@ diff -urN orig/Python-2.6.8/setup.py Python-2.6.8/setup.py
|
||||
# OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
|
||||
if platform in ['osf1', 'unixware7', 'openunix8']:
|
||||
lib_dirs += ['/usr/ccs/lib']
|
||||
@@ -451,7 +460,7 @@
|
||||
@@ -451,7 +460,7 @@ class PyBuildExt(build_ext):
|
||||
|
||||
# Check for MacOS X, which doesn't need libm.a at all
|
||||
math_libs = ['m']
|
||||
@@ -584,7 +625,7 @@ diff -urN orig/Python-2.6.8/setup.py Python-2.6.8/setup.py
|
||||
math_libs = []
|
||||
|
||||
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
|
||||
@@ -694,15 +703,22 @@
|
||||
@@ -694,15 +703,22 @@ class PyBuildExt(build_ext):
|
||||
'/usr/local/ssl/include',
|
||||
'/usr/contrib/ssl/include/'
|
||||
]
|
||||
@@ -610,7 +651,7 @@ diff -urN orig/Python-2.6.8/setup.py Python-2.6.8/setup.py
|
||||
['/usr/local/ssl/lib',
|
||||
'/usr/contrib/ssl/lib/'
|
||||
] )
|
||||
@@ -710,8 +726,8 @@
|
||||
@@ -710,8 +726,8 @@ class PyBuildExt(build_ext):
|
||||
if (ssl_incs is not None and
|
||||
ssl_libs is not None):
|
||||
exts.append( Extension('_ssl', ['_ssl.c'],
|
||||
@@ -621,7 +662,7 @@ diff -urN orig/Python-2.6.8/setup.py Python-2.6.8/setup.py
|
||||
libraries = ['ssl', 'crypto'],
|
||||
depends = ['socketmodule.h']), )
|
||||
else:
|
||||
@@ -746,8 +762,8 @@
|
||||
@@ -746,8 +762,8 @@ class PyBuildExt(build_ext):
|
||||
# The _hashlib module wraps optimized implementations
|
||||
# of hash functions from the OpenSSL library.
|
||||
exts.append( Extension('_hashlib', ['_hashopenssl.c'],
|
||||
@@ -632,7 +673,7 @@ diff -urN orig/Python-2.6.8/setup.py Python-2.6.8/setup.py
|
||||
libraries = ['ssl', 'crypto']) )
|
||||
# these aren't strictly missing since they are unneeded.
|
||||
#missing.extend(['_sha', '_md5'])
|
||||
@@ -1176,7 +1192,7 @@
|
||||
@@ -1176,7 +1192,7 @@ class PyBuildExt(build_ext):
|
||||
missing.append('resource')
|
||||
|
||||
# Sun yellow pages. Some systems have the functions in libc.
|
||||
@@ -641,21 +682,184 @@ diff -urN orig/Python-2.6.8/setup.py Python-2.6.8/setup.py
|
||||
find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None):
|
||||
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
|
||||
libs = ['nsl']
|
||||
diff -urN orig/Python-2.6.8/Tools/scripts/h2py.py Python-2.6.8/Tools/scripts/h2py.py
|
||||
--- orig/Python-2.6.8/Tools/scripts/h2py.py 2012-04-10 17:32:11.061603840 +0200
|
||||
+++ Python-2.6.8/Tools/scripts/h2py.py 2013-05-04 00:18:11.939261952 +0200
|
||||
@@ -1,4 +1,4 @@
|
||||
-#! /usr/bin/env python
|
||||
+#! /bin/env python
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
|
||||
From a47dd1d32150a36714bdf527f0153d387ebff8c9 Mon Sep 17 00:00:00 2001
|
||||
From: Oliver Tappe <zooey@hirschkaefer.de>
|
||||
Date: Sun, 13 Oct 2013 17:01:30 +0200
|
||||
Subject: Adjust package folders for Python modules.
|
||||
|
||||
* move standard site-packaged into non-packaged hierarchy, as it has to
|
||||
be writable
|
||||
* rename directory for packaged python modules to 'vendor-packages'
|
||||
* add support for automatically switching to 'vendor-packages' directory
|
||||
when environment variable 'HAIKU_USE_VENDOR_DIRECTORIES' is set
|
||||
|
||||
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
|
||||
index 44c7692..ff8c01e 100644
|
||||
--- a/Lib/distutils/command/install.py
|
||||
+++ b/Lib/distutils/command/install.py
|
||||
@@ -97,6 +97,34 @@ INSTALL_SCHEMES = {
|
||||
'scripts': '$userbase/bin',
|
||||
'data' : '$userbase',
|
||||
},
|
||||
+ 'haiku': {
|
||||
+ 'purelib': '$base/non-packaged/lib/python$py_version_short/site-packages',
|
||||
+ 'platlib': '$platbase/non-packaged/lib/python$py_version_short/site-packages',
|
||||
+ 'headers': '$base/non-packaged/develop/headers/python$py_version_short/$dist_name',
|
||||
+ 'scripts': '$base/non-packaged/bin',
|
||||
+ 'data' : '$base/non-packaged',
|
||||
+ },
|
||||
+ 'haiku_vendor': {
|
||||
+ 'purelib': '$base/lib/python$py_version_short/vendor-packages',
|
||||
+ 'platlib': '$platbase/lib/python$py_version_short/vendor-packages',
|
||||
+ 'headers': '$base/develop/headers/python$py_version_short/$dist_name',
|
||||
+ 'scripts': '$base/bin',
|
||||
+ 'data' : '$base',
|
||||
+ },
|
||||
+ 'haiku_home': {
|
||||
+ 'purelib': '$base/lib/python',
|
||||
+ 'platlib': '$base/lib/python',
|
||||
+ 'headers': '$base/develop/headers/python/$dist_name',
|
||||
+ 'scripts': '$base/bin',
|
||||
+ 'data' : '$base',
|
||||
+ },
|
||||
+ 'haiku_user': {
|
||||
+ 'purelib': '$usersite',
|
||||
+ 'platlib': '$usersite',
|
||||
+ 'headers': '$userbase/develop/headers/python$py_version_short/$dist_name',
|
||||
+ 'scripts': '$userbase/bin',
|
||||
+ 'data' : '$userbase',
|
||||
+ },
|
||||
}
|
||||
|
||||
# Read #define's and translate to Python code.
|
||||
# Handle #include statements.
|
||||
@@ -50,7 +50,7 @@
|
||||
searchdirs=os.environ['INCLUDE'].split(';')
|
||||
except KeyError:
|
||||
try:
|
||||
- if sys.platform.find("beos") == 0:
|
||||
+ if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0:
|
||||
searchdirs=os.environ['BEINCLUDES'].split(';')
|
||||
elif sys.platform.startswith("atheos"):
|
||||
searchdirs=os.environ['C_INCLUDE_PATH'].split(':')
|
||||
# The keys to an installation scheme; if any new types of files are to be
|
||||
@@ -430,10 +458,16 @@ class install (Command):
|
||||
raise DistutilsPlatformError(
|
||||
"User base directory is not specified")
|
||||
self.install_base = self.install_platbase = self.install_userbase
|
||||
- self.select_scheme("unix_user")
|
||||
+ if sys.platform.startswith('haiku'):
|
||||
+ self.select_scheme("haiku_user")
|
||||
+ else:
|
||||
+ self.select_scheme("unix_user")
|
||||
elif self.home is not None:
|
||||
self.install_base = self.install_platbase = self.home
|
||||
- self.select_scheme("unix_home")
|
||||
+ if sys.platform.startswith('haiku'):
|
||||
+ self.select_scheme("haiku_home")
|
||||
+ else:
|
||||
+ self.select_scheme("unix_home")
|
||||
else:
|
||||
if self.prefix is None:
|
||||
if self.exec_prefix is not None:
|
||||
@@ -449,7 +483,13 @@ class install (Command):
|
||||
|
||||
self.install_base = self.prefix
|
||||
self.install_platbase = self.exec_prefix
|
||||
- self.select_scheme("unix_prefix")
|
||||
+ if sys.platform.startswith('haiku'):
|
||||
+ if os.environ.get('HAIKU_USE_VENDOR_DIRECTORIES') == '1':
|
||||
+ self.select_scheme("haiku_vendor")
|
||||
+ else:
|
||||
+ self.select_scheme("haiku")
|
||||
+ else:
|
||||
+ self.select_scheme("unix_prefix")
|
||||
|
||||
# finalize_unix ()
|
||||
|
||||
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
|
||||
index 5354cf1..017a94c 100644
|
||||
--- a/Lib/distutils/sysconfig.py
|
||||
+++ b/Lib/distutils/sysconfig.py
|
||||
@@ -120,12 +120,20 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
|
||||
prefix = plat_specific and EXEC_PREFIX or PREFIX
|
||||
|
||||
if os.name == "posix":
|
||||
- libpython = os.path.join(prefix,
|
||||
- "lib", "python" + get_python_version())
|
||||
- if standard_lib:
|
||||
- return libpython
|
||||
+ if sys.platform.startswith('haiku'):
|
||||
+ if standard_lib:
|
||||
+ return os.path.join(prefix,
|
||||
+ "lib", "python" + get_python_version())
|
||||
+ return os.path.join(prefix, "non-packaged",
|
||||
+ "lib", "python" + get_python_version(),
|
||||
+ "site-packages")
|
||||
else:
|
||||
- return os.path.join(libpython, "site-packages")
|
||||
+ libpython = os.path.join(prefix,
|
||||
+ "lib", "python" + get_python_version())
|
||||
+ if standard_lib:
|
||||
+ return libpython
|
||||
+ else:
|
||||
+ return os.path.join(libpython, "site-packages")
|
||||
|
||||
elif os.name == "nt":
|
||||
if standard_lib:
|
||||
diff --git a/Lib/site.py b/Lib/site.py
|
||||
index 66c56c2..304f994 100644
|
||||
--- a/Lib/site.py
|
||||
+++ b/Lib/site.py
|
||||
@@ -241,6 +241,11 @@ def addusersitepackages(known_paths):
|
||||
USER_SITE = os.path.join(USER_BASE,
|
||||
"Python" + sys.version[0] + sys.version[2],
|
||||
"site-packages")
|
||||
+ elif sys.platform.startswith('haiku'):
|
||||
+ USER_BASE = env_base if env_base else joinuser("~", "non-packaged")
|
||||
+ USER_SITE = os.path.join(USER_BASE, "lib",
|
||||
+ "python" + sys.version[:3],
|
||||
+ "site-packages")
|
||||
else:
|
||||
USER_BASE = env_base if env_base else joinuser("~", ".local")
|
||||
USER_SITE = os.path.join(USER_BASE, "lib",
|
||||
@@ -264,6 +269,13 @@ def addsitepackages(known_paths):
|
||||
|
||||
if sys.platform in ('os2emx', 'riscos'):
|
||||
sitedirs.append(os.path.join(prefix, "Lib", "site-packages"))
|
||||
+ elif sys.platform.startswith('haiku'):
|
||||
+ sitedirs.append(os.path.join(prefix, "non-packaged", "lib",
|
||||
+ "python" + sys.version[:3],
|
||||
+ "site-packages"))
|
||||
+ sitedirs.append(os.path.join(prefix, "lib",
|
||||
+ "python" + sys.version[:3],
|
||||
+ "vendor-packages"))
|
||||
elif os.sep == '/':
|
||||
sitedirs.append(os.path.join(prefix, "lib",
|
||||
"python" + sys.version[:3],
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
|
||||
From 17c8d2590189838ef19b08fb0ce7976d03b1cabc Mon Sep 17 00:00:00 2001
|
||||
From: Oliver Tappe <zooey@hirschkaefer.de>
|
||||
Date: Sun, 13 Oct 2013 17:06:48 +0200
|
||||
Subject: Drop references to common hierarchy.
|
||||
|
||||
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 930a368..41a16a2 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -429,13 +429,9 @@ class PyBuildExt(build_ext):
|
||||
inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep)
|
||||
|
||||
if platform == 'haiku1':
|
||||
- inc_dirs += ['/boot/common/non-packaged/develop/headers',
|
||||
- '/boot/common/develop/headers',
|
||||
- '/boot/system/develop/headers/posix',
|
||||
+ inc_dirs += ['/boot/system/develop/headers/posix',
|
||||
'/boot/system/develop/headers']
|
||||
- lib_dirs += ['/boot/common/non-packaged/develop/lib',
|
||||
- '/boot/common/develop/lib',
|
||||
- '/boot/system/develop/lib']
|
||||
+ lib_dirs += ['/boot/system/develop/lib']
|
||||
|
||||
# OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
|
||||
if platform in ['osf1', 'unixware7', 'openunix8']:
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
@@ -9,10 +9,10 @@ LICENSE="Python"
|
||||
COPYRIGHT="1990-2012, Python Software Foundation"
|
||||
SRC_URI="http://www.python.org/ftp/python/2.6.8/Python-2.6.8.tar.bz2"
|
||||
CHECKSUM_MD5="c6e0420a21d8b23dee8b0195c9b9a125"
|
||||
REVISION="5"
|
||||
REVISION="6"
|
||||
ARCHITECTURES="x86_gcc2 x86 x86_64"
|
||||
|
||||
PATCHES="python-2.6.8.patch"
|
||||
PATCHES="python-2.6.8.patchset"
|
||||
|
||||
PROVIDES="
|
||||
python = $portVersion compat >= 2.6
|
||||
@@ -59,6 +59,10 @@ BUILD_PREREQUIRES="
|
||||
|
||||
SOURCE_DIR="Python-2.6.8"
|
||||
|
||||
GLOBAL_WRITABLE_FILES="
|
||||
non-packaged/lib/python2.6/site-packages directory keep-old
|
||||
"
|
||||
|
||||
PATCH()
|
||||
{
|
||||
echo "AC_CONFIG_MACRO_DIR([m4])" >> configure.in
|
||||
@@ -89,6 +93,13 @@ INSTALL()
|
||||
make install
|
||||
|
||||
prepareInstalledDevelLibs libpython2.6
|
||||
|
||||
mkdir -p $prefix/lib/python2.6/vendor-packages
|
||||
echo 'This directory contains packaged python modules.' \
|
||||
>$prefix/lib/python2.6/vendor-packages/README
|
||||
|
||||
mkdir -p $prefix/non-packaged/lib/python2.6
|
||||
mv $prefix/lib/python2.6/site-packages $prefix/non-packaged/lib/python2.6/
|
||||
}
|
||||
|
||||
TEST()
|
||||
|
||||
Reference in New Issue
Block a user