diff --git a/dev-lang/python/patches/python-2.6.8.patch b/dev-lang/python/patches/python-2.6.8.patch index 9a2e064a5..38bb43083 100644 --- a/dev-lang/python/patches/python-2.6.8.patch +++ b/dev-lang/python/patches/python-2.6.8.patch @@ -1,6 +1,101 @@ -diff -urN Python-2.6.8/Lib/plat-haiku1/IN.py Python-2.6.8-haiku/Lib/plat-haiku1/IN.py ---- Python-2.6.8/Lib/plat-haiku1/IN.py 1970-01-01 00:00:00.000000000 +0000 -+++ Python-2.6.8-haiku/Lib/plat-haiku1/IN.py 2010-08-30 04:52:27.223346688 +0000 +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.057409536 +0200 ++++ Python-2.6.8/configure.in 2013-05-03 15:23:53.332922880 +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 - +-#include ++#include + #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.057147392 +0200 ++++ Python-2.6.8/Modules/resource.c 2013-05-03 15:23:53.340787200 +0200 @@ -86,6 +86,7 @@ PyFloat_FromDouble(doubletime(ru.ru_utime))); PyStructSequence_SET_ITEM(result, 1, @@ -360,9 +490,9 @@ diff -urN Python-2.6.8/Modules/resource.c Python-2.6.8-haiku/Modules/resource.c if (PyErr_Occurred()) { Py_DECREF(result); return NULL; -diff -urN Python-2.6.8/Modules/socketmodule.c Python-2.6.8-haiku/Modules/socketmodule.c ---- Python-2.6.8/Modules/socketmodule.c 2010-05-23 15:22:08.054525952 +0000 -+++ Python-2.6.8-haiku/Modules/socketmodule.c 2010-08-30 04:53:35.429916160 +0000 +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.066846720 +0200 ++++ Python-2.6.8/Modules/socketmodule.c 2013-05-03 15:23:53.342622208 +0200 @@ -4661,7 +4661,9 @@ #ifndef __BEOS__ /* We have incomplete socket support. */ @@ -374,9 +504,9 @@ diff -urN Python-2.6.8/Modules/socketmodule.c Python-2.6.8-haiku/Modules/socketm #if defined(SOCK_RDM) PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM); #endif -diff -urN Python-2.6.8/Modules/socketmodule.h Python-2.6.8-haiku/Modules/socketmodule.h ---- Python-2.6.8/Modules/socketmodule.h 2010-05-09 15:15:40.053739520 +0000 -+++ Python-2.6.8-haiku/Modules/socketmodule.h 2010-08-30 04:52:24.667942912 +0000 +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.006029312 +0200 ++++ Python-2.6.8/Modules/socketmodule.h 2013-05-03 15:23:53.343146496 +0200 @@ -47,6 +47,10 @@ # undef AF_NETLINK #endif @@ -388,9 +518,9 @@ diff -urN Python-2.6.8/Modules/socketmodule.h Python-2.6.8-haiku/Modules/socketm #ifdef HAVE_BLUETOOTH_BLUETOOTH_H #include #include -diff -urN Python-2.6.8/Modules/spwdmodule.c Python-2.6.8-haiku/Modules/spwdmodule.c ---- Python-2.6.8/Modules/spwdmodule.c 2010-05-09 15:15:40.030408704 +0000 -+++ Python-2.6.8-haiku/Modules/spwdmodule.c 2010-08-30 04:52:24.709623808 +0000 +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.033554432 +0200 ++++ Python-2.6.8/Modules/spwdmodule.c 2013-05-03 15:23:53.343670784 +0200 @@ -79,7 +79,9 @@ SETS(setIndex++, p->sp_namp); @@ -401,35 +531,9 @@ diff -urN Python-2.6.8/Modules/spwdmodule.c Python-2.6.8-haiku/Modules/spwdmodul SETI(setIndex++, p->sp_min); SETI(setIndex++, p->sp_max); SETI(setIndex++, p->sp_warn); -diff -urN Python-2.6.8/Modules/timemodule.c Python-2.6.8-haiku/Modules/timemodule.c ---- Python-2.6.8/Modules/timemodule.c 2010-05-09 15:15:40.015204352 +0000 -+++ Python-2.6.8-haiku/Modules/timemodule.c 2010-08-30 04:52:24.721944576 +0000 -@@ -972,11 +972,11 @@ - return -1; - } - Py_END_ALLOW_THREADS --#elif defined(__BEOS__) -+#elif defined(__BEOS__) || defined(__HAIKU__) - /* This sleep *CAN BE* interrupted. */ - { - if( secs <= 0.0 ) { -- return; -+ return 0; - } - - Py_BEGIN_ALLOW_THREADS -diff -urN Python-2.6.8/Parser/asdl_c.py Python-2.6.8-haiku/Parser/asdl_c.py ---- Python-2.6.8/Parser/asdl_c.py 2009-12-13 00:59:01.059768832 +0000 -+++ Python-2.6.8-haiku/Parser/asdl_c.py 2010-08-30 04:52:27.169607168 +0000 -@@ -1,4 +1,4 @@ --#! /usr/bin/env python -+#! /bin/env python - """Generate C code from an ASDL description.""" - - # TO DO -diff -urN Python-2.6.8/Python/bltinmodule.c Python-2.6.8-haiku/Python/bltinmodule.c ---- Python-2.6.8/Python/bltinmodule.c 2010-05-09 15:15:40.065011712 +0000 -+++ Python-2.6.8-haiku/Python/bltinmodule.c 2010-08-30 04:52:27.186646528 +0000 +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.047710208 +0200 ++++ Python-2.6.8/Python/bltinmodule.c 2013-05-03 15:23:53.344981504 +0200 @@ -18,7 +18,7 @@ */ #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) @@ -439,9 +543,89 @@ diff -urN Python-2.6.8/Python/bltinmodule.c Python-2.6.8-haiku/Python/bltinmodul const char *Py_FileSystemDefaultEncoding = "utf-8"; #else const char *Py_FileSystemDefaultEncoding = NULL; /* use default */ -diff -urN Python-2.6.8/Tools/scripts/h2py.py Python-2.6.8-haiku/Tools/scripts/h2py.py ---- Python-2.6.8/Tools/scripts/h2py.py 2004-08-09 17:27:55.066584576 +0000 -+++ Python-2.6.8-haiku/Tools/scripts/h2py.py 2010-08-30 04:52:27.188219392 +0000 +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.057147392 +0200 ++++ Python-2.6.8/setup.py 2013-05-03 15:23:53.346816512 +0200 +@@ -428,6 +428,10 @@ + inc_dirs += ['/system/include', '/atheos/autolnk/include'] + 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', '/boot/system/develop/headers/3rdparty'] ++ lib_dirs += ['/boot/common/non-packaged/develop/lib', '/boot/common/develop/lib', '/boot/system/develop/lib'] ++ + # 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 +455,7 @@ + + # Check for MacOS X, which doesn't need libm.a at all + math_libs = ['m'] +- if platform in ['darwin', 'beos', 'mac']: ++ if platform in ['darwin', 'beos', 'haiku1', 'mac']: + math_libs = [] + + # XXX Omitted modules: gl, pure, dl, SGI-specific modules +@@ -694,15 +698,22 @@ + '/usr/local/ssl/include', + '/usr/contrib/ssl/include/' + ] +- ssl_incs = find_file('openssl/ssl.h', inc_dirs, ++ ssl_incs = find_file('openssl/ssl.h', [], ++ inc_dirs + search_for_ssl_incs_in ++ ) ++ ssl_incs_to_add = find_file('openssl/ssl.h', inc_dirs, + search_for_ssl_incs_in + ) + if ssl_incs is not None: + krb5_h = find_file('krb5.h', inc_dirs, + ['/usr/kerberos/include']) + if krb5_h: +- ssl_incs += krb5_h +- ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs, ++ ssl_incs_to_add += krb5_h ++ ssl_libs = find_library_file(self.compiler, 'ssl', [], ++ lib_dirs + ['/usr/local/ssl/lib', ++ '/usr/contrib/ssl/lib/' ++ ] ) ++ ssl_libs_to_add = find_library_file(self.compiler, 'ssl', lib_dirs, + ['/usr/local/ssl/lib', + '/usr/contrib/ssl/lib/' + ] ) +@@ -710,8 +721,8 @@ + if (ssl_incs is not None and + ssl_libs is not None): + exts.append( Extension('_ssl', ['_ssl.c'], +- include_dirs = ssl_incs, +- library_dirs = ssl_libs, ++ include_dirs = ssl_incs_to_add, ++ library_dirs = ssl_libs_to_add, + libraries = ['ssl', 'crypto'], + depends = ['socketmodule.h']), ) + else: +@@ -746,8 +757,8 @@ + # The _hashlib module wraps optimized implementations + # of hash functions from the OpenSSL library. + exts.append( Extension('_hashlib', ['_hashopenssl.c'], +- include_dirs = ssl_incs, +- library_dirs = ssl_libs, ++ include_dirs = ssl_incs_to_add, ++ library_dirs = ssl_libs_to_add, + libraries = ['ssl', 'crypto']) ) + # these aren't strictly missing since they are unneeded. + #missing.extend(['_sha', '_md5']) +@@ -1176,7 +1187,7 @@ + missing.append('resource') + + # Sun yellow pages. Some systems have the functions in libc. +- if (platform not in ['cygwin', 'atheos', 'qnx6'] and ++ if (platform not in ['cygwin', 'atheos', 'qnx6', 'haiku1'] and + 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.043253760 +0200 ++++ Python-2.6.8/Tools/scripts/h2py.py 2013-05-03 15:23:53.347340800 +0200 @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /bin/env python @@ -457,112 +641,3 @@ diff -urN Python-2.6.8/Tools/scripts/h2py.py Python-2.6.8-haiku/Tools/scripts/h2 searchdirs=os.environ['BEINCLUDES'].split(';') elif sys.platform.startswith("atheos"): searchdirs=os.environ['C_INCLUDE_PATH'].split(':') -diff -urN Python-2.6.8/configure.in Python-2.6.8-haiku/configure.in ---- Python-2.6.8/configure.in 2010-05-25 02:27:03.064225280 +0000 -+++ Python-2.6.8-haiku/configure.in 2010-08-30 04:52:27.207880192 +0000 -@@ -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} -@@ -823,7 +823,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 +1829,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 - > configure.in + find . -name '*.py' -exec sed -i -e 's|/usr/bin/env|/bin/env|g' {} \; +} + BUILD() { - cd Python-2.6.8/Modules/_ctypes/libffi + cd Modules/_ctypes/libffi libtoolize --force --copy --install cd ../../.. - echo "AC_CONFIG_MACRO_DIR([m4])" >> configure.in + libtoolize --force --copy --install aclocal autoconf - ./configure --prefix=`finddir B_COMMON_DIRECTORY` \ - --enable-shared LDFLAGS=-L/boot/common/lib \ - --mandir=`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man \ - CFLAGS=-I/boot/develop/headers/3rdparty - make + runConfigure ./configure \ + --enable-shared \ + --enable-unicode=ucs4 + + # prevent make from rebuilding stuff that requires python + touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h + + make $jobArgs } INSTALL() { - cd Python-2.6.8 make install + + prepareInstalledDevelLibs libpython2.6 } TEST() { - cd Python-2.6.8 cd Lib/test rm test_asynchat.py # this one stalls, so skip it for now rm test_multiprocessing.py # this one stalls, so skip it for now python regrtest.py } - -LICENSE="Python" -COPYRIGHT="1990-2012, Python Software Foundation"