diff --git a/dev-lang/python/patches/python3-3.4.0.patchset b/dev-lang/python/patches/python3-3.4.0.patchset new file mode 100644 index 000000000..ed7b611c7 --- /dev/null +++ b/dev-lang/python/patches/python3-3.4.0.patchset @@ -0,0 +1,541 @@ +From 1c89acb4a76d78fb3df72d3c74647cffe340bfbd Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Thu, 10 Apr 2014 16:03:33 +0000 +Subject: initial Haiku patch + + +diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py +index 456511c..6417b27 100644 +--- a/Lib/distutils/command/install.py ++++ b/Lib/distutils/command/install.py +@@ -58,6 +58,27 @@ INSTALL_SCHEMES = { + 'data' : '$base', + }, + 'nt': WINDOWS_SCHEME, ++ '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', ++ }, + } + + # user site schemes +@@ -79,6 +100,14 @@ if HAS_USER_SITE: + 'data' : '$userbase', + } + ++ INSTALL_SCHEMES['haiku_user'] = { ++ 'purelib': '$usersite', ++ 'platlib': '$usersite', ++ 'headers': '$userbase/develop/headers/python$py_version_short/$dist_name', ++ 'scripts': '$userbase/bin', ++ 'data' : '$userbase', ++ } ++ + # The keys to an installation scheme; if any new types of files are to be + # installed, be sure to add an entry to every installation scheme above, + # and to SCHEME_KEYS here. +@@ -421,10 +450,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: +@@ -440,7 +475,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") + + def finalize_other(self): + """Finalizes options for non-posix platforms""" +diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py +index 75537db..ed4c7af 100644 +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -111,7 +111,8 @@ def get_python_inc(plat_specific=0, prefix=None): + incdir = os.path.join(get_config_var('srcdir'), 'Include') + return os.path.normpath(incdir) + python_dir = 'python' + get_python_version() + build_flags +- return os.path.join(prefix, "include", python_dir) ++ inc_dir = "include" if sys.platform != "haiku1" else "develop/headers" ++ return os.path.join(prefix, inc_dir, python_dir) + elif os.name == "nt": + return os.path.join(prefix, "include") + else: +@@ -141,12 +142,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: + return os.path.join(prefix, "Lib") +diff --git a/Lib/plat-haiku1/regen b/Lib/plat-haiku1/regen +new file mode 100755 +index 0000000..4372ee2 +--- /dev/null ++++ b/Lib/plat-haiku1/regen +@@ -0,0 +1,4 @@ ++#! /bin/sh ++HEADERS=/boot/develop/headers ++set -v ++eval $PYTHON_FOR_BUILD ../../Tools/scripts/h2py.py -i "'(u_long)'" $HEADERS/posix/netinet/in.h +diff --git a/Lib/site.py b/Lib/site.py +index 4fb1058..1894e3e 100644 +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -303,7 +303,14 @@ def getsitepackages(prefixes=None): + continue + seen.add(prefix) + +- if os.sep == '/': ++ if sys.platform.startswith('haiku'): ++ sitepackages.append(os.path.join(prefix, "non-packaged", "lib", ++ "python" + sys.version[:3], ++ "site-packages")) ++ sitepackages.append(os.path.join(prefix, "lib", ++ "python" + sys.version[:3], ++ "vendor-packages")) ++ elif os.sep == '/': + sitepackages.append(os.path.join(prefix, "lib", + "python" + sys.version[:3], + "site-packages")) +diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py +index c37482e..96277a8 100644 +--- a/Lib/test/test_fileio.py ++++ b/Lib/test/test_fileio.py +@@ -295,6 +295,7 @@ class OtherFileTests(unittest.TestCase): + self.assertEqual(f.writable(), True) + if sys.platform != "darwin" and \ + 'bsd' not in sys.platform and \ ++ 'haiku' not in sys.platform and \ + not sys.platform.startswith('sunos'): + # Somehow /dev/tty appears seekable on some BSDs + self.assertEqual(f.seekable(), False) +diff --git a/Makefile.pre.in b/Makefile.pre.in +index bd79fb3..0803e8c 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -114,7 +114,7 @@ BINDIR= @bindir@ + LIBDIR= @libdir@ + MANDIR= @mandir@ + INCLUDEDIR= @includedir@ +-CONFINCLUDEDIR= $(exec_prefix)/include ++CONFINCLUDEDIR= $(INCLUDEDIR) + SCRIPTDIR= $(prefix)/lib + ABIFLAGS= @ABIFLAGS@ + +diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c +index 6cbc78f..3c2390a 100644 +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -11995,7 +11995,7 @@ all_ins(PyObject *m) + if (PyModule_AddIntMacro(m, SCHED_FIFO)) return -1; + if (PyModule_AddIntMacro(m, SCHED_RR)) return -1; + #ifdef SCHED_SPORADIC +- if (PyModule_AddIntMacro(m, SCHED_SPORADIC) return -1; ++ if (PyModule_AddIntMacro(m, SCHED_SPORADIC)) return -1; + #endif + #ifdef SCHED_BATCH + if (PyModule_AddIntMacro(m, SCHED_BATCH)) return -1; +diff --git a/Modules/resource.c b/Modules/resource.c +index 3a1cf09..7a834b1 100644 +--- a/Modules/resource.c ++++ b/Modules/resource.c +@@ -83,6 +83,7 @@ resource_getrusage(PyObject *self, PyObject *args) + PyFloat_FromDouble(doubletime(ru.ru_utime))); + PyStructSequence_SET_ITEM(result, 1, + PyFloat_FromDouble(doubletime(ru.ru_stime))); ++#ifndef __HAIKU__ + PyStructSequence_SET_ITEM(result, 2, PyLong_FromLong(ru.ru_maxrss)); + PyStructSequence_SET_ITEM(result, 3, PyLong_FromLong(ru.ru_ixrss)); + PyStructSequence_SET_ITEM(result, 4, PyLong_FromLong(ru.ru_idrss)); +@@ -97,7 +98,22 @@ resource_getrusage(PyObject *self, PyObject *args) + PyStructSequence_SET_ITEM(result, 13, PyLong_FromLong(ru.ru_nsignals)); + PyStructSequence_SET_ITEM(result, 14, PyLong_FromLong(ru.ru_nvcsw)); + PyStructSequence_SET_ITEM(result, 15, PyLong_FromLong(ru.ru_nivcsw)); +- ++#else ++ PyStructSequence_SET_ITEM(result, 2, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 3, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 4, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 5, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 6, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 7, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 8, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 9, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 10, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 11, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 12, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 13, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 14, PyInt_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 15, PyInt_FromLong(0)); ++#endif + if (PyErr_Occurred()) { + Py_DECREF(result); + return NULL; +@@ -334,19 +350,19 @@ PyInit_resource(void) + (PyObject*) &StructRUsageType); + + /* insert constants */ +-#ifdef RLIMIT_CPU ++#if !defined(__HAIKU__) && defined(RLIMIT_CPU) + PyModule_AddIntMacro(m, RLIMIT_CPU); + #endif + +-#ifdef RLIMIT_FSIZE ++#if !defined(__HAIKU__) && defined(RLIMIT_FSIZE) + PyModule_AddIntMacro(m, RLIMIT_FSIZE); + #endif + +-#ifdef RLIMIT_DATA ++#if !defined(__HAIKU__) && defined(RLIMIT_DATA) + PyModule_AddIntMacro(m, RLIMIT_DATA); + #endif + +-#ifdef RLIMIT_STACK ++#if !defined(__HAIKU__) && defined(RLIMIT_STACK) + PyModule_AddIntMacro(m, RLIMIT_STACK); + #endif + +@@ -358,31 +374,31 @@ PyInit_resource(void) + PyModule_AddIntMacro(m, RLIMIT_NOFILE); + #endif + +-#ifdef RLIMIT_OFILE ++#if !defined(__HAIKU__) && defined(RLIMIT_OFILE) + PyModule_AddIntMacro(m, RLIMIT_OFILE); + #endif + +-#ifdef RLIMIT_VMEM ++#if !defined(__HAIKU__) && defined(RLIMIT_VMEM) + PyModule_AddIntMacro(m, RLIMIT_VMEM); + #endif + +-#ifdef RLIMIT_AS ++#if !defined(__HAIKU__) && defined(RLIMIT_AS) + PyModule_AddIntMacro(m, RLIMIT_AS); + #endif + +-#ifdef RLIMIT_RSS ++#if !defined(__HAIKU__) && defined(RLIMIT_RSS) + PyModule_AddIntMacro(m, RLIMIT_RSS); + #endif + +-#ifdef RLIMIT_NPROC ++#if !defined(__HAIKU__) && defined(RLIMIT_NPROC) + PyModule_AddIntMacro(m, RLIMIT_NPROC); + #endif + +-#ifdef RLIMIT_MEMLOCK ++#if !defined(__HAIKU__) && defined(RLIMIT_MEMLOCK) + PyModule_AddIntMacro(m, RLIMIT_MEMLOCK); + #endif + +-#ifdef RLIMIT_SBSIZE ++#if !defined(__HAIKU__) && defined(RLIMIT_SBSIZE) + PyModule_AddIntMacro(m, RLIMIT_SBSIZE); + #endif + +diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c +index a1e5da8..24a780a 100644 +--- a/Modules/socketmodule.c ++++ b/Modules/socketmodule.c +@@ -6087,7 +6087,9 @@ PyInit__socket(void) + PyModule_AddIntMacro(m, SOCK_DGRAM); + /* We have incomplete socket support. */ + PyModule_AddIntMacro(m, SOCK_RAW); ++#ifndef __HAIKU__ + PyModule_AddIntMacro(m, SOCK_SEQPACKET); ++#endif + #if defined(SOCK_RDM) + PyModule_AddIntMacro(m, SOCK_RDM); + #endif +diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h +index b83f9af..47e4064 100644 +--- a/Modules/socketmodule.h ++++ b/Modules/socketmodule.h +@@ -47,6 +47,10 @@ typedef int socklen_t; + # undef AF_NETLINK + #endif + ++#if defined(__HAIKU__) ++#undef HAVE_BLUETOOTH_BLUETOOTH_H ++#endif ++ + #ifdef HAVE_BLUETOOTH_BLUETOOTH_H + #include + #include +diff --git a/Modules/spwdmodule.c b/Modules/spwdmodule.c +index 68ea1b5..1f5c3d0 100644 +--- a/Modules/spwdmodule.c ++++ b/Modules/spwdmodule.c +@@ -81,7 +81,9 @@ static PyObject *mkspent(struct spwd *p) + + SETS(setIndex++, p->sp_namp); + SETS(setIndex++, p->sp_pwdp); ++#ifndef __HAIKU__ + SETI(setIndex++, p->sp_lstchg); ++#endif + SETI(setIndex++, p->sp_min); + SETI(setIndex++, p->sp_max); + SETI(setIndex++, p->sp_warn); +diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c +index 745457f..090fa2b 100644 +--- a/Python/bltinmodule.c ++++ b/Python/bltinmodule.c +@@ -24,7 +24,7 @@ + #ifdef HAVE_MBCS + const char *Py_FileSystemDefaultEncoding = "mbcs"; + int Py_HasFileSystemDefaultEncoding = 1; +-#elif defined(__APPLE__) ++#elif defined(__APPLE__) || defined(__HAIKU__) + const char *Py_FileSystemDefaultEncoding = "utf-8"; + int Py_HasFileSystemDefaultEncoding = 1; + #else +diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py +index 4f871d9..343e5ba 100755 +--- a/Tools/scripts/h2py.py ++++ b/Tools/scripts/h2py.py +@@ -49,12 +49,15 @@ except KeyError: + try: + searchdirs=os.environ['INCLUDE'].split(';') + except KeyError: +- searchdirs=['/usr/include'] +- try: +- searchdirs.insert(0, os.path.join('/usr/include', ++ if sys.platform.find("beos") == 0 or sys.platform.find("haiku1") == 0: ++ searchdirs=os.environ['BEINCLUDES'].split(';') ++ else: ++ searchdirs=['/usr/include'] ++ try: ++ searchdirs.insert(0, os.path.join('/usr/include', + os.environ['MULTIARCH'])) +- except KeyError: +- pass ++ except KeyError: ++ pass + + def main(): + global filedict +diff --git a/configure.ac b/configure.ac +index 25e1dc8..8b4b4cc 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -953,7 +953,7 @@ if test $enable_shared = "yes"; then + PY3LIBRARY=libpython3.so + fi + ;; +- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) ++ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|Haiku*) + LDLIBRARY='libpython$(LDVERSION).so' + BLDLIBRARY='-L. -lpython$(LDVERSION)' + RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} +@@ -961,6 +961,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 + if test "$with_pydebug" != yes +@@ -1052,6 +1055,7 @@ AC_PROG_MKDIR_P + AC_SUBST(LN) + if test -z "$LN" ; then + case $ac_sys_system in ++ Haiku*) LN="ln -s";; + CYGWIN*) LN="ln -s";; + *) LN=ln;; + esac +@@ -2049,7 +2053,7 @@ then + fi + fi + ;; +- Linux*|GNU*|QNX*) ++ Linux*|GNU*|QNX*|Haiku*) + LDSHARED='$(CC) -shared' + LDCXXSHARED='$(CXX) -shared';; + BSD/OS*/4*) +@@ -2118,7 +2122,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*) +@@ -2149,7 +2153,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/*) + LINKFORSHARED="$extra_undefs -framework CoreFoundation" +@@ -2320,6 +2324,12 @@ esac + AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 + AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets + ++# Haiku's sockets are stashed in libnetwork. ++case "$ac_sys_system" in ++ Haiku*) ++ AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS);; ++esac ++ + AC_MSG_CHECKING(for --with-libs) + AC_ARG_WITH(libs, + AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs]), +@@ -3654,6 +3664,7 @@ fi], + AC_SUBST(LIBM) + case $ac_sys_system in + Darwin) ;; ++Haiku) ;; + *) LIBM=-lm + esac + AC_MSG_CHECKING(for --with-libm=STRING) +diff --git a/setup.py b/setup.py +index 8269e1c..68d2333 100644 +--- a/setup.py ++++ b/setup.py +@@ -517,6 +517,10 @@ class PyBuildExt(build_ext): + config_h_vars = sysconfig.parse_config_h(file) + + srcdir = sysconfig.get_config_var('srcdir') ++ ++ # Haiku-specific library locations ++ if host_platform == 'haiku1': ++ lib_dirs += ['/boot/system/develop/lib'] + + # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb) + if host_platform in ['osf1', 'unixware7', 'openunix8']: +@@ -544,9 +548,9 @@ class PyBuildExt(build_ext): + if item.startswith('-L'): + lib_dirs.append(item[2:]) + +- # Check for MacOS X, which doesn't need libm.a at all ++ # Check for MacOS X and Haiku, which don't need libm.a at all + math_libs = ['m'] +- if host_platform == 'darwin': ++ if host_platform in ['darwin','haiku1']: + math_libs = [] + + # XXX Omitted modules: gl, pure, dl, SGI-specific modules +@@ -754,15 +758,22 @@ class PyBuildExt(build_ext): + '/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/' + ] ) +@@ -770,8 +781,8 @@ class PyBuildExt(build_ext): + 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: +@@ -811,8 +822,8 @@ class PyBuildExt(build_ext): + # of hash functions from the OpenSSL library. + exts.append( Extension('_hashlib', ['_hashopenssl.c'], + depends = ['hashlib.h'], +- include_dirs = ssl_incs, +- library_dirs = ssl_libs, ++ include_dirs = ssl_incs_to_add, ++ library_dirs = ssl_libs_to_add, + libraries = ['ssl', 'crypto']) ) + else: + print("warning: openssl 0x%08x is too old for _hashlib" % +@@ -1236,7 +1247,7 @@ class PyBuildExt(build_ext): + exts.append( Extension('resource', ['resource.c']) ) + + # Sun yellow pages. Some systems have the functions in libc. +- if (host_platform not in ['cygwin', 'qnx6'] and ++ if (host_platform not in ['cygwin', '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'] +-- +1.8.3.4 + diff --git a/dev-lang/python/python3-3.4.0.recipe b/dev-lang/python/python3-3.4.0.recipe new file mode 100644 index 000000000..6df525ab0 --- /dev/null +++ b/dev-lang/python/python3-3.4.0.recipe @@ -0,0 +1,120 @@ +SUMMARY="An interpreted, interactive, object-oriented programming language" +DESCRIPTION=" +Python is a programming language that lets you work more quickly and integrate \ +your systems more effectively. You can learn to use Python and see almost \ +immediate gains in productivity and lower maintenance costs. +Python runs on Windows, Linux/Unix, Mac OS X, and has been ported to the Java \ +and .NET virtual machines. +Python is free to use, even for commercial products, because of its \ +OSI-approved open source license. +" +HOMEPAGE="http://www.python.org" +LICENSE="Python" +COPYRIGHT="1990-2015, Python Software Foundation" +SRC_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz" +CHECKSUM_SHA256="f13686c0a2d45e7146759e9d5d1cbd8097a0606483c0cf7730e1e13f58b14cbe" +REVISION="1" +ARCHITECTURES="!x86_gcc2 !x86 x86_64" + +PATCHES="python3-3.4.0.patchset" + +PROVIDES=" + python3 = $portVersion compat >= 3.4 + cmd:2to3 = $portVersion compat >= 3.4 + cmd:2to3_3.4 = $portVersion compat >= 3.4 + cmd:idle = $portVersion compat >= 3.4 + cmd:idle3 = $portVersion compat >= 3.4 + cmd:idle3.4 = $portVersion compat >= 3.4 + cmd:pydoc3 = $portVersion compat >= 3.4 + cmd:pydoc3.4 = $portVersion compat >= 3.4 + cmd:python3 = $portVersion compat >= 3.4 + cmd:python3_config = $portVersion compat >= 3.4 + cmd:python3.4 = $portVersion compat >= 3.4 + cmd:python3.4_config = $portVersion compat >= 3.4 + cmd:python3.4m = $portVersion compat >= 3.4 + cmd:python3.4m_config = $portVersion compat >= 3.4 + cmd:pyvenv = $portVersion compat >= 3.4 + cmd:pyvenv_3.4 = $portVersion compat >= 3.4 + devel:libpython3.4m = 1.0 + lib:libpython3.4m = 1.0 + lib:libpython3 = 3.4 + " +REQUIRES=" + haiku >= $haikuVersion + cmd:nano + lib:libbz2 + lib:libncurses + lib:libssl + lib:libreadline + lib:libsqlite3 + lib:libz + " +BUILD_REQUIRES=" + devel:libbz2 + devel:libncurses + devel:libssl + devel:libreadline + devel:libsqlite3 + devel:libz + " +BUILD_PREREQUIRES=" + haiku_devel >= $haikuVersion + cmd:aclocal + cmd:autoconf + cmd:find + cmd:gcc + cmd:ld + cmd:libtoolize + cmd:pkg_config + cmd:make + cmd:nano + cmd:python + " + +SOURCE_DIR="Python-$portVersion" + +GLOBAL_WRITABLE_FILES=" + non-packaged/lib/python3.4/site-packages directory keep-old + " + +BUILD() +{ + cd Modules/_ctypes/libffi + libtoolize --force --copy --install + cd ../../.. + + libtoolize --force --copy --install + aclocal + autoconf + runConfigure ./configure \ + --enable-shared + + # prevent make from rebuilding stuff that requires python + touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h + + make $jobArgs +} + +INSTALL() +{ + make install + + prepareInstalledDevelLibs libpython3.4m + fixPkgconfig + + mkdir -p $prefix/lib/python3.4/vendor-packages + echo 'This directory contains packaged python modules.' \ + >$prefix/lib/python3.4/vendor-packages/README + + mkdir -p $prefix/non-packaged/lib/python3.4 + mv $prefix/lib/python3.4/site-packages $prefix/non-packaged/lib/python3.4/ +} + +TEST() +{ + 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 +}