diff --git a/dev-lang/python/patches/python3-3.6.1.patchset b/dev-lang/python/patches/python3-3.6.1.patchset new file mode 100644 index 000000000..965d5e71c --- /dev/null +++ b/dev-lang/python/patches/python3-3.6.1.patchset @@ -0,0 +1,540 @@ +From 174b88cd6fbb388545efb2e1218d13eb254defa8 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 0258d3d..aaec6e6 100644 +--- a/Lib/distutils/command/install.py ++++ b/Lib/distutils/command/install.py +@@ -43,6 +43,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 +@@ -64,6 +85,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. +@@ -408,10 +437,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: +@@ -427,7 +462,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 8bf1a70..edb302d 100644 +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -102,7 +102,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: +@@ -132,12 +133,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 100644 +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 0fc9200..17596a1 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%d.%d" % sys.version_info[:2], + "site-packages")) +diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py +index 3da210a..e669ce9 100644 +--- a/Lib/test/test_fileio.py ++++ b/Lib/test/test_fileio.py +@@ -378,6 +378,7 @@ class OtherFileTests: + 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', 'aix')): + # Somehow /dev/tty appears seekable on some BSDs + self.assertEqual(f.seekable(), False) +diff --git a/Makefile.pre.in b/Makefile.pre.in +index 8f27d73..06c1b24 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -130,7 +130,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 8f8ba25..ff68780 100644 +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -12729,7 +12729,7 @@ all_ins(PyObject *m) + if (PyModule_AddIntMacro(m, SCHED_RR)) return -1; + #endif + #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 113ad5c..b9de0ab 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, PyLong_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 3, PyLong_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 4, PyLong_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 5, PyLong_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 7, PyLong_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 8, PyLong_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 9, PyLong_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 10, PyLong_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 11, PyLong_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 12, PyLong_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 13, PyLong_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 14, PyLong_FromLong(0)); ++ PyStructSequence_SET_ITEM(result, 15, PyLong_FromLong(0)); ++#endif + if (PyErr_Occurred()) { + Py_DECREF(result); + return NULL; +@@ -330,19 +346,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 + +@@ -354,31 +370,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 f4edc06..d3b47c7 100644 +--- a/Modules/socketmodule.c ++++ b/Modules/socketmodule.c +@@ -6877,7 +6877,9 @@ PyInit__socket(void) + /* SOCK_RAW is marked as optional in the POSIX specification */ + PyModule_AddIntMacro(m, SOCK_RAW); + #endif ++#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 3cce927..6241a7d 100644 +--- a/Modules/socketmodule.h ++++ b/Modules/socketmodule.h +@@ -54,6 +54,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 556a715..5044d19 100644 +--- a/Modules/spwdmodule.c ++++ b/Modules/spwdmodule.c +@@ -87,7 +87,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 ef5a34c..94c4332 100644 +--- a/Python/bltinmodule.c ++++ b/Python/bltinmodule.c +@@ -21,7 +21,7 @@ + Don't forget to modify PyUnicode_DecodeFSDefault() if you touch any of the + values for Py_FileSystemDefaultEncoding! + */ +-#if defined(__APPLE__) ++#if defined(__APPLE__) || defined(__HAIKU__) + const char *Py_FileSystemDefaultEncoding = "utf-8"; + int Py_HasFileSystemDefaultEncoding = 1; + #elif defined(MS_WINDOWS) +diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py +index 4363c0c..40994b0 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 9eacf52..99059f9 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1166,6 +1166,16 @@ if test $enable_shared = "yes"; then + PY3LIBRARY=libpython3.so + fi + ;; ++ Haiku*) ++ LDLIBRARY='libpython$(LDVERSION).so' ++ BLDLIBRARY='-L. -lpython$(LDVERSION)' ++ RUNSHARED=LIBRARY_PATH=`pwd`${LIBRARY_PATH:+:${LIBRARY_PATH}} ++ INSTSONAME="$LDLIBRARY".$SOVERSION ++ if test "$with_pydebug" != yes ++ then ++ PY3LIBRARY=libpython3.so ++ fi ++ ;; + hp*|HP*) + case `uname -m` in + ia64) +@@ -1242,6 +1252,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 +@@ -2478,7 +2489,7 @@ then + BLDSHARED="$LDSHARED" + fi + ;; +- Linux*|GNU*|QNX*) ++ Linux*|GNU*|QNX*|Haiku*) + LDSHARED='$(CC) -shared' + LDCXXSHARED='$(CXX) -shared';; + BSD/OS*/4*) +@@ -2548,7 +2559,7 @@ then + else CCSHARED="+z"; + fi;; + Linux-android*) ;; +- Linux*|GNU*) CCSHARED="-fPIC";; ++ Linux*|GNU*|Haiku*) CCSHARED="-fPIC";; + BSD/OS*/4*) CCSHARED="-fpic";; + FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";; + OpenUNIX*|UnixWare*) +@@ -2580,7 +2591,7 @@ then + # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; + BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; + Linux-android*) LINKFORSHARED="-pie -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" +@@ -2762,6 +2773,12 @@ LDFLAGS="-fsanitize=address $LDFLAGS" + 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]), +@@ -4165,6 +4182,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 f04bf22..718c03a 100644 +--- a/setup.py ++++ b/setup.py +@@ -480,8 +480,8 @@ class PyBuildExt(build_ext): + os.unlink(tmpfile) + + def detect_math_libs(self): +- # Check for MacOS X, which doesn't need libm.a at all +- if host_platform == 'darwin': ++ # Check for MacOS X and Haiku, which doesn't need libm.a at all ++ if host_platform in ['darwin','haiku1']: + return [] + else: + return ['m'] +@@ -564,6 +564,12 @@ 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': ++ inc_dirs += ['/boot/develop/headers/posix', ++ '/boot/system/develop/headers'] ++ 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']: +@@ -815,15 +821,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/' + ] ) +@@ -831,8 +844,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: +@@ -872,8 +885,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" % +@@ -1330,7 +1343,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'] +-- +2.10.2 + diff --git a/dev-lang/python/python3-3.6.1.recipe b/dev-lang/python/python3-3.6.1.recipe new file mode 100644 index 000000000..3130ac5e1 --- /dev/null +++ b/dev-lang/python/python3-3.6.1.recipe @@ -0,0 +1,135 @@ +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-2016, Python Software Foundation" +REVISION="1" +SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz" +CHECKSUM_SHA256="a01810ddfcec216bcdb357a84bfaafdfaa0ca42bbdaa4cb7ff74f5a9961e4041" +SOURCE_DIR="Python-$portVersion" +PATCHES="python3-$portVersion.patchset" + +ARCHITECTURES=" !x86_gcc2 x86 x86_64" +SECONDARY_ARCHITECTURES="!x86" + +# On x86_gcc2 we don't want to install the commands in bin//, but in bin/. +commandSuffix=$secondaryArchSuffix +commandBinDir=$binDir +if [ "$targetArchitecture" = x86_gcc2 ]; then + commandSuffix= + commandBinDir=$prefix/bin +fi + +PROVIDES=" + python3$secondaryArchSuffix = $portVersion compat >= 3.6 + cmd:2to3 = $portVersion compat >= 3.6 + cmd:2to3_3.6 = $portVersion compat >= 3.6 + cmd:idle = $portVersion compat >= 3.6 + cmd:idle3 = $portVersion compat >= 3.6 + cmd:idle3.6 = $portVersion compat >= 3.6 + cmd:pydoc3 = $portVersion compat >= 3.6 + cmd:pydoc3.6 = $portVersion compat >= 3.6 + cmd:python3 = $portVersion compat >= 3.6 + cmd:python3_config = $portVersion compat >= 3.6 + cmd:python3.6 = $portVersion compat >= 3.6 + cmd:python3.6_config = $portVersion compat >= 3.6 + cmd:python3.6m = $portVersion compat >= 3.6 + cmd:python3.6m_config = $portVersion compat >= 3.6 + cmd:pyvenv = $portVersion compat >= 3.6 + cmd:pyvenv_3.6 = $portVersion compat >= 3.6 + devel:libpython3.6m$secondaryArchSuffix = 1.0 + lib:libpython3.6m$secondaryArchSuffix = 1.0 + " +REQUIRES=" + haiku$secondaryArchSuffix + cmd:file + lib:libbz2$secondaryArchSuffix + lib:libexpat$secondaryArchSuffix + lib:libncurses$secondaryArchSuffix + lib:libssl$secondaryArchSuffix + lib:libreadline$secondaryArchSuffix + lib:libsqlite3$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " +BUILD_REQUIRES=" + devel:libbz2$secondaryArchSuffix + devel:libexpat$secondaryArchSuffix + devel:libncurses$secondaryArchSuffix + devel:libssl$secondaryArchSuffix + devel:libreadline$secondaryArchSuffix + devel:libsqlite3$secondaryArchSuffix + devel:libz$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel + cmd:aclocal + cmd:autoconf + cmd:find + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:libtoolize + cmd:pkg_config$secondaryArchSuffix + cmd:make + cmd:python + " + +GLOBAL_WRITABLE_FILES=" + non-packaged/lib/python3.6/site-packages directory keep-old + " + +BUILD() +{ + rm -Rf Modules/zlib Modules/expat + + cd Modules/_ctypes/libffi + libtoolize --force --copy --install + cd ../../.. + + libtoolize --force --copy --install + aclocal + autoconf + runConfigure --omit-dirs binDir ./configure \ + --enable-shared --without-ensurepip \ + --with-system-expat --bindir=$commandBinDir + + # prevent make from rebuilding stuff that requires python + touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h + + rm -f python + + make $jobArgs +} + +INSTALL() +{ + make install + + rm $libDir/libpython3.so + + prepareInstalledDevelLibs libpython3.6m + fixPkgconfig + + mkdir -p $prefix/lib/python3.6/vendor-packages + echo 'This directory contains packaged python modules.' \ + >$prefix/lib/python3.6/vendor-packages/README + + mkdir -p $prefix/non-packaged/lib/python3.6 + mv $prefix/lib/python3.6/site-packages $prefix/non-packaged/lib/python3.6/ +} + +TEST() +{ + cd Lib/test + rm -f test_asynchat.py # this one stalls, so skip it for now + rm -f test_multiprocessing.py # this one stalls, so skip it for now + + python3 regrtest.py +} diff --git a/dev-lang/python/python35-3.5.3.recipe b/dev-lang/python/python35-3.5.3.recipe new file mode 100644 index 000000000..28fcc66d8 --- /dev/null +++ b/dev-lang/python/python35-3.5.3.recipe @@ -0,0 +1,129 @@ +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-2017, Python Software Foundation" +REVISION="1" +SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz" +CHECKSUM_SHA256="eefe2ad6575855423ab630f5b51a8ef6e5556f774584c06beab4926f930ddbb0" +SOURCE_DIR="Python-$portVersion" +PATCHES="python3-$portVersion.patchset" + +ARCHITECTURES="!x86_gcc2 x86 ?x86_64" +SECONDARY_ARCHITECTURES="!x86" + + +# On x86_gcc2 we don't want to install the commands in bin//, but in bin/. +commandSuffix=$secondaryArchSuffix +commandBinDir=$binDir +if [ "$targetArchitecture" = x86_gcc2 ]; then + commandSuffix= + commandBinDir=$prefix/bin +fi + +PROVIDES=" + python35$secondaryArchSuffix = $portVersion compat >= 3.5 + cmd:2to3_3.5 = $portVersion compat >= 3.5 + cmd:idle3.5 = $portVersion compat >= 3.5 + cmd:pydoc3.5 = $portVersion compat >= 3.5 + cmd:python3.5 = $portVersion compat >= 3.5 + cmd:python3.5_config = $portVersion compat >= 3.5 + cmd:python3.5m = $portVersion compat >= 3.5 + cmd:python3.5m_config = $portVersion compat >= 3.5 + cmd:pyvenv_3.5 = $portVersion compat >= 3.5 + devel:libpython3.5m$secondaryArchSuffix = 1.0 + lib:libpython3.5m$secondaryArchSuffix = 1.0 + " +REQUIRES=" + haiku$secondaryArchSuffix + cmd:file + lib:libbz2$secondaryArchSuffix + lib:libexpat$secondaryArchSuffix + lib:libncurses$secondaryArchSuffix + lib:libssl$secondaryArchSuffix + lib:libreadline$secondaryArchSuffix + lib:libsqlite3$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " +BUILD_REQUIRES=" + devel:libbz2$secondaryArchSuffix + devel:libexpat$secondaryArchSuffix + devel:libncurses$secondaryArchSuffix + devel:libssl$secondaryArchSuffix + devel:libreadline$secondaryArchSuffix + devel:libsqlite3$secondaryArchSuffix + devel:libz$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel + cmd:aclocal + cmd:autoconf + cmd:find + cmd:gcc$secondaryArchSuffix + cmd:ld$secondaryArchSuffix + cmd:libtoolize + cmd:pkg_config$secondaryArchSuffix + cmd:make + cmd:python + " + +GLOBAL_WRITABLE_FILES=" + non-packaged/lib/python3.5/site-packages directory keep-old + " + +BUILD() +{ + rm -Rf Modules/zlib Modules/expat + + cd Modules/_ctypes/libffi + libtoolize --force --copy --install + cd ../../.. + + libtoolize --force --copy --install + aclocal + autoconf + runConfigure --omit-dirs binDir ./configure \ + --enable-shared --without-ensurepip \ + --with-system-expat --bindir=$commandBinDir + + # prevent make from rebuilding stuff that requires python + touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h + + rm -f python + + make $jobArgs +} + +INSTALL() +{ + make altinstall maninstall + + rm $libDir/libpython3.so $manDir/man1/python3.1 + + prepareInstalledDevelLibs libpython3.5m + fixPkgconfig + + mkdir -p $prefix/lib/python3.5/vendor-packages + echo 'This directory contains packaged python modules.' \ + >$prefix/lib/python3.5/vendor-packages/README + + mkdir -p $prefix/non-packaged/lib/python3.5 + mv $prefix/lib/python3.5/site-packages $prefix/non-packaged/lib/python3.5/ +} + +TEST() +{ + cd Lib/test + rm -f test_asynchat.py # this one stalls, so skip it for now + rm -f test_multiprocessing.py # this one stalls, so skip it for now + + python3.5 regrtest.py +}