diff --git a/dev-lang/python/patches/python-2.7.12.patchset b/dev-lang/python/patches/python-2.7.12.patchset deleted file mode 100644 index 7749dfb81..000000000 --- a/dev-lang/python/patches/python-2.7.12.patchset +++ /dev/null @@ -1,1008 +0,0 @@ -From c0a96d9df40b6b648dede4fd54ce52c6bef67e1e Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Wed, 12 Mar 2014 21:17:06 +0000 -Subject: initial Haiku patch - - -diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py -index b9f1c6c..7be61d3 100644 ---- a/Lib/distutils/command/install.py -+++ b/Lib/distutils/command/install.py -@@ -83,6 +83,35 @@ 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', -+ }, -+ - } - - # The keys to an installation scheme; if any new types of files are to be -@@ -416,10 +445,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: -@@ -435,7 +470,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 de7da1d..8180c8e 100644 ---- a/Lib/distutils/sysconfig.py -+++ b/Lib/distutils/sysconfig.py -@@ -90,7 +90,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 -- return os.path.join(prefix, "include", "python" + get_python_version()) -+ inc_dir = "include" if sys.platform != "haiku1" else "develop/headers" -+ return os.path.join(prefix, inc_dir, "python" + get_python_version()) - elif os.name == "nt": - return os.path.join(prefix, "include") - elif os.name == "os2": -@@ -119,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/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 -+ -+# Included from socket.h -+ -+# Included from BeBuild.h -+B_BEOS_VERSION_4 = 0x0400 -+B_BEOS_VERSION_4_5 = 0x0450 -+B_BEOS_VERSION_5 = 0x0500 -+B_BEOS_VERSION = B_BEOS_VERSION_5 -+B_BEOS_VERSION_MAUI = B_BEOS_VERSION_5 -+_PR2_COMPATIBLE_ = 1 -+_PR3_COMPATIBLE_ = 1 -+_R4_COMPATIBLE_ = 1 -+_R4_5_COMPATIBLE_ = 1 -+_PR2_COMPATIBLE_ = 0 -+_PR3_COMPATIBLE_ = 0 -+_R4_COMPATIBLE_ = 1 -+_R4_5_COMPATIBLE_ = 1 -+def _UNUSED(x): return x -+ -+ -+# Included from sys/types.h -+ -+# Included from time.h -+ -+# Included from be_setup.h -+def __std(ref): return ref -+ -+__be_os = 2 -+__dest_os = __be_os -+__MSL__ = 0x4011 -+__GLIBC__ = -2 -+__GLIBC_MINOR__ = 1 -+ -+# Included from null.h -+NULL = (0) -+NULL = 0L -+ -+# Included from size_t.h -+ -+# Included from stddef.h -+ -+# Included from wchar_t.h -+CLOCKS_PER_SEC = 1000 -+CLK_TCK = CLOCKS_PER_SEC -+MAX_TIMESTR = 70 -+ -+# Included from sys/time.h -+ -+# Included from ByteOrder.h -+ -+# Included from endian.h -+__LITTLE_ENDIAN = 1234 -+LITTLE_ENDIAN = __LITTLE_ENDIAN -+__BYTE_ORDER = __LITTLE_ENDIAN -+BYTE_ORDER = __BYTE_ORDER -+__BIG_ENDIAN = 0 -+BIG_ENDIAN = 0 -+__BIG_ENDIAN = 4321 -+BIG_ENDIAN = __BIG_ENDIAN -+__BYTE_ORDER = __BIG_ENDIAN -+BYTE_ORDER = __BYTE_ORDER -+__LITTLE_ENDIAN = 0 -+LITTLE_ENDIAN = 0 -+__PDP_ENDIAN = 3412 -+PDP_ENDIAN = __PDP_ENDIAN -+ -+# Included from SupportDefs.h -+ -+# Included from Errors.h -+ -+# Included from limits.h -+ -+# Included from float.h -+FLT_ROUNDS = 1 -+FLT_RADIX = 2 -+FLT_MANT_DIG = 24 -+FLT_DIG = 6 -+FLT_MIN_EXP = (-125) -+FLT_MIN_10_EXP = (-37) -+FLT_MAX_EXP = 128 -+FLT_MAX_10_EXP = 38 -+DBL_MANT_DIG = 53 -+DBL_DIG = 15 -+DBL_MIN_EXP = (-1021) -+DBL_MIN_10_EXP = (-308) -+DBL_MAX_EXP = 1024 -+DBL_MAX_10_EXP = 308 -+LDBL_MANT_DIG = DBL_MANT_DIG -+LDBL_DIG = DBL_DIG -+LDBL_MIN_EXP = DBL_MIN_EXP -+LDBL_MIN_10_EXP = DBL_MIN_10_EXP -+LDBL_MAX_EXP = DBL_MAX_EXP -+LDBL_MAX_10_EXP = DBL_MAX_10_EXP -+CHAR_BIT = (8) -+SCHAR_MIN = (-127-1) -+SCHAR_MAX = (127) -+CHAR_MIN = SCHAR_MIN -+CHAR_MAX = SCHAR_MAX -+MB_LEN_MAX = (1) -+SHRT_MIN = (-32767-1) -+SHRT_MAX = (32767) -+LONG_MIN = (-2147483647L-1) -+LONG_MAX = (2147483647L) -+INT_MIN = LONG_MIN -+INT_MAX = LONG_MAX -+ARG_MAX = (32768) -+ATEXIT_MAX = (32) -+CHILD_MAX = (1024) -+IOV_MAX = (256) -+FILESIZEBITS = (64) -+LINK_MAX = (1) -+LOGIN_NAME_MAX = (32) -+MAX_CANON = (255) -+MAX_INPUT = (255) -+NAME_MAX = (256) -+NGROUPS_MAX = (32) -+OPEN_MAX = (128) -+PATH_MAX = (1024) -+PIPE_MAX = (512) -+SSIZE_MAX = (2147483647L) -+TTY_NAME_MAX = (256) -+TZNAME_MAX = (32) -+SYMLINKS_MAX = (16) -+_POSIX_ARG_MAX = (32768) -+_POSIX_CHILD_MAX = (1024) -+_POSIX_LINK_MAX = (1) -+_POSIX_LOGIN_NAME_MAX = (9) -+_POSIX_MAX_CANON = (255) -+_POSIX_MAX_INPUT = (255) -+_POSIX_NAME_MAX = (255) -+_POSIX_NGROUPS_MAX = (0) -+_POSIX_OPEN_MAX = (128) -+_POSIX_PATH_MAX = (1024) -+_POSIX_PIPE_BUF = (512) -+_POSIX_SSIZE_MAX = (2147483647L) -+_POSIX_STREAM_MAX = (8) -+_POSIX_TTY_NAME_MAX = (256) -+_POSIX_TZNAME_MAX = (3) -+B_GENERAL_ERROR_BASE = LONG_MIN -+B_OS_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x1000 -+B_APP_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x2000 -+B_INTERFACE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x3000 -+B_MEDIA_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4000 -+B_TRANSLATION_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4800 -+B_MIDI_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x5000 -+B_STORAGE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x6000 -+B_POSIX_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x7000 -+B_MAIL_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x8000 -+B_PRINT_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x9000 -+B_DEVICE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0xa000 -+B_ERRORS_END = (B_GENERAL_ERROR_BASE + 0xffff) -+E2BIG = (B_POSIX_ERROR_BASE + 1) -+ECHILD = (B_POSIX_ERROR_BASE + 2) -+EDEADLK = (B_POSIX_ERROR_BASE + 3) -+EFBIG = (B_POSIX_ERROR_BASE + 4) -+EMLINK = (B_POSIX_ERROR_BASE + 5) -+ENFILE = (B_POSIX_ERROR_BASE + 6) -+ENODEV = (B_POSIX_ERROR_BASE + 7) -+ENOLCK = (B_POSIX_ERROR_BASE + 8) -+ENOSYS = (B_POSIX_ERROR_BASE + 9) -+ENOTTY = (B_POSIX_ERROR_BASE + 10) -+ENXIO = (B_POSIX_ERROR_BASE + 11) -+ESPIPE = (B_POSIX_ERROR_BASE + 12) -+ESRCH = (B_POSIX_ERROR_BASE + 13) -+EFPOS = (B_POSIX_ERROR_BASE + 14) -+ESIGPARM = (B_POSIX_ERROR_BASE + 15) -+EDOM = (B_POSIX_ERROR_BASE + 16) -+ERANGE = (B_POSIX_ERROR_BASE + 17) -+EPROTOTYPE = (B_POSIX_ERROR_BASE + 18) -+EPROTONOSUPPORT = (B_POSIX_ERROR_BASE + 19) -+EPFNOSUPPORT = (B_POSIX_ERROR_BASE + 20) -+EAFNOSUPPORT = (B_POSIX_ERROR_BASE + 21) -+EADDRINUSE = (B_POSIX_ERROR_BASE + 22) -+EADDRNOTAVAIL = (B_POSIX_ERROR_BASE + 23) -+ENETDOWN = (B_POSIX_ERROR_BASE + 24) -+ENETUNREACH = (B_POSIX_ERROR_BASE + 25) -+ENETRESET = (B_POSIX_ERROR_BASE + 26) -+ECONNABORTED = (B_POSIX_ERROR_BASE + 27) -+ECONNRESET = (B_POSIX_ERROR_BASE + 28) -+EISCONN = (B_POSIX_ERROR_BASE + 29) -+ENOTCONN = (B_POSIX_ERROR_BASE + 30) -+ESHUTDOWN = (B_POSIX_ERROR_BASE + 31) -+ECONNREFUSED = (B_POSIX_ERROR_BASE + 32) -+EHOSTUNREACH = (B_POSIX_ERROR_BASE + 33) -+ENOPROTOOPT = (B_POSIX_ERROR_BASE + 34) -+ENOBUFS = (B_POSIX_ERROR_BASE + 35) -+EINPROGRESS = (B_POSIX_ERROR_BASE + 36) -+EALREADY = (B_POSIX_ERROR_BASE + 37) -+EILSEQ = (B_POSIX_ERROR_BASE + 38) -+ENOMSG = (B_POSIX_ERROR_BASE + 39) -+ESTALE = (B_POSIX_ERROR_BASE + 40) -+EOVERFLOW = (B_POSIX_ERROR_BASE + 41) -+EMSGSIZE = (B_POSIX_ERROR_BASE + 42) -+EOPNOTSUPP = (B_POSIX_ERROR_BASE + 43) -+ENOTSOCK = (B_POSIX_ERROR_BASE + 44) -+false = 0 -+true = 1 -+NULL = (0) -+FALSE = 0 -+TRUE = 1 -+ -+# Included from TypeConstants.h -+B_HOST_IS_LENDIAN = 1 -+B_HOST_IS_BENDIAN = 0 -+def B_HOST_TO_LENDIAN_DOUBLE(arg): return (double)(arg) -+ -+def B_HOST_TO_LENDIAN_FLOAT(arg): return (float)(arg) -+ -+def B_HOST_TO_LENDIAN_INT64(arg): return (uint64)(arg) -+ -+def B_HOST_TO_LENDIAN_INT32(arg): return (uint32)(arg) -+ -+def B_HOST_TO_LENDIAN_INT16(arg): return (uint16)(arg) -+ -+def B_HOST_TO_BENDIAN_DOUBLE(arg): return __swap_double(arg) -+ -+def B_HOST_TO_BENDIAN_FLOAT(arg): return __swap_float(arg) -+ -+def B_HOST_TO_BENDIAN_INT64(arg): return __swap_int64(arg) -+ -+def B_HOST_TO_BENDIAN_INT32(arg): return __swap_int32(arg) -+ -+def B_HOST_TO_BENDIAN_INT16(arg): return __swap_int16(arg) -+ -+def B_LENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg) -+ -+def B_LENDIAN_TO_HOST_FLOAT(arg): return (float)(arg) -+ -+def B_LENDIAN_TO_HOST_INT64(arg): return (uint64)(arg) -+ -+def B_LENDIAN_TO_HOST_INT32(arg): return (uint32)(arg) -+ -+def B_LENDIAN_TO_HOST_INT16(arg): return (uint16)(arg) -+ -+def B_BENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg) -+ -+def B_BENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg) -+ -+def B_BENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg) -+ -+def B_BENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg) -+ -+def B_BENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg) -+ -+B_HOST_IS_LENDIAN = 0 -+B_HOST_IS_BENDIAN = 1 -+def B_HOST_TO_LENDIAN_DOUBLE(arg): return __swap_double(arg) -+ -+def B_HOST_TO_LENDIAN_FLOAT(arg): return __swap_float(arg) -+ -+def B_HOST_TO_LENDIAN_INT64(arg): return __swap_int64(arg) -+ -+def B_HOST_TO_LENDIAN_INT32(arg): return __swap_int32(arg) -+ -+def B_HOST_TO_LENDIAN_INT16(arg): return __swap_int16(arg) -+ -+def B_HOST_TO_BENDIAN_DOUBLE(arg): return (double)(arg) -+ -+def B_HOST_TO_BENDIAN_FLOAT(arg): return (float)(arg) -+ -+def B_HOST_TO_BENDIAN_INT64(arg): return (uint64)(arg) -+ -+def B_HOST_TO_BENDIAN_INT32(arg): return (uint32)(arg) -+ -+def B_HOST_TO_BENDIAN_INT16(arg): return (uint16)(arg) -+ -+def B_LENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg) -+ -+def B_LENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg) -+ -+def B_LENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg) -+ -+def B_LENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg) -+ -+def B_LENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg) -+ -+def B_BENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg) -+ -+def B_BENDIAN_TO_HOST_FLOAT(arg): return (float)(arg) -+ -+def B_BENDIAN_TO_HOST_INT64(arg): return (uint64)(arg) -+ -+def B_BENDIAN_TO_HOST_INT32(arg): return (uint32)(arg) -+ -+def B_BENDIAN_TO_HOST_INT16(arg): return (uint16)(arg) -+ -+def B_SWAP_DOUBLE(arg): return __swap_double(arg) -+ -+def B_SWAP_FLOAT(arg): return __swap_float(arg) -+ -+def B_SWAP_INT64(arg): return __swap_int64(arg) -+ -+def B_SWAP_INT32(arg): return __swap_int32(arg) -+ -+def B_SWAP_INT16(arg): return __swap_int16(arg) -+ -+def htonl(x): return B_HOST_TO_BENDIAN_INT32(x) -+ -+def ntohl(x): return B_BENDIAN_TO_HOST_INT32(x) -+ -+def htons(x): return B_HOST_TO_BENDIAN_INT16(x) -+ -+def ntohs(x): return B_BENDIAN_TO_HOST_INT16(x) -+ -+AF_INET = 1 -+INADDR_ANY = 0x00000000 -+INADDR_BROADCAST = 0xffffffff -+INADDR_LOOPBACK = 0x7f000001 -+SOL_SOCKET = 1 -+SO_DEBUG = 1 -+SO_REUSEADDR = 2 -+SO_NONBLOCK = 3 -+SO_REUSEPORT = 4 -+MSG_OOB = 0x1 -+SOCK_DGRAM = 1 -+SOCK_STREAM = 2 -+IPPROTO_UDP = 1 -+IPPROTO_TCP = 2 -+IPPROTO_ICMP = 3 -+B_UDP_MAX_SIZE = (65536 - 1024) -+FD_SETSIZE = 256 -+FDSETSIZE = FD_SETSIZE -+NFDBITS = 32 -+def _FDMSKNO(fd): return ((fd) / NFDBITS) -+ -+def _FDBITNO(fd): return ((fd) % NFDBITS) -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 -+ -+H2PY=../../Tools/scripts/h2py.py -+HEADERS=/boot/develop/headers -+ -+set -v -+python $H2PY -i '(u_long)' $HEADERS/posix/netinet/in.h -diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py -index e21e47f..7baf562 100644 ---- a/Lib/test/test_fileio.py -+++ b/Lib/test/test_fileio.py -@@ -308,6 +308,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/Modules/resource.c b/Modules/resource.c -index 53a6c3e..6c5f52f 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))); -+#ifndef __HAIKU__ - 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,6 +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)); -+#endif - - if (PyErr_Occurred()) { - Py_DECREF(result); -diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c -index 5def531..5e3e5cc 100644 ---- a/Modules/socketmodule.c -+++ b/Modules/socketmodule.c -@@ -4871,7 +4871,9 @@ init_socket(void) - #ifndef __BEOS__ - /* We have incomplete socket support. */ - PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW); -+#ifndef __HAIKU__ - PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET); -+#endif - #if defined(SOCK_RDM) - PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM); - #endif -diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h -index d98e00e..2bfb3dc 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 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); -+#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/Modules/timemodule.c b/Modules/timemodule.c -index 12c43b0..206b325 100644 ---- a/Modules/timemodule.c -+++ b/Modules/timemodule.c -@@ -1006,11 +1006,11 @@ floatsleep(double secs) - 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 --git a/Python/bltinmodule.c b/Python/bltinmodule.c -index f052574..6a77f0d 100644 ---- a/Python/bltinmodule.c -+++ b/Python/bltinmodule.c -@@ -19,7 +19,7 @@ - */ - #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) - const char *Py_FileSystemDefaultEncoding = "mbcs"; --#elif defined(__APPLE__) -+#elif defined(__APPLE__) || defined(__HAIKU__) - const char *Py_FileSystemDefaultEncoding = "utf-8"; - #else - const char *Py_FileSystemDefaultEncoding = NULL; /* use default */ -diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py -index 40b1bce..4185370 100755 ---- a/Tools/scripts/h2py.py -+++ b/Tools/scripts/h2py.py -@@ -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.ac b/configure.ac -index 78fe3c7..09f4249 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -889,7 +889,7 @@ if test $enable_shared = "yes"; then - RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} - INSTSONAME="$LDLIBRARY".$SOVERSION - ;; -- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) -+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|Haiku*) - LDLIBRARY='libpython$(VERSION).so' - BLDLIBRARY='-L. -lpython$(VERSION)' - RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} -@@ -897,6 +897,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 - ;; -@@ -1012,7 +1015,7 @@ AC_PROG_MKDIR_P - 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;; -@@ -2036,7 +2039,7 @@ then - BLDSHARED="$LDSHARED" - fi - ;; -- Linux*|GNU*|QNX*) -+ Linux*|GNU*|QNX*|Haiku*) - LDSHARED='$(CC) -shared' - LDCXXSHARED='$(CXX) -shared';; - BSD/OS*/4*) -@@ -2108,7 +2111,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*) -@@ -2140,7 +2143,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, -@@ -2258,14 +2261,16 @@ case "$ac_sys_system" in - esac - - # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. --# BeOS' sockets are stashed in libnet. - AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 - AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets - -+# BeOS' sockets are stashed in libnet. -+# Haiku's sockets are stashed in libnetwork. - case "$ac_sys_system" in --BeOS*) --AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS --;; -+ BeOS*) -+ AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS);; -+ Haiku*) -+ AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS);; - esac - - AC_MSG_CHECKING(for --with-libs) -@@ -3602,7 +3607,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 6a6ad23..6bc6782 100644 ---- a/setup.py -+++ b/setup.py -@@ -525,6 +525,12 @@ class PyBuildExt(build_ext): - lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) - inc_dirs += ['/system/include', '/atheos/autolnk/include'] - inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) -+ -+ # Haiku-specific include and 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']: -@@ -553,7 +559,7 @@ class PyBuildExt(build_ext): - - # Check for MacOS X, which doesn't need libm.a at all - math_libs = ['m'] -- if host_platform in ['darwin', 'beos']: -+ if host_platform in ['darwin', 'beos', 'haiku1']: - math_libs = [] - - # XXX Omitted modules: gl, pure, dl, SGI-specific modules -@@ -792,15 +798,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/' - ] ) -@@ -808,8 +821,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: -@@ -847,8 +860,8 @@ class PyBuildExt(build_ext): - # 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']) ) - else: - print ("warning: openssl 0x%08x is too old for _hashlib" % -@@ -1327,7 +1340,7 @@ class PyBuildExt(build_ext): - missing.append('resource') - - # Sun yellow pages. Some systems have the functions in libc. -- if (host_platform not in ['cygwin', 'atheos', 'qnx6'] and -+ if (host_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'] --- -1.8.3.4 - - -From 8348c402f7f409e3024c78381c1d4e1f842ae448 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sat, 5 Apr 2014 21:16:40 +0000 -Subject: fix pyconfig.h path - - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index b3b2b36..77340fd 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -105,7 +105,7 @@ BINDIR= @bindir@ - LIBDIR= @libdir@ - MANDIR= @mandir@ - INCLUDEDIR= @includedir@ --CONFINCLUDEDIR= $(exec_prefix)/include -+CONFINCLUDEDIR= $(INCLUDEDIR) - SCRIPTDIR= $(prefix)/lib - - # Detailed destination directories --- -1.8.3.4 - - -From 2f77b7b4f848d6b85cffa3f31c5f1c0026b64e64 Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Wed, 18 Jun 2014 12:19:13 +0000 -Subject: Import missed change from the 2.6.9 patches - -This makes our site- and vendor- packages work properly again. -It's sill missing the changes to addusersitepackages. This method was apparently refactored, and I don't have enough Python knowledge to redo our changes in the new code. User packages will not workas -expected with -this version of Python. - -diff --git a/Lib/site.py b/Lib/site.py -index 4a09f3c..4b6e01e 100644 ---- a/Lib/site.py -+++ b/Lib/site.py -@@ -287,6 +287,13 @@ def getsitepackages(): - - if sys.platform in ('os2emx', 'riscos'): - sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) -+ elif 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], --- -1.8.3.4 - - -From ef5bdbe6e87e4b5ad6b541c65051f8f13e392676 Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Sun, 21 Sep 2014 18:59:44 +0200 -Subject: gcc2 fix. - - -diff --git a/Modules/_ctypes/libffi/include/ffi_common.h b/Modules/_ctypes/libffi/include/ffi_common.h -index 37f5a9e..37b0b25 100644 ---- a/Modules/_ctypes/libffi/include/ffi_common.h -+++ b/Modules/_ctypes/libffi/include/ffi_common.h -@@ -119,7 +119,7 @@ typedef signed int SINT64 __attribute__((__mode__(__DI__))); - - typedef float FLOAT32; - --#ifndef __GNUC__ -+#if !defined(__GNUC__) || __GNUC__ < 3 - #define __builtin_expect(x, expected_value) (x) - #endif - #define LIKELY(x) __builtin_expect(!!(x),1) --- -1.8.3.4 - - -From 529eb791f594d7559a63b6088efea078fa012e7f Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Fri, 28 Nov 2014 16:26:28 +0000 -Subject: tarfile: let link fail and catch exception. - - -diff --git a/Lib/tarfile.py b/Lib/tarfile.py -index 082f361..4451189 100644 ---- a/Lib/tarfile.py -+++ b/Lib/tarfile.py -@@ -2263,7 +2263,7 @@ class TarFile(object): - (platform limitation), we try to make a copy of the referenced file - instead of a link. - """ -- if hasattr(os, "symlink") and hasattr(os, "link"): -+ try: - # For systems that support symbolic and hard links. - if tarinfo.issym(): - if os.path.lexists(targetpath): -@@ -2277,7 +2277,7 @@ class TarFile(object): - os.link(tarinfo._link_target, targetpath) - else: - self._extract_member(self._find_link_target(tarinfo), targetpath) -- else: -+ except (os.error, AttributeError): - try: - self._extract_member(self._find_link_target(tarinfo), targetpath) - except KeyError: --- -1.8.3.4 - - -From 2f5996ce4a51079584b6d7b4d1dfba9e8e8fb018 Mon Sep 17 00:00:00 2001 -From: Timothy Gu -Date: Sun, 11 Jan 2015 18:18:22 -0800 -Subject: Fix resource module after the initial haiku patch - - -diff --git a/Modules/resource.c b/Modules/resource.c -index 6c5f52f..73758bb 100644 ---- a/Modules/resource.c -+++ b/Modules/resource.c -@@ -101,6 +101,21 @@ 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)); -+#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()) { --- -1.8.3.4 - - -From 57c574a0ce25088f026dffbb9abc06f7b7610a98 Mon Sep 17 00:00:00 2001 -From: Timothy Gu -Date: Sun, 11 Jan 2015 18:40:43 -0800 -Subject: resource: Fix [gs]et_rlimit() modes detection - -Haiku defines many of them, but they are actually empty stubs that will always -return EINVAL. No better way of doing this. - -diff --git a/Modules/resource.c b/Modules/resource.c -index 73758bb..0c396f6 100644 ---- a/Modules/resource.c -+++ b/Modules/resource.c -@@ -284,19 +284,19 @@ initresource(void) - (PyObject*) &StructRUsageType); - - /* insert constants */ --#ifdef RLIMIT_CPU -+#if !defined(__HAIKU__) && defined(RLIMIT_CPU) - PyModule_AddIntConstant(m, "RLIMIT_CPU", RLIMIT_CPU); - #endif - --#ifdef RLIMIT_FSIZE -+#if !defined(__HAIKU__) && defined(RLIMIT_FSIZE) - PyModule_AddIntConstant(m, "RLIMIT_FSIZE", RLIMIT_FSIZE); - #endif - --#ifdef RLIMIT_DATA -+#if !defined(__HAIKU__) && defined(RLIMIT_DATA) - PyModule_AddIntConstant(m, "RLIMIT_DATA", RLIMIT_DATA); - #endif - --#ifdef RLIMIT_STACK -+#if !defined(__HAIKU__) && defined(RLIMIT_STACK) - PyModule_AddIntConstant(m, "RLIMIT_STACK", RLIMIT_STACK); - #endif - -@@ -308,31 +308,31 @@ initresource(void) - PyModule_AddIntConstant(m, "RLIMIT_NOFILE", RLIMIT_NOFILE); - #endif - --#ifdef RLIMIT_OFILE -+#if !defined(__HAIKU__) && defined(RLIMIT_OFILE) - PyModule_AddIntConstant(m, "RLIMIT_OFILE", RLIMIT_OFILE); - #endif - --#ifdef RLIMIT_VMEM -+#if !defined(__HAIKU__) && defined(RLIMIT_VMEM) - PyModule_AddIntConstant(m, "RLIMIT_VMEM", RLIMIT_VMEM); - #endif - --#ifdef RLIMIT_AS -+#if !defined(__HAIKU__) && defined(RLIMIT_AS) - PyModule_AddIntConstant(m, "RLIMIT_AS", RLIMIT_AS); - #endif - --#ifdef RLIMIT_RSS -+#if !defined(__HAIKU__) && defined(RLIMIT_RSS) - PyModule_AddIntConstant(m, "RLIMIT_RSS", RLIMIT_RSS); - #endif - --#ifdef RLIMIT_NPROC -+#if !defined(__HAIKU__) && defined(RLIMIT_NPROC) - PyModule_AddIntConstant(m, "RLIMIT_NPROC", RLIMIT_NPROC); - #endif - --#ifdef RLIMIT_MEMLOCK -+#if !defined(__HAIKU__) && defined(RLIMIT_MEMLOCK) - PyModule_AddIntConstant(m, "RLIMIT_MEMLOCK", RLIMIT_MEMLOCK); - #endif - --#ifdef RLIMIT_SBSIZE -+#if !defined(__HAIKU__) && defined(RLIMIT_SBSIZE) - PyModule_AddIntConstant(m, "RLIMIT_SBSIZE", RLIMIT_SBSIZE); - #endif - --- -1.8.3.4 - - -From d9e84b7fdfc5a049e471f63ea49763785b574ee7 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Tue, 26 May 2015 19:39:55 +0000 -Subject: Haiku hasn't makedev(), _PyInt_FromDev isn't defined. - - -diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c -index 4e86d32..ffe0db1 100644 ---- a/Modules/posixmodule.c -+++ b/Modules/posixmodule.c -@@ -1483,6 +1483,8 @@ _pystat_fromstructstat(STRUCT_STAT *st) - #endif - #ifdef MS_WINDOWS - PyStructSequence_SET_ITEM(v, 2, PyLong_FromUnsignedLong(st->st_dev)); -+#elif defined(__HAIKU__) -+ PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong(st->st_dev)); - #else - PyStructSequence_SET_ITEM(v, 2, _PyInt_FromDev(st->st_dev)); - #endif --- -1.8.3.4 - diff --git a/dev-lang/python/patches/python-2.7.13.patchset b/dev-lang/python/patches/python-2.7.13.patchset deleted file mode 100644 index 36d00cd67..000000000 --- a/dev-lang/python/patches/python-2.7.13.patchset +++ /dev/null @@ -1,1123 +0,0 @@ -From c612225170a65eb865430ced699feb7a98da7c46 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Wed, 12 Mar 2014 21:17:06 +0000 -Subject: initial Haiku patch - - -diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py -index b9f1c6c..7be61d3 100644 ---- a/Lib/distutils/command/install.py -+++ b/Lib/distutils/command/install.py -@@ -83,6 +83,35 @@ 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', -+ }, -+ - } - - # The keys to an installation scheme; if any new types of files are to be -@@ -416,10 +445,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: -@@ -435,7 +470,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 de7da1d..8180c8e 100644 ---- a/Lib/distutils/sysconfig.py -+++ b/Lib/distutils/sysconfig.py -@@ -90,7 +90,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 -- return os.path.join(prefix, "include", "python" + get_python_version()) -+ inc_dir = "include" if sys.platform != "haiku1" else "develop/headers" -+ return os.path.join(prefix, inc_dir, "python" + get_python_version()) - elif os.name == "nt": - return os.path.join(prefix, "include") - elif os.name == "os2": -@@ -119,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/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 -+ -+# Included from socket.h -+ -+# Included from BeBuild.h -+B_BEOS_VERSION_4 = 0x0400 -+B_BEOS_VERSION_4_5 = 0x0450 -+B_BEOS_VERSION_5 = 0x0500 -+B_BEOS_VERSION = B_BEOS_VERSION_5 -+B_BEOS_VERSION_MAUI = B_BEOS_VERSION_5 -+_PR2_COMPATIBLE_ = 1 -+_PR3_COMPATIBLE_ = 1 -+_R4_COMPATIBLE_ = 1 -+_R4_5_COMPATIBLE_ = 1 -+_PR2_COMPATIBLE_ = 0 -+_PR3_COMPATIBLE_ = 0 -+_R4_COMPATIBLE_ = 1 -+_R4_5_COMPATIBLE_ = 1 -+def _UNUSED(x): return x -+ -+ -+# Included from sys/types.h -+ -+# Included from time.h -+ -+# Included from be_setup.h -+def __std(ref): return ref -+ -+__be_os = 2 -+__dest_os = __be_os -+__MSL__ = 0x4011 -+__GLIBC__ = -2 -+__GLIBC_MINOR__ = 1 -+ -+# Included from null.h -+NULL = (0) -+NULL = 0L -+ -+# Included from size_t.h -+ -+# Included from stddef.h -+ -+# Included from wchar_t.h -+CLOCKS_PER_SEC = 1000 -+CLK_TCK = CLOCKS_PER_SEC -+MAX_TIMESTR = 70 -+ -+# Included from sys/time.h -+ -+# Included from ByteOrder.h -+ -+# Included from endian.h -+__LITTLE_ENDIAN = 1234 -+LITTLE_ENDIAN = __LITTLE_ENDIAN -+__BYTE_ORDER = __LITTLE_ENDIAN -+BYTE_ORDER = __BYTE_ORDER -+__BIG_ENDIAN = 0 -+BIG_ENDIAN = 0 -+__BIG_ENDIAN = 4321 -+BIG_ENDIAN = __BIG_ENDIAN -+__BYTE_ORDER = __BIG_ENDIAN -+BYTE_ORDER = __BYTE_ORDER -+__LITTLE_ENDIAN = 0 -+LITTLE_ENDIAN = 0 -+__PDP_ENDIAN = 3412 -+PDP_ENDIAN = __PDP_ENDIAN -+ -+# Included from SupportDefs.h -+ -+# Included from Errors.h -+ -+# Included from limits.h -+ -+# Included from float.h -+FLT_ROUNDS = 1 -+FLT_RADIX = 2 -+FLT_MANT_DIG = 24 -+FLT_DIG = 6 -+FLT_MIN_EXP = (-125) -+FLT_MIN_10_EXP = (-37) -+FLT_MAX_EXP = 128 -+FLT_MAX_10_EXP = 38 -+DBL_MANT_DIG = 53 -+DBL_DIG = 15 -+DBL_MIN_EXP = (-1021) -+DBL_MIN_10_EXP = (-308) -+DBL_MAX_EXP = 1024 -+DBL_MAX_10_EXP = 308 -+LDBL_MANT_DIG = DBL_MANT_DIG -+LDBL_DIG = DBL_DIG -+LDBL_MIN_EXP = DBL_MIN_EXP -+LDBL_MIN_10_EXP = DBL_MIN_10_EXP -+LDBL_MAX_EXP = DBL_MAX_EXP -+LDBL_MAX_10_EXP = DBL_MAX_10_EXP -+CHAR_BIT = (8) -+SCHAR_MIN = (-127-1) -+SCHAR_MAX = (127) -+CHAR_MIN = SCHAR_MIN -+CHAR_MAX = SCHAR_MAX -+MB_LEN_MAX = (1) -+SHRT_MIN = (-32767-1) -+SHRT_MAX = (32767) -+LONG_MIN = (-2147483647L-1) -+LONG_MAX = (2147483647L) -+INT_MIN = LONG_MIN -+INT_MAX = LONG_MAX -+ARG_MAX = (32768) -+ATEXIT_MAX = (32) -+CHILD_MAX = (1024) -+IOV_MAX = (256) -+FILESIZEBITS = (64) -+LINK_MAX = (1) -+LOGIN_NAME_MAX = (32) -+MAX_CANON = (255) -+MAX_INPUT = (255) -+NAME_MAX = (256) -+NGROUPS_MAX = (32) -+OPEN_MAX = (128) -+PATH_MAX = (1024) -+PIPE_MAX = (512) -+SSIZE_MAX = (2147483647L) -+TTY_NAME_MAX = (256) -+TZNAME_MAX = (32) -+SYMLINKS_MAX = (16) -+_POSIX_ARG_MAX = (32768) -+_POSIX_CHILD_MAX = (1024) -+_POSIX_LINK_MAX = (1) -+_POSIX_LOGIN_NAME_MAX = (9) -+_POSIX_MAX_CANON = (255) -+_POSIX_MAX_INPUT = (255) -+_POSIX_NAME_MAX = (255) -+_POSIX_NGROUPS_MAX = (0) -+_POSIX_OPEN_MAX = (128) -+_POSIX_PATH_MAX = (1024) -+_POSIX_PIPE_BUF = (512) -+_POSIX_SSIZE_MAX = (2147483647L) -+_POSIX_STREAM_MAX = (8) -+_POSIX_TTY_NAME_MAX = (256) -+_POSIX_TZNAME_MAX = (3) -+B_GENERAL_ERROR_BASE = LONG_MIN -+B_OS_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x1000 -+B_APP_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x2000 -+B_INTERFACE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x3000 -+B_MEDIA_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4000 -+B_TRANSLATION_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4800 -+B_MIDI_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x5000 -+B_STORAGE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x6000 -+B_POSIX_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x7000 -+B_MAIL_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x8000 -+B_PRINT_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x9000 -+B_DEVICE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0xa000 -+B_ERRORS_END = (B_GENERAL_ERROR_BASE + 0xffff) -+E2BIG = (B_POSIX_ERROR_BASE + 1) -+ECHILD = (B_POSIX_ERROR_BASE + 2) -+EDEADLK = (B_POSIX_ERROR_BASE + 3) -+EFBIG = (B_POSIX_ERROR_BASE + 4) -+EMLINK = (B_POSIX_ERROR_BASE + 5) -+ENFILE = (B_POSIX_ERROR_BASE + 6) -+ENODEV = (B_POSIX_ERROR_BASE + 7) -+ENOLCK = (B_POSIX_ERROR_BASE + 8) -+ENOSYS = (B_POSIX_ERROR_BASE + 9) -+ENOTTY = (B_POSIX_ERROR_BASE + 10) -+ENXIO = (B_POSIX_ERROR_BASE + 11) -+ESPIPE = (B_POSIX_ERROR_BASE + 12) -+ESRCH = (B_POSIX_ERROR_BASE + 13) -+EFPOS = (B_POSIX_ERROR_BASE + 14) -+ESIGPARM = (B_POSIX_ERROR_BASE + 15) -+EDOM = (B_POSIX_ERROR_BASE + 16) -+ERANGE = (B_POSIX_ERROR_BASE + 17) -+EPROTOTYPE = (B_POSIX_ERROR_BASE + 18) -+EPROTONOSUPPORT = (B_POSIX_ERROR_BASE + 19) -+EPFNOSUPPORT = (B_POSIX_ERROR_BASE + 20) -+EAFNOSUPPORT = (B_POSIX_ERROR_BASE + 21) -+EADDRINUSE = (B_POSIX_ERROR_BASE + 22) -+EADDRNOTAVAIL = (B_POSIX_ERROR_BASE + 23) -+ENETDOWN = (B_POSIX_ERROR_BASE + 24) -+ENETUNREACH = (B_POSIX_ERROR_BASE + 25) -+ENETRESET = (B_POSIX_ERROR_BASE + 26) -+ECONNABORTED = (B_POSIX_ERROR_BASE + 27) -+ECONNRESET = (B_POSIX_ERROR_BASE + 28) -+EISCONN = (B_POSIX_ERROR_BASE + 29) -+ENOTCONN = (B_POSIX_ERROR_BASE + 30) -+ESHUTDOWN = (B_POSIX_ERROR_BASE + 31) -+ECONNREFUSED = (B_POSIX_ERROR_BASE + 32) -+EHOSTUNREACH = (B_POSIX_ERROR_BASE + 33) -+ENOPROTOOPT = (B_POSIX_ERROR_BASE + 34) -+ENOBUFS = (B_POSIX_ERROR_BASE + 35) -+EINPROGRESS = (B_POSIX_ERROR_BASE + 36) -+EALREADY = (B_POSIX_ERROR_BASE + 37) -+EILSEQ = (B_POSIX_ERROR_BASE + 38) -+ENOMSG = (B_POSIX_ERROR_BASE + 39) -+ESTALE = (B_POSIX_ERROR_BASE + 40) -+EOVERFLOW = (B_POSIX_ERROR_BASE + 41) -+EMSGSIZE = (B_POSIX_ERROR_BASE + 42) -+EOPNOTSUPP = (B_POSIX_ERROR_BASE + 43) -+ENOTSOCK = (B_POSIX_ERROR_BASE + 44) -+false = 0 -+true = 1 -+NULL = (0) -+FALSE = 0 -+TRUE = 1 -+ -+# Included from TypeConstants.h -+B_HOST_IS_LENDIAN = 1 -+B_HOST_IS_BENDIAN = 0 -+def B_HOST_TO_LENDIAN_DOUBLE(arg): return (double)(arg) -+ -+def B_HOST_TO_LENDIAN_FLOAT(arg): return (float)(arg) -+ -+def B_HOST_TO_LENDIAN_INT64(arg): return (uint64)(arg) -+ -+def B_HOST_TO_LENDIAN_INT32(arg): return (uint32)(arg) -+ -+def B_HOST_TO_LENDIAN_INT16(arg): return (uint16)(arg) -+ -+def B_HOST_TO_BENDIAN_DOUBLE(arg): return __swap_double(arg) -+ -+def B_HOST_TO_BENDIAN_FLOAT(arg): return __swap_float(arg) -+ -+def B_HOST_TO_BENDIAN_INT64(arg): return __swap_int64(arg) -+ -+def B_HOST_TO_BENDIAN_INT32(arg): return __swap_int32(arg) -+ -+def B_HOST_TO_BENDIAN_INT16(arg): return __swap_int16(arg) -+ -+def B_LENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg) -+ -+def B_LENDIAN_TO_HOST_FLOAT(arg): return (float)(arg) -+ -+def B_LENDIAN_TO_HOST_INT64(arg): return (uint64)(arg) -+ -+def B_LENDIAN_TO_HOST_INT32(arg): return (uint32)(arg) -+ -+def B_LENDIAN_TO_HOST_INT16(arg): return (uint16)(arg) -+ -+def B_BENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg) -+ -+def B_BENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg) -+ -+def B_BENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg) -+ -+def B_BENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg) -+ -+def B_BENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg) -+ -+B_HOST_IS_LENDIAN = 0 -+B_HOST_IS_BENDIAN = 1 -+def B_HOST_TO_LENDIAN_DOUBLE(arg): return __swap_double(arg) -+ -+def B_HOST_TO_LENDIAN_FLOAT(arg): return __swap_float(arg) -+ -+def B_HOST_TO_LENDIAN_INT64(arg): return __swap_int64(arg) -+ -+def B_HOST_TO_LENDIAN_INT32(arg): return __swap_int32(arg) -+ -+def B_HOST_TO_LENDIAN_INT16(arg): return __swap_int16(arg) -+ -+def B_HOST_TO_BENDIAN_DOUBLE(arg): return (double)(arg) -+ -+def B_HOST_TO_BENDIAN_FLOAT(arg): return (float)(arg) -+ -+def B_HOST_TO_BENDIAN_INT64(arg): return (uint64)(arg) -+ -+def B_HOST_TO_BENDIAN_INT32(arg): return (uint32)(arg) -+ -+def B_HOST_TO_BENDIAN_INT16(arg): return (uint16)(arg) -+ -+def B_LENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg) -+ -+def B_LENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg) -+ -+def B_LENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg) -+ -+def B_LENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg) -+ -+def B_LENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg) -+ -+def B_BENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg) -+ -+def B_BENDIAN_TO_HOST_FLOAT(arg): return (float)(arg) -+ -+def B_BENDIAN_TO_HOST_INT64(arg): return (uint64)(arg) -+ -+def B_BENDIAN_TO_HOST_INT32(arg): return (uint32)(arg) -+ -+def B_BENDIAN_TO_HOST_INT16(arg): return (uint16)(arg) -+ -+def B_SWAP_DOUBLE(arg): return __swap_double(arg) -+ -+def B_SWAP_FLOAT(arg): return __swap_float(arg) -+ -+def B_SWAP_INT64(arg): return __swap_int64(arg) -+ -+def B_SWAP_INT32(arg): return __swap_int32(arg) -+ -+def B_SWAP_INT16(arg): return __swap_int16(arg) -+ -+def htonl(x): return B_HOST_TO_BENDIAN_INT32(x) -+ -+def ntohl(x): return B_BENDIAN_TO_HOST_INT32(x) -+ -+def htons(x): return B_HOST_TO_BENDIAN_INT16(x) -+ -+def ntohs(x): return B_BENDIAN_TO_HOST_INT16(x) -+ -+AF_INET = 1 -+INADDR_ANY = 0x00000000 -+INADDR_BROADCAST = 0xffffffff -+INADDR_LOOPBACK = 0x7f000001 -+SOL_SOCKET = 1 -+SO_DEBUG = 1 -+SO_REUSEADDR = 2 -+SO_NONBLOCK = 3 -+SO_REUSEPORT = 4 -+MSG_OOB = 0x1 -+SOCK_DGRAM = 1 -+SOCK_STREAM = 2 -+IPPROTO_UDP = 1 -+IPPROTO_TCP = 2 -+IPPROTO_ICMP = 3 -+B_UDP_MAX_SIZE = (65536 - 1024) -+FD_SETSIZE = 256 -+FDSETSIZE = FD_SETSIZE -+NFDBITS = 32 -+def _FDMSKNO(fd): return ((fd) / NFDBITS) -+ -+def _FDBITNO(fd): return ((fd) % NFDBITS) -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 -+ -+H2PY=../../Tools/scripts/h2py.py -+HEADERS=/boot/develop/headers -+ -+set -v -+python $H2PY -i '(u_long)' $HEADERS/posix/netinet/in.h -diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py -index 2825a87..26ca80f 100644 ---- a/Lib/test/test_fileio.py -+++ b/Lib/test/test_fileio.py -@@ -308,6 +308,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', 'aix')): - # Somehow /dev/tty appears seekable on some BSDs - self.assertEqual(f.seekable(), False) -diff --git a/Modules/resource.c b/Modules/resource.c -index 53a6c3e..6c5f52f 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))); -+#ifndef __HAIKU__ - 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,6 +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)); -+#endif - - if (PyErr_Occurred()) { - Py_DECREF(result); -diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c -index 3e3c05f..12d12d2 100644 ---- a/Modules/socketmodule.c -+++ b/Modules/socketmodule.c -@@ -4896,7 +4896,9 @@ init_socket(void) - #ifndef __BEOS__ - /* We have incomplete socket support. */ - PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW); -+#ifndef __HAIKU__ - PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET); -+#endif - #if defined(SOCK_RDM) - PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM); - #endif -diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h -index d98e00e..2bfb3dc 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 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); -+#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/Modules/timemodule.c b/Modules/timemodule.c -index 12c43b0..206b325 100644 ---- a/Modules/timemodule.c -+++ b/Modules/timemodule.c -@@ -1006,11 +1006,11 @@ floatsleep(double secs) - 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 --git a/Python/bltinmodule.c b/Python/bltinmodule.c -index f03e488..d4b9d8c 100644 ---- a/Python/bltinmodule.c -+++ b/Python/bltinmodule.c -@@ -19,7 +19,7 @@ - */ - #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) - const char *Py_FileSystemDefaultEncoding = "mbcs"; --#elif defined(__APPLE__) -+#elif defined(__APPLE__) || defined(__HAIKU__) - const char *Py_FileSystemDefaultEncoding = "utf-8"; - #else - const char *Py_FileSystemDefaultEncoding = NULL; /* use default */ -diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py -index 40b1bce..4185370 100755 ---- a/Tools/scripts/h2py.py -+++ b/Tools/scripts/h2py.py -@@ -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.ac b/configure.ac -index 1273465..93ae44b 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -909,7 +909,7 @@ if test $enable_shared = "yes"; then - RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} - INSTSONAME="$LDLIBRARY".$SOVERSION - ;; -- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) -+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|Haiku*) - LDLIBRARY='libpython$(VERSION).so' - BLDLIBRARY='-L. -lpython$(VERSION)' - RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} -@@ -917,6 +917,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 - ;; -@@ -1018,7 +1021,7 @@ AC_PROG_MKDIR_P - 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;; -@@ -2211,7 +2214,7 @@ then - BLDSHARED="$LDSHARED" - fi - ;; -- Linux*|GNU*|QNX*) -+ Linux*|GNU*|QNX*|Haiku*) - LDSHARED='$(CC) -shared' - LDCXXSHARED='$(CXX) -shared';; - BSD/OS*/4*) -@@ -2283,7 +2286,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*) -@@ -2315,7 +2318,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, -@@ -2430,14 +2433,16 @@ case "$ac_sys_system" in - esac - - # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. --# BeOS' sockets are stashed in libnet. - AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 - AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets - -+# BeOS' sockets are stashed in libnet. -+# Haiku's sockets are stashed in libnetwork. - case "$ac_sys_system" in --BeOS*) --AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS --;; -+ BeOS*) -+ AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS);; -+ Haiku*) -+ AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS);; - esac - - AC_MSG_CHECKING(for --with-libs) -@@ -3776,7 +3781,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 54054c2..bc0ae02 100644 ---- a/setup.py -+++ b/setup.py -@@ -541,6 +541,12 @@ class PyBuildExt(build_ext): - lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) - inc_dirs += ['/system/include', '/atheos/autolnk/include'] - inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) -+ -+ # Haiku-specific include and 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']: -@@ -569,7 +575,7 @@ class PyBuildExt(build_ext): - - # Check for MacOS X, which doesn't need libm.a at all - math_libs = ['m'] -- if host_platform in ['darwin', 'beos']: -+ if host_platform in ['darwin', 'beos', 'haiku1']: - math_libs = [] - - # XXX Omitted modules: gl, pure, dl, SGI-specific modules -@@ -812,15 +818,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/' - ] ) -@@ -828,8 +841,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: -@@ -867,8 +880,8 @@ class PyBuildExt(build_ext): - # 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']) ) - else: - print ("warning: openssl 0x%08x is too old for _hashlib" % -@@ -1347,7 +1360,7 @@ class PyBuildExt(build_ext): - missing.append('resource') - - # Sun yellow pages. Some systems have the functions in libc. -- if (host_platform not in ['cygwin', 'atheos', 'qnx6'] and -+ if (host_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'] --- -2.12.2 - - -From ae0b0b760c33129d77351dc44fea85e94f7c27dc Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sat, 5 Apr 2014 21:16:40 +0000 -Subject: fix pyconfig.h path - - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index e288964..bf4f7ef 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -110,7 +110,7 @@ BINDIR= @bindir@ - LIBDIR= @libdir@ - MANDIR= @mandir@ - INCLUDEDIR= @includedir@ --CONFINCLUDEDIR= $(exec_prefix)/include -+CONFINCLUDEDIR= $(INCLUDEDIR) - SCRIPTDIR= $(prefix)/lib - - # Detailed destination directories --- -2.12.2 - - -From ea5570918e1ed3be7b5dbbb16917ec820cb1b1e6 Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Wed, 18 Jun 2014 12:19:13 +0000 -Subject: Import missed change from the 2.6.9 patches - -This makes our site- and vendor- packages work properly again. -It's sill missing the changes to addusersitepackages. This method was apparently refactored, and I don't have enough Python knowledge to redo our changes in the new code. User packages will not workas -expected with -this version of Python. - -diff --git a/Lib/site.py b/Lib/site.py -index 3b51e81..11fb12c 100644 ---- a/Lib/site.py -+++ b/Lib/site.py -@@ -287,6 +287,13 @@ def getsitepackages(): - - if sys.platform in ('os2emx', 'riscos'): - sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) -+ elif 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], --- -2.12.2 - - -From db2f0d9278c2f2cb638fb63617d3a0ae83e0ba4a Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Sun, 21 Sep 2014 18:59:44 +0200 -Subject: gcc2 fix. - - -diff --git a/Modules/_ctypes/libffi/include/ffi_common.h b/Modules/_ctypes/libffi/include/ffi_common.h -index 37f5a9e..37b0b25 100644 ---- a/Modules/_ctypes/libffi/include/ffi_common.h -+++ b/Modules/_ctypes/libffi/include/ffi_common.h -@@ -119,7 +119,7 @@ typedef signed int SINT64 __attribute__((__mode__(__DI__))); - - typedef float FLOAT32; - --#ifndef __GNUC__ -+#if !defined(__GNUC__) || __GNUC__ < 3 - #define __builtin_expect(x, expected_value) (x) - #endif - #define LIKELY(x) __builtin_expect(!!(x),1) --- -2.12.2 - - -From 2f9e5705ef41830863d49df8e2d62a2a726261e4 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Fri, 28 Nov 2014 16:26:28 +0000 -Subject: tarfile: let link fail and catch exception. - - -diff --git a/Lib/tarfile.py b/Lib/tarfile.py -index adf91d5..f284408 100644 ---- a/Lib/tarfile.py -+++ b/Lib/tarfile.py -@@ -2272,7 +2272,7 @@ class TarFile(object): - (platform limitation), we try to make a copy of the referenced file - instead of a link. - """ -- if hasattr(os, "symlink") and hasattr(os, "link"): -+ try: - # For systems that support symbolic and hard links. - if tarinfo.issym(): - if os.path.lexists(targetpath): -@@ -2286,7 +2286,7 @@ class TarFile(object): - os.link(tarinfo._link_target, targetpath) - else: - self._extract_member(self._find_link_target(tarinfo), targetpath) -- else: -+ except (os.error, AttributeError): - try: - self._extract_member(self._find_link_target(tarinfo), targetpath) - except KeyError: --- -2.12.2 - - -From 1ebdc711acc90ac7ee763ede88fd14b314bf38c7 Mon Sep 17 00:00:00 2001 -From: Timothy Gu -Date: Sun, 11 Jan 2015 18:18:22 -0800 -Subject: Fix resource module after the initial haiku patch - - -diff --git a/Modules/resource.c b/Modules/resource.c -index 6c5f52f..73758bb 100644 ---- a/Modules/resource.c -+++ b/Modules/resource.c -@@ -101,6 +101,21 @@ 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)); -+#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()) { --- -2.12.2 - - -From da6620a9816d0eafa8414086c1f8462b992b96fe Mon Sep 17 00:00:00 2001 -From: Timothy Gu -Date: Sun, 11 Jan 2015 18:40:43 -0800 -Subject: resource: Fix [gs]et_rlimit() modes detection - -Haiku defines many of them, but they are actually empty stubs that will always -return EINVAL. No better way of doing this. - -diff --git a/Modules/resource.c b/Modules/resource.c -index 73758bb..0c396f6 100644 ---- a/Modules/resource.c -+++ b/Modules/resource.c -@@ -284,19 +284,19 @@ initresource(void) - (PyObject*) &StructRUsageType); - - /* insert constants */ --#ifdef RLIMIT_CPU -+#if !defined(__HAIKU__) && defined(RLIMIT_CPU) - PyModule_AddIntConstant(m, "RLIMIT_CPU", RLIMIT_CPU); - #endif - --#ifdef RLIMIT_FSIZE -+#if !defined(__HAIKU__) && defined(RLIMIT_FSIZE) - PyModule_AddIntConstant(m, "RLIMIT_FSIZE", RLIMIT_FSIZE); - #endif - --#ifdef RLIMIT_DATA -+#if !defined(__HAIKU__) && defined(RLIMIT_DATA) - PyModule_AddIntConstant(m, "RLIMIT_DATA", RLIMIT_DATA); - #endif - --#ifdef RLIMIT_STACK -+#if !defined(__HAIKU__) && defined(RLIMIT_STACK) - PyModule_AddIntConstant(m, "RLIMIT_STACK", RLIMIT_STACK); - #endif - -@@ -308,31 +308,31 @@ initresource(void) - PyModule_AddIntConstant(m, "RLIMIT_NOFILE", RLIMIT_NOFILE); - #endif - --#ifdef RLIMIT_OFILE -+#if !defined(__HAIKU__) && defined(RLIMIT_OFILE) - PyModule_AddIntConstant(m, "RLIMIT_OFILE", RLIMIT_OFILE); - #endif - --#ifdef RLIMIT_VMEM -+#if !defined(__HAIKU__) && defined(RLIMIT_VMEM) - PyModule_AddIntConstant(m, "RLIMIT_VMEM", RLIMIT_VMEM); - #endif - --#ifdef RLIMIT_AS -+#if !defined(__HAIKU__) && defined(RLIMIT_AS) - PyModule_AddIntConstant(m, "RLIMIT_AS", RLIMIT_AS); - #endif - --#ifdef RLIMIT_RSS -+#if !defined(__HAIKU__) && defined(RLIMIT_RSS) - PyModule_AddIntConstant(m, "RLIMIT_RSS", RLIMIT_RSS); - #endif - --#ifdef RLIMIT_NPROC -+#if !defined(__HAIKU__) && defined(RLIMIT_NPROC) - PyModule_AddIntConstant(m, "RLIMIT_NPROC", RLIMIT_NPROC); - #endif - --#ifdef RLIMIT_MEMLOCK -+#if !defined(__HAIKU__) && defined(RLIMIT_MEMLOCK) - PyModule_AddIntConstant(m, "RLIMIT_MEMLOCK", RLIMIT_MEMLOCK); - #endif - --#ifdef RLIMIT_SBSIZE -+#if !defined(__HAIKU__) && defined(RLIMIT_SBSIZE) - PyModule_AddIntConstant(m, "RLIMIT_SBSIZE", RLIMIT_SBSIZE); - #endif - --- -2.12.2 - - -From f3b8e2d311c7121cadc1e7e336920033d0d15756 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Tue, 26 May 2015 19:39:55 +0000 -Subject: Haiku hasn't makedev(), _PyInt_FromDev isn't defined. - - -diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c -index e73805f..515c61a 100644 ---- a/Modules/posixmodule.c -+++ b/Modules/posixmodule.c -@@ -1483,6 +1483,8 @@ _pystat_fromstructstat(STRUCT_STAT *st) - #endif - #ifdef MS_WINDOWS - PyStructSequence_SET_ITEM(v, 2, PyLong_FromUnsignedLong(st->st_dev)); -+#elif defined(__HAIKU__) -+ PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong(st->st_dev)); - #else - PyStructSequence_SET_ITEM(v, 2, _PyInt_FromDev(st->st_dev)); - #endif --- -2.12.2 - - -From 5b76bd46239853ebddecf8579469cce8b598f076 Mon Sep 17 00:00:00 2001 -From: Philippe Houdoin -Date: Tue, 23 May 2017 19:48:08 +0000 -Subject: Implement CTypes's find_library for Haiku - - -diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py -index ab10ec5..72e495b 100644 ---- a/Lib/ctypes/util.py -+++ b/Lib/ctypes/util.py -@@ -232,6 +232,55 @@ elif os.name == "posix": - def find_library(name, is64 = False): - return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name)) - -+ elif sys.platform.startswith("haiku"): -+ -+ def _num_version(libname): -+ # "libxyz.so.MAJOR.MINOR" => [ MAJOR, MINOR ] -+ parts = libname.split(b".") -+ nums = [] -+ try: -+ while parts: -+ nums.insert(0, int(parts.pop())) -+ except ValueError: -+ pass -+ return nums or [sys.maxint] -+ -+ def find_library(name): -+ for directory in os.environ['LIBRARY_PATH'].split(os.pathsep): -+ if directory.startswith("%A/"): -+ directory = directory.replace('%A', -+ os.path.dirname(os.path.abspath(sys.argv[0] or os.getcwd()))) -+ -+ if not os.path.isdir(directory): -+ continue -+ -+ # try direct match -+ fname = os.path.join(directory, name) -+ if os.path.isfile(fname): -+ return fname -+ -+ fname = os.path.join(directory, 'lib%s.so' % name) -+ if os.path.isfile(fname): -+ return fname -+ -+ # no exact matching in this directroy -+ # collect versioned candidates, if any -+ candidates = [] -+ pattern = re.compile(r'lib%s\.so\.\S+' % re.escape(name)) -+ for entry in os.listdir(directory): -+ if not os.path.isfile(os.path.join(directory, entry)): -+ continue -+ -+ if re.match(pattern, entry): -+ candidates.append(os.path.join(directory, entry)) -+ -+ if candidates: -+ # return latest version found -+ candidates.sort(key=_num_version) -+ return candidates[-1] -+ -+ return None -+ - else: - - def _findSoname_ldconfig(name): -@@ -299,6 +348,12 @@ def test(): - print cdll.LoadLibrary("libcrypto.dylib") - print cdll.LoadLibrary("libSystem.dylib") - print cdll.LoadLibrary("System.framework/System") -+ elif sys.platform.startswith("haiku"): -+ print find_library("libbz2.so.1.0") -+ print find_library("tracker") -+ print find_library("media") -+ print cdll.LoadLibrary(find_library("tracker")) -+ print cdll.LoadLibrary("libmedia.so") - else: - print cdll.LoadLibrary("libm.so") - print cdll.LoadLibrary("libcrypt.so") --- -2.12.2 - - -From 6ad0d99bf27bbd544c7c370da89a6249b50955b0 Mon Sep 17 00:00:00 2001 -From: Philippe Houdoin -Date: Wed, 24 May 2017 11:06:41 +0000 -Subject: Map 'c' and 'm' libraries to libroot.so on Haiku - - -diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py -index 72e495b..a2cc0a1 100644 ---- a/Lib/ctypes/util.py -+++ b/Lib/ctypes/util.py -@@ -236,7 +236,7 @@ elif os.name == "posix": - - def _num_version(libname): - # "libxyz.so.MAJOR.MINOR" => [ MAJOR, MINOR ] -- parts = libname.split(b".") -+ parts = libname.split('.') - nums = [] - try: - while parts: -@@ -246,6 +246,8 @@ elif os.name == "posix": - return nums or [sys.maxint] - - def find_library(name): -+ if name in ('c', 'm'): -+ return find_library('root') - for directory in os.environ['LIBRARY_PATH'].split(os.pathsep): - if directory.startswith("%A/"): - directory = directory.replace('%A', --- -2.12.2 - diff --git a/dev-lang/python/patches/python-2.7.14.patchset b/dev-lang/python/patches/python-2.7.14.patchset deleted file mode 100644 index 31a1a184f..000000000 --- a/dev-lang/python/patches/python-2.7.14.patchset +++ /dev/null @@ -1,1123 +0,0 @@ -From c612225170a65eb865430ced699feb7a98da7c46 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Wed, 12 Mar 2014 21:17:06 +0000 -Subject: initial Haiku patch - - -diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py -index b9f1c6c..7be61d3 100644 ---- a/Lib/distutils/command/install.py -+++ b/Lib/distutils/command/install.py -@@ -83,6 +83,35 @@ 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', -+ }, -+ - } - - # The keys to an installation scheme; if any new types of files are to be -@@ -416,10 +445,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: -@@ -435,7 +470,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 de7da1d..8180c8e 100644 ---- a/Lib/distutils/sysconfig.py -+++ b/Lib/distutils/sysconfig.py -@@ -90,7 +90,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 -- return os.path.join(prefix, "include", "python" + get_python_version()) -+ inc_dir = "include" if sys.platform != "haiku1" else "develop/headers" -+ return os.path.join(prefix, inc_dir, "python" + get_python_version()) - elif os.name == "nt": - return os.path.join(prefix, "include") - elif os.name == "os2": -@@ -119,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/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 -+ -+# Included from socket.h -+ -+# Included from BeBuild.h -+B_BEOS_VERSION_4 = 0x0400 -+B_BEOS_VERSION_4_5 = 0x0450 -+B_BEOS_VERSION_5 = 0x0500 -+B_BEOS_VERSION = B_BEOS_VERSION_5 -+B_BEOS_VERSION_MAUI = B_BEOS_VERSION_5 -+_PR2_COMPATIBLE_ = 1 -+_PR3_COMPATIBLE_ = 1 -+_R4_COMPATIBLE_ = 1 -+_R4_5_COMPATIBLE_ = 1 -+_PR2_COMPATIBLE_ = 0 -+_PR3_COMPATIBLE_ = 0 -+_R4_COMPATIBLE_ = 1 -+_R4_5_COMPATIBLE_ = 1 -+def _UNUSED(x): return x -+ -+ -+# Included from sys/types.h -+ -+# Included from time.h -+ -+# Included from be_setup.h -+def __std(ref): return ref -+ -+__be_os = 2 -+__dest_os = __be_os -+__MSL__ = 0x4011 -+__GLIBC__ = -2 -+__GLIBC_MINOR__ = 1 -+ -+# Included from null.h -+NULL = (0) -+NULL = 0L -+ -+# Included from size_t.h -+ -+# Included from stddef.h -+ -+# Included from wchar_t.h -+CLOCKS_PER_SEC = 1000 -+CLK_TCK = CLOCKS_PER_SEC -+MAX_TIMESTR = 70 -+ -+# Included from sys/time.h -+ -+# Included from ByteOrder.h -+ -+# Included from endian.h -+__LITTLE_ENDIAN = 1234 -+LITTLE_ENDIAN = __LITTLE_ENDIAN -+__BYTE_ORDER = __LITTLE_ENDIAN -+BYTE_ORDER = __BYTE_ORDER -+__BIG_ENDIAN = 0 -+BIG_ENDIAN = 0 -+__BIG_ENDIAN = 4321 -+BIG_ENDIAN = __BIG_ENDIAN -+__BYTE_ORDER = __BIG_ENDIAN -+BYTE_ORDER = __BYTE_ORDER -+__LITTLE_ENDIAN = 0 -+LITTLE_ENDIAN = 0 -+__PDP_ENDIAN = 3412 -+PDP_ENDIAN = __PDP_ENDIAN -+ -+# Included from SupportDefs.h -+ -+# Included from Errors.h -+ -+# Included from limits.h -+ -+# Included from float.h -+FLT_ROUNDS = 1 -+FLT_RADIX = 2 -+FLT_MANT_DIG = 24 -+FLT_DIG = 6 -+FLT_MIN_EXP = (-125) -+FLT_MIN_10_EXP = (-37) -+FLT_MAX_EXP = 128 -+FLT_MAX_10_EXP = 38 -+DBL_MANT_DIG = 53 -+DBL_DIG = 15 -+DBL_MIN_EXP = (-1021) -+DBL_MIN_10_EXP = (-308) -+DBL_MAX_EXP = 1024 -+DBL_MAX_10_EXP = 308 -+LDBL_MANT_DIG = DBL_MANT_DIG -+LDBL_DIG = DBL_DIG -+LDBL_MIN_EXP = DBL_MIN_EXP -+LDBL_MIN_10_EXP = DBL_MIN_10_EXP -+LDBL_MAX_EXP = DBL_MAX_EXP -+LDBL_MAX_10_EXP = DBL_MAX_10_EXP -+CHAR_BIT = (8) -+SCHAR_MIN = (-127-1) -+SCHAR_MAX = (127) -+CHAR_MIN = SCHAR_MIN -+CHAR_MAX = SCHAR_MAX -+MB_LEN_MAX = (1) -+SHRT_MIN = (-32767-1) -+SHRT_MAX = (32767) -+LONG_MIN = (-2147483647L-1) -+LONG_MAX = (2147483647L) -+INT_MIN = LONG_MIN -+INT_MAX = LONG_MAX -+ARG_MAX = (32768) -+ATEXIT_MAX = (32) -+CHILD_MAX = (1024) -+IOV_MAX = (256) -+FILESIZEBITS = (64) -+LINK_MAX = (1) -+LOGIN_NAME_MAX = (32) -+MAX_CANON = (255) -+MAX_INPUT = (255) -+NAME_MAX = (256) -+NGROUPS_MAX = (32) -+OPEN_MAX = (128) -+PATH_MAX = (1024) -+PIPE_MAX = (512) -+SSIZE_MAX = (2147483647L) -+TTY_NAME_MAX = (256) -+TZNAME_MAX = (32) -+SYMLINKS_MAX = (16) -+_POSIX_ARG_MAX = (32768) -+_POSIX_CHILD_MAX = (1024) -+_POSIX_LINK_MAX = (1) -+_POSIX_LOGIN_NAME_MAX = (9) -+_POSIX_MAX_CANON = (255) -+_POSIX_MAX_INPUT = (255) -+_POSIX_NAME_MAX = (255) -+_POSIX_NGROUPS_MAX = (0) -+_POSIX_OPEN_MAX = (128) -+_POSIX_PATH_MAX = (1024) -+_POSIX_PIPE_BUF = (512) -+_POSIX_SSIZE_MAX = (2147483647L) -+_POSIX_STREAM_MAX = (8) -+_POSIX_TTY_NAME_MAX = (256) -+_POSIX_TZNAME_MAX = (3) -+B_GENERAL_ERROR_BASE = LONG_MIN -+B_OS_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x1000 -+B_APP_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x2000 -+B_INTERFACE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x3000 -+B_MEDIA_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4000 -+B_TRANSLATION_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x4800 -+B_MIDI_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x5000 -+B_STORAGE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x6000 -+B_POSIX_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x7000 -+B_MAIL_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x8000 -+B_PRINT_ERROR_BASE = B_GENERAL_ERROR_BASE + 0x9000 -+B_DEVICE_ERROR_BASE = B_GENERAL_ERROR_BASE + 0xa000 -+B_ERRORS_END = (B_GENERAL_ERROR_BASE + 0xffff) -+E2BIG = (B_POSIX_ERROR_BASE + 1) -+ECHILD = (B_POSIX_ERROR_BASE + 2) -+EDEADLK = (B_POSIX_ERROR_BASE + 3) -+EFBIG = (B_POSIX_ERROR_BASE + 4) -+EMLINK = (B_POSIX_ERROR_BASE + 5) -+ENFILE = (B_POSIX_ERROR_BASE + 6) -+ENODEV = (B_POSIX_ERROR_BASE + 7) -+ENOLCK = (B_POSIX_ERROR_BASE + 8) -+ENOSYS = (B_POSIX_ERROR_BASE + 9) -+ENOTTY = (B_POSIX_ERROR_BASE + 10) -+ENXIO = (B_POSIX_ERROR_BASE + 11) -+ESPIPE = (B_POSIX_ERROR_BASE + 12) -+ESRCH = (B_POSIX_ERROR_BASE + 13) -+EFPOS = (B_POSIX_ERROR_BASE + 14) -+ESIGPARM = (B_POSIX_ERROR_BASE + 15) -+EDOM = (B_POSIX_ERROR_BASE + 16) -+ERANGE = (B_POSIX_ERROR_BASE + 17) -+EPROTOTYPE = (B_POSIX_ERROR_BASE + 18) -+EPROTONOSUPPORT = (B_POSIX_ERROR_BASE + 19) -+EPFNOSUPPORT = (B_POSIX_ERROR_BASE + 20) -+EAFNOSUPPORT = (B_POSIX_ERROR_BASE + 21) -+EADDRINUSE = (B_POSIX_ERROR_BASE + 22) -+EADDRNOTAVAIL = (B_POSIX_ERROR_BASE + 23) -+ENETDOWN = (B_POSIX_ERROR_BASE + 24) -+ENETUNREACH = (B_POSIX_ERROR_BASE + 25) -+ENETRESET = (B_POSIX_ERROR_BASE + 26) -+ECONNABORTED = (B_POSIX_ERROR_BASE + 27) -+ECONNRESET = (B_POSIX_ERROR_BASE + 28) -+EISCONN = (B_POSIX_ERROR_BASE + 29) -+ENOTCONN = (B_POSIX_ERROR_BASE + 30) -+ESHUTDOWN = (B_POSIX_ERROR_BASE + 31) -+ECONNREFUSED = (B_POSIX_ERROR_BASE + 32) -+EHOSTUNREACH = (B_POSIX_ERROR_BASE + 33) -+ENOPROTOOPT = (B_POSIX_ERROR_BASE + 34) -+ENOBUFS = (B_POSIX_ERROR_BASE + 35) -+EINPROGRESS = (B_POSIX_ERROR_BASE + 36) -+EALREADY = (B_POSIX_ERROR_BASE + 37) -+EILSEQ = (B_POSIX_ERROR_BASE + 38) -+ENOMSG = (B_POSIX_ERROR_BASE + 39) -+ESTALE = (B_POSIX_ERROR_BASE + 40) -+EOVERFLOW = (B_POSIX_ERROR_BASE + 41) -+EMSGSIZE = (B_POSIX_ERROR_BASE + 42) -+EOPNOTSUPP = (B_POSIX_ERROR_BASE + 43) -+ENOTSOCK = (B_POSIX_ERROR_BASE + 44) -+false = 0 -+true = 1 -+NULL = (0) -+FALSE = 0 -+TRUE = 1 -+ -+# Included from TypeConstants.h -+B_HOST_IS_LENDIAN = 1 -+B_HOST_IS_BENDIAN = 0 -+def B_HOST_TO_LENDIAN_DOUBLE(arg): return (double)(arg) -+ -+def B_HOST_TO_LENDIAN_FLOAT(arg): return (float)(arg) -+ -+def B_HOST_TO_LENDIAN_INT64(arg): return (uint64)(arg) -+ -+def B_HOST_TO_LENDIAN_INT32(arg): return (uint32)(arg) -+ -+def B_HOST_TO_LENDIAN_INT16(arg): return (uint16)(arg) -+ -+def B_HOST_TO_BENDIAN_DOUBLE(arg): return __swap_double(arg) -+ -+def B_HOST_TO_BENDIAN_FLOAT(arg): return __swap_float(arg) -+ -+def B_HOST_TO_BENDIAN_INT64(arg): return __swap_int64(arg) -+ -+def B_HOST_TO_BENDIAN_INT32(arg): return __swap_int32(arg) -+ -+def B_HOST_TO_BENDIAN_INT16(arg): return __swap_int16(arg) -+ -+def B_LENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg) -+ -+def B_LENDIAN_TO_HOST_FLOAT(arg): return (float)(arg) -+ -+def B_LENDIAN_TO_HOST_INT64(arg): return (uint64)(arg) -+ -+def B_LENDIAN_TO_HOST_INT32(arg): return (uint32)(arg) -+ -+def B_LENDIAN_TO_HOST_INT16(arg): return (uint16)(arg) -+ -+def B_BENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg) -+ -+def B_BENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg) -+ -+def B_BENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg) -+ -+def B_BENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg) -+ -+def B_BENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg) -+ -+B_HOST_IS_LENDIAN = 0 -+B_HOST_IS_BENDIAN = 1 -+def B_HOST_TO_LENDIAN_DOUBLE(arg): return __swap_double(arg) -+ -+def B_HOST_TO_LENDIAN_FLOAT(arg): return __swap_float(arg) -+ -+def B_HOST_TO_LENDIAN_INT64(arg): return __swap_int64(arg) -+ -+def B_HOST_TO_LENDIAN_INT32(arg): return __swap_int32(arg) -+ -+def B_HOST_TO_LENDIAN_INT16(arg): return __swap_int16(arg) -+ -+def B_HOST_TO_BENDIAN_DOUBLE(arg): return (double)(arg) -+ -+def B_HOST_TO_BENDIAN_FLOAT(arg): return (float)(arg) -+ -+def B_HOST_TO_BENDIAN_INT64(arg): return (uint64)(arg) -+ -+def B_HOST_TO_BENDIAN_INT32(arg): return (uint32)(arg) -+ -+def B_HOST_TO_BENDIAN_INT16(arg): return (uint16)(arg) -+ -+def B_LENDIAN_TO_HOST_DOUBLE(arg): return __swap_double(arg) -+ -+def B_LENDIAN_TO_HOST_FLOAT(arg): return __swap_float(arg) -+ -+def B_LENDIAN_TO_HOST_INT64(arg): return __swap_int64(arg) -+ -+def B_LENDIAN_TO_HOST_INT32(arg): return __swap_int32(arg) -+ -+def B_LENDIAN_TO_HOST_INT16(arg): return __swap_int16(arg) -+ -+def B_BENDIAN_TO_HOST_DOUBLE(arg): return (double)(arg) -+ -+def B_BENDIAN_TO_HOST_FLOAT(arg): return (float)(arg) -+ -+def B_BENDIAN_TO_HOST_INT64(arg): return (uint64)(arg) -+ -+def B_BENDIAN_TO_HOST_INT32(arg): return (uint32)(arg) -+ -+def B_BENDIAN_TO_HOST_INT16(arg): return (uint16)(arg) -+ -+def B_SWAP_DOUBLE(arg): return __swap_double(arg) -+ -+def B_SWAP_FLOAT(arg): return __swap_float(arg) -+ -+def B_SWAP_INT64(arg): return __swap_int64(arg) -+ -+def B_SWAP_INT32(arg): return __swap_int32(arg) -+ -+def B_SWAP_INT16(arg): return __swap_int16(arg) -+ -+def htonl(x): return B_HOST_TO_BENDIAN_INT32(x) -+ -+def ntohl(x): return B_BENDIAN_TO_HOST_INT32(x) -+ -+def htons(x): return B_HOST_TO_BENDIAN_INT16(x) -+ -+def ntohs(x): return B_BENDIAN_TO_HOST_INT16(x) -+ -+AF_INET = 1 -+INADDR_ANY = 0x00000000 -+INADDR_BROADCAST = 0xffffffff -+INADDR_LOOPBACK = 0x7f000001 -+SOL_SOCKET = 1 -+SO_DEBUG = 1 -+SO_REUSEADDR = 2 -+SO_NONBLOCK = 3 -+SO_REUSEPORT = 4 -+MSG_OOB = 0x1 -+SOCK_DGRAM = 1 -+SOCK_STREAM = 2 -+IPPROTO_UDP = 1 -+IPPROTO_TCP = 2 -+IPPROTO_ICMP = 3 -+B_UDP_MAX_SIZE = (65536 - 1024) -+FD_SETSIZE = 256 -+FDSETSIZE = FD_SETSIZE -+NFDBITS = 32 -+def _FDMSKNO(fd): return ((fd) / NFDBITS) -+ -+def _FDBITNO(fd): return ((fd) % NFDBITS) -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 -+ -+H2PY=../../Tools/scripts/h2py.py -+HEADERS=/boot/develop/headers -+ -+set -v -+python $H2PY -i '(u_long)' $HEADERS/posix/netinet/in.h -diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py -index 2825a87..26ca80f 100644 ---- a/Lib/test/test_fileio.py -+++ b/Lib/test/test_fileio.py -@@ -308,6 +308,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', 'aix')): - # Somehow /dev/tty appears seekable on some BSDs - self.assertEqual(f.seekable(), False) -diff --git a/Modules/resource.c b/Modules/resource.c -index 53a6c3e..6c5f52f 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))); -+#ifndef __HAIKU__ - 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,6 +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)); -+#endif - - if (PyErr_Occurred()) { - Py_DECREF(result); -diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c -index 3e3c05f..12d12d2 100644 ---- a/Modules/socketmodule.c -+++ b/Modules/socketmodule.c -@@ -4896,7 +4896,9 @@ init_socket(void) - #ifndef __BEOS__ - /* We have incomplete socket support. */ - PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW); -+#ifndef __HAIKU__ - PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET); -+#endif - #if defined(SOCK_RDM) - PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM); - #endif -diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h -index d98e00e..2bfb3dc 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 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); -+#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/Modules/timemodule.c b/Modules/timemodule.c -index 12c43b0..206b325 100644 ---- a/Modules/timemodule.c -+++ b/Modules/timemodule.c -@@ -1006,11 +1006,11 @@ floatsleep(double secs) - 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 --git a/Python/bltinmodule.c b/Python/bltinmodule.c -index 70308e9..cd0da91 100644 ---- a/Python/bltinmodule.c -+++ b/Python/bltinmodule.c -@@ -19,7 +19,7 @@ - */ - #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) - const char *Py_FileSystemDefaultEncoding = "mbcs"; --#elif defined(__APPLE__) -+#elif defined(__APPLE__) || defined(__HAIKU__) - const char *Py_FileSystemDefaultEncoding = "utf-8"; - #else - const char *Py_FileSystemDefaultEncoding = NULL; /* use default */ -diff --git a/Tools/scripts/h2py.py b/Tools/scripts/h2py.py -index 40b1bce..4185370 100755 ---- a/Tools/scripts/h2py.py -+++ b/Tools/scripts/h2py.py -@@ -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.ac b/configure.ac -index 780f275..feed5e0 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -908,7 +908,7 @@ if test $enable_shared = "yes"; then - RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} - INSTSONAME="$LDLIBRARY".$SOVERSION - ;; -- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*) -+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|Haiku*) - LDLIBRARY='libpython$(VERSION).so' - BLDLIBRARY='-L. -lpython$(VERSION)' - RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} -@@ -916,6 +916,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 - ;; -@@ -1014,7 +1017,7 @@ AC_PROG_MKDIR_P - 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;; -@@ -2207,7 +2210,7 @@ then - BLDSHARED="$LDSHARED" - fi - ;; -- Linux*|GNU*|QNX*) -+ Linux*|GNU*|QNX*|Haiku*) - LDSHARED='$(CC) -shared' - LDCXXSHARED='$(CXX) -shared';; - BSD/OS*/4*) -@@ -2279,7 +2282,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*) -@@ -2311,7 +2314,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, -@@ -2426,14 +2429,16 @@ case "$ac_sys_system" in - esac - - # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. --# BeOS' sockets are stashed in libnet. - AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 - AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets - -+# BeOS' sockets are stashed in libnet. -+# Haiku's sockets are stashed in libnetwork. - case "$ac_sys_system" in --BeOS*) --AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS) # BeOS --;; -+ BeOS*) -+ AC_CHECK_LIB(net, socket, [LIBS="-lnet $LIBS"], [], $LIBS);; -+ Haiku*) -+ AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS);; - esac - - AC_MSG_CHECKING(for --with-libs) -@@ -3772,7 +3777,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 5503486..35c713d 100644 ---- a/setup.py -+++ b/setup.py -@@ -541,6 +541,12 @@ class PyBuildExt(build_ext): - lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) - inc_dirs += ['/system/include', '/atheos/autolnk/include'] - inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) -+ -+ # Haiku-specific include and 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']: -@@ -569,7 +575,7 @@ class PyBuildExt(build_ext): - - # Check for MacOS X, which doesn't need libm.a at all - math_libs = ['m'] -- if host_platform in ['darwin', 'beos']: -+ if host_platform in ['darwin', 'beos', 'haiku1']: - math_libs = [] - - # XXX Omitted modules: gl, pure, dl, SGI-specific modules -@@ -812,15 +818,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/' - ] ) -@@ -828,8 +841,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: -@@ -867,8 +880,8 @@ class PyBuildExt(build_ext): - # 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']) ) - else: - print ("warning: openssl 0x%08x is too old for _hashlib" % -@@ -1347,7 +1360,7 @@ class PyBuildExt(build_ext): - missing.append('resource') - - # Sun yellow pages. Some systems have the functions in libc. -- if (host_platform not in ['cygwin', 'atheos', 'qnx6'] and -+ if (host_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'] --- -2.12.2 - - -From ae0b0b760c33129d77351dc44fea85e94f7c27dc Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Sat, 5 Apr 2014 21:16:40 +0000 -Subject: fix pyconfig.h path - - -diff --git a/Makefile.pre.in b/Makefile.pre.in -index 54e9480..1592b6e 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -109,7 +109,7 @@ BINDIR= @bindir@ - LIBDIR= @libdir@ - MANDIR= @mandir@ - INCLUDEDIR= @includedir@ --CONFINCLUDEDIR= $(exec_prefix)/include -+CONFINCLUDEDIR= $(INCLUDEDIR) - SCRIPTDIR= $(prefix)/lib - - # Detailed destination directories --- -2.12.2 - - -From ea5570918e1ed3be7b5dbbb16917ec820cb1b1e6 Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Wed, 18 Jun 2014 12:19:13 +0000 -Subject: Import missed change from the 2.6.9 patches - -This makes our site- and vendor- packages work properly again. -It's sill missing the changes to addusersitepackages. This method was apparently refactored, and I don't have enough Python knowledge to redo our changes in the new code. User packages will not workas -expected with -this version of Python. - -diff --git a/Lib/site.py b/Lib/site.py -index 3b51e81..11fb12c 100644 ---- a/Lib/site.py -+++ b/Lib/site.py -@@ -287,6 +287,13 @@ def getsitepackages(): - - if sys.platform in ('os2emx', 'riscos'): - sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) -+ elif 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], --- -2.12.2 - - -From db2f0d9278c2f2cb638fb63617d3a0ae83e0ba4a Mon Sep 17 00:00:00 2001 -From: Adrien Destugues -Date: Sun, 21 Sep 2014 18:59:44 +0200 -Subject: gcc2 fix. - - -diff --git a/Modules/_ctypes/libffi/include/ffi_common.h b/Modules/_ctypes/libffi/include/ffi_common.h -index 37f5a9e..37b0b25 100644 ---- a/Modules/_ctypes/libffi/include/ffi_common.h -+++ b/Modules/_ctypes/libffi/include/ffi_common.h -@@ -119,7 +119,7 @@ typedef signed int SINT64 __attribute__((__mode__(__DI__))); - - typedef float FLOAT32; - --#ifndef __GNUC__ -+#if !defined(__GNUC__) || __GNUC__ < 3 - #define __builtin_expect(x, expected_value) (x) - #endif - #define LIKELY(x) __builtin_expect(!!(x),1) --- -2.12.2 - - -From 2f9e5705ef41830863d49df8e2d62a2a726261e4 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Fri, 28 Nov 2014 16:26:28 +0000 -Subject: tarfile: let link fail and catch exception. - - -diff --git a/Lib/tarfile.py b/Lib/tarfile.py -index adf91d5..f284408 100644 ---- a/Lib/tarfile.py -+++ b/Lib/tarfile.py -@@ -2272,7 +2272,7 @@ class TarFile(object): - (platform limitation), we try to make a copy of the referenced file - instead of a link. - """ -- if hasattr(os, "symlink") and hasattr(os, "link"): -+ try: - # For systems that support symbolic and hard links. - if tarinfo.issym(): - if os.path.lexists(targetpath): -@@ -2286,7 +2286,7 @@ class TarFile(object): - os.link(tarinfo._link_target, targetpath) - else: - self._extract_member(self._find_link_target(tarinfo), targetpath) -- else: -+ except (os.error, AttributeError): - try: - self._extract_member(self._find_link_target(tarinfo), targetpath) - except KeyError: --- -2.12.2 - - -From 1ebdc711acc90ac7ee763ede88fd14b314bf38c7 Mon Sep 17 00:00:00 2001 -From: Timothy Gu -Date: Sun, 11 Jan 2015 18:18:22 -0800 -Subject: Fix resource module after the initial haiku patch - - -diff --git a/Modules/resource.c b/Modules/resource.c -index 6c5f52f..73758bb 100644 ---- a/Modules/resource.c -+++ b/Modules/resource.c -@@ -101,6 +101,21 @@ 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)); -+#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()) { --- -2.12.2 - - -From da6620a9816d0eafa8414086c1f8462b992b96fe Mon Sep 17 00:00:00 2001 -From: Timothy Gu -Date: Sun, 11 Jan 2015 18:40:43 -0800 -Subject: resource: Fix [gs]et_rlimit() modes detection - -Haiku defines many of them, but they are actually empty stubs that will always -return EINVAL. No better way of doing this. - -diff --git a/Modules/resource.c b/Modules/resource.c -index 73758bb..0c396f6 100644 ---- a/Modules/resource.c -+++ b/Modules/resource.c -@@ -284,19 +284,19 @@ initresource(void) - (PyObject*) &StructRUsageType); - - /* insert constants */ --#ifdef RLIMIT_CPU -+#if !defined(__HAIKU__) && defined(RLIMIT_CPU) - PyModule_AddIntConstant(m, "RLIMIT_CPU", RLIMIT_CPU); - #endif - --#ifdef RLIMIT_FSIZE -+#if !defined(__HAIKU__) && defined(RLIMIT_FSIZE) - PyModule_AddIntConstant(m, "RLIMIT_FSIZE", RLIMIT_FSIZE); - #endif - --#ifdef RLIMIT_DATA -+#if !defined(__HAIKU__) && defined(RLIMIT_DATA) - PyModule_AddIntConstant(m, "RLIMIT_DATA", RLIMIT_DATA); - #endif - --#ifdef RLIMIT_STACK -+#if !defined(__HAIKU__) && defined(RLIMIT_STACK) - PyModule_AddIntConstant(m, "RLIMIT_STACK", RLIMIT_STACK); - #endif - -@@ -308,31 +308,31 @@ initresource(void) - PyModule_AddIntConstant(m, "RLIMIT_NOFILE", RLIMIT_NOFILE); - #endif - --#ifdef RLIMIT_OFILE -+#if !defined(__HAIKU__) && defined(RLIMIT_OFILE) - PyModule_AddIntConstant(m, "RLIMIT_OFILE", RLIMIT_OFILE); - #endif - --#ifdef RLIMIT_VMEM -+#if !defined(__HAIKU__) && defined(RLIMIT_VMEM) - PyModule_AddIntConstant(m, "RLIMIT_VMEM", RLIMIT_VMEM); - #endif - --#ifdef RLIMIT_AS -+#if !defined(__HAIKU__) && defined(RLIMIT_AS) - PyModule_AddIntConstant(m, "RLIMIT_AS", RLIMIT_AS); - #endif - --#ifdef RLIMIT_RSS -+#if !defined(__HAIKU__) && defined(RLIMIT_RSS) - PyModule_AddIntConstant(m, "RLIMIT_RSS", RLIMIT_RSS); - #endif - --#ifdef RLIMIT_NPROC -+#if !defined(__HAIKU__) && defined(RLIMIT_NPROC) - PyModule_AddIntConstant(m, "RLIMIT_NPROC", RLIMIT_NPROC); - #endif - --#ifdef RLIMIT_MEMLOCK -+#if !defined(__HAIKU__) && defined(RLIMIT_MEMLOCK) - PyModule_AddIntConstant(m, "RLIMIT_MEMLOCK", RLIMIT_MEMLOCK); - #endif - --#ifdef RLIMIT_SBSIZE -+#if !defined(__HAIKU__) && defined(RLIMIT_SBSIZE) - PyModule_AddIntConstant(m, "RLIMIT_SBSIZE", RLIMIT_SBSIZE); - #endif - --- -2.12.2 - - -From f3b8e2d311c7121cadc1e7e336920033d0d15756 Mon Sep 17 00:00:00 2001 -From: Jerome Duval -Date: Tue, 26 May 2015 19:39:55 +0000 -Subject: Haiku hasn't makedev(), _PyInt_FromDev isn't defined. - - -diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c -index a06c56e..1754d79 100644 ---- a/Modules/posixmodule.c -+++ b/Modules/posixmodule.c -@@ -1483,6 +1483,8 @@ _pystat_fromstructstat(STRUCT_STAT *st) - #endif - #ifdef MS_WINDOWS - PyStructSequence_SET_ITEM(v, 2, PyLong_FromUnsignedLong(st->st_dev)); -+#elif defined(__HAIKU__) -+ PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong(st->st_dev)); - #else - PyStructSequence_SET_ITEM(v, 2, _PyInt_FromDev(st->st_dev)); - #endif --- -2.12.2 - - -From 5b76bd46239853ebddecf8579469cce8b598f076 Mon Sep 17 00:00:00 2001 -From: Philippe Houdoin -Date: Tue, 23 May 2017 19:48:08 +0000 -Subject: Implement CTypes's find_library for Haiku - - -diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py -index ab10ec5..72e495b 100644 ---- a/Lib/ctypes/util.py -+++ b/Lib/ctypes/util.py -@@ -232,6 +232,55 @@ elif os.name == "posix": - def find_library(name, is64 = False): - return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name)) - -+ elif sys.platform.startswith("haiku"): -+ -+ def _num_version(libname): -+ # "libxyz.so.MAJOR.MINOR" => [ MAJOR, MINOR ] -+ parts = libname.split(b".") -+ nums = [] -+ try: -+ while parts: -+ nums.insert(0, int(parts.pop())) -+ except ValueError: -+ pass -+ return nums or [sys.maxint] -+ -+ def find_library(name): -+ for directory in os.environ['LIBRARY_PATH'].split(os.pathsep): -+ if directory.startswith("%A/"): -+ directory = directory.replace('%A', -+ os.path.dirname(os.path.abspath(sys.argv[0] or os.getcwd()))) -+ -+ if not os.path.isdir(directory): -+ continue -+ -+ # try direct match -+ fname = os.path.join(directory, name) -+ if os.path.isfile(fname): -+ return fname -+ -+ fname = os.path.join(directory, 'lib%s.so' % name) -+ if os.path.isfile(fname): -+ return fname -+ -+ # no exact matching in this directroy -+ # collect versioned candidates, if any -+ candidates = [] -+ pattern = re.compile(r'lib%s\.so\.\S+' % re.escape(name)) -+ for entry in os.listdir(directory): -+ if not os.path.isfile(os.path.join(directory, entry)): -+ continue -+ -+ if re.match(pattern, entry): -+ candidates.append(os.path.join(directory, entry)) -+ -+ if candidates: -+ # return latest version found -+ candidates.sort(key=_num_version) -+ return candidates[-1] -+ -+ return None -+ - else: - - def _findSoname_ldconfig(name): -@@ -299,6 +348,12 @@ def test(): - print cdll.LoadLibrary("libcrypto.dylib") - print cdll.LoadLibrary("libSystem.dylib") - print cdll.LoadLibrary("System.framework/System") -+ elif sys.platform.startswith("haiku"): -+ print find_library("libbz2.so.1.0") -+ print find_library("tracker") -+ print find_library("media") -+ print cdll.LoadLibrary(find_library("tracker")) -+ print cdll.LoadLibrary("libmedia.so") - else: - print cdll.LoadLibrary("libm.so") - print cdll.LoadLibrary("libcrypt.so") --- -2.12.2 - - -From 6ad0d99bf27bbd544c7c370da89a6249b50955b0 Mon Sep 17 00:00:00 2001 -From: Philippe Houdoin -Date: Wed, 24 May 2017 11:06:41 +0000 -Subject: Map 'c' and 'm' libraries to libroot.so on Haiku - - -diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py -index 72e495b..a2cc0a1 100644 ---- a/Lib/ctypes/util.py -+++ b/Lib/ctypes/util.py -@@ -236,7 +236,7 @@ elif os.name == "posix": - - def _num_version(libname): - # "libxyz.so.MAJOR.MINOR" => [ MAJOR, MINOR ] -- parts = libname.split(b".") -+ parts = libname.split('.') - nums = [] - try: - while parts: -@@ -246,6 +246,8 @@ elif os.name == "posix": - return nums or [sys.maxint] - - def find_library(name): -+ if name in ('c', 'm'): -+ return find_library('root') - for directory in os.environ['LIBRARY_PATH'].split(os.pathsep): - if directory.startswith("%A/"): - directory = directory.replace('%A', --- -2.12.2 - diff --git a/dev-lang/python/patches/python-2.7.15.patchset b/dev-lang/python/patches/python-2.7.16.patchset similarity index 94% rename from dev-lang/python/patches/python-2.7.15.patchset rename to dev-lang/python/patches/python-2.7.16.patchset index 29544b89e..6e508064b 100644 --- a/dev-lang/python/patches/python-2.7.15.patchset +++ b/dev-lang/python/patches/python-2.7.16.patchset @@ -1,4 +1,4 @@ -From 3b7516a223d3d346e9d4f81238daf7ff0574f2b7 Mon Sep 17 00:00:00 2001 +From f30d4b172ebf8ec7d8db600b2ad041cc3a8c58e7 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Wed, 12 Mar 2014 21:17:06 +0000 Subject: initial Haiku patch @@ -465,10 +465,10 @@ index 0000000..d9da80c +set -v +python $H2PY -i '(u_long)' $HEADERS/posix/netinet/in.h diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py -index 2825a87..26ca80f 100644 +index 57c9f14..54a7ce8 100644 --- a/Lib/test/test_fileio.py +++ b/Lib/test/test_fileio.py -@@ -308,6 +308,7 @@ class OtherFileTests(unittest.TestCase): +@@ -312,6 +312,7 @@ class OtherFileTests(unittest.TestCase): self.assertEqual(f.writable(), True) if sys.platform != "darwin" and \ 'bsd' not in sys.platform and \ @@ -497,10 +497,10 @@ index 53a6c3e..6c5f52f 100644 if (PyErr_Occurred()) { Py_DECREF(result); diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c -index 8d36705..11cacdc 100644 +index 0139754..1d4ef23 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c -@@ -4896,7 +4896,9 @@ init_socket(void) +@@ -4898,7 +4898,9 @@ init_socket(void) #ifndef __BEOS__ /* We have incomplete socket support. */ PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW); @@ -558,7 +558,7 @@ index 61b8d61..5e5d93c 100644 Py_BEGIN_ALLOW_THREADS diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c -index 9ce3b27..cb10c50 100644 +index 4b819da..46ba828 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -19,7 +19,7 @@ @@ -584,7 +584,7 @@ index 40b1bce..4185370 100755 elif sys.platform.startswith("atheos"): searchdirs=os.environ['C_INCLUDE_PATH'].split(':') diff --git a/configure.ac b/configure.ac -index 913d546..d24f175 100644 +index aecf606..206d2ec 100644 --- a/configure.ac +++ b/configure.ac @@ -923,7 +923,7 @@ if test $enable_shared = "yes"; then @@ -615,7 +615,7 @@ index 913d546..d24f175 100644 CYGWIN*) LN="ln -s";; atheos*) LN="ln -s";; *) LN=ln;; -@@ -2233,7 +2236,7 @@ then +@@ -2240,7 +2243,7 @@ then BLDSHARED="$LDSHARED" fi ;; @@ -624,7 +624,7 @@ index 913d546..d24f175 100644 LDSHARED='$(CC) -shared' LDCXXSHARED='$(CXX) -shared';; BSD/OS*/4*) -@@ -2305,7 +2308,7 @@ then +@@ -2312,7 +2315,7 @@ then then CCSHARED="-fPIC"; else CCSHARED="+z"; fi;; @@ -633,7 +633,7 @@ index 913d546..d24f175 100644 BSD/OS*/4*) CCSHARED="-fpic";; FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";; OpenUNIX*|UnixWare*) -@@ -2337,7 +2340,7 @@ then +@@ -2344,7 +2347,7 @@ then LINKFORSHARED="-Wl,-E -Wl,+s";; # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; @@ -642,7 +642,7 @@ index 913d546..d24f175 100644 # -u libsys_s pulls in all symbols in libsys Darwin/*) # -u _PyMac_Error is needed to pull in the mac toolbox glue, -@@ -2452,14 +2455,16 @@ case "$ac_sys_system" in +@@ -2459,14 +2462,16 @@ case "$ac_sys_system" in esac # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. @@ -663,7 +663,7 @@ index 913d546..d24f175 100644 esac AC_MSG_CHECKING(for --with-libs) -@@ -3798,7 +3803,7 @@ fi], +@@ -3812,7 +3817,7 @@ fi], AC_SUBST(LIBM) case $ac_sys_system in Darwin) ;; @@ -756,10 +756,10 @@ index 33cecc6..b57b321 100644 libs = [] -- -2.19.1 +2.21.0 -From adc15e554f78d0d515046bfb81ea15c3a678ebe7 Mon Sep 17 00:00:00 2001 +From 7b55a07d0e0ae2712ab592cce0ba7c5d7bce7fa3 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sat, 5 Apr 2014 21:16:40 +0000 Subject: fix pyconfig.h path @@ -779,10 +779,10 @@ index 9297e7f..abbeb60 100644 # Detailed destination directories -- -2.19.1 +2.21.0 -From 7f6503b3215a3a772f14f6b93e9fe32ca1152f09 Mon Sep 17 00:00:00 2001 +From 06e07e7c6df2f06f435687643b9cb6cd836bdb7f Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Wed, 18 Jun 2014 12:19:13 +0000 Subject: Import missed change from the 2.6.9 patches @@ -811,10 +811,10 @@ index 3b51e81..11fb12c 100644 sitepackages.append(os.path.join(prefix, "lib", "python" + sys.version[:3], -- -2.19.1 +2.21.0 -From 2df1c86d8d8346aa54b9d8bde5911d8ee00543f2 Mon Sep 17 00:00:00 2001 +From 95f8cc6a804975272637a0588fa9755eb31163a3 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 21 Sep 2014 18:59:44 +0200 Subject: gcc2 fix. @@ -834,10 +834,10 @@ index 37f5a9e..37b0b25 100644 #endif #define LIKELY(x) __builtin_expect(!!(x),1) -- -2.19.1 +2.21.0 -From 827568129835e5d0a67fe51b82ea867fa8ab4a29 Mon Sep 17 00:00:00 2001 +From fc577acd82a0a9244d8f871ba1016923dcef5df9 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Fri, 28 Nov 2014 16:26:28 +0000 Subject: tarfile: let link fail and catch exception. @@ -866,10 +866,10 @@ index adf91d5..f284408 100644 self._extract_member(self._find_link_target(tarinfo), targetpath) except KeyError: -- -2.19.1 +2.21.0 -From 75b1b8ae5efbf1ca73a3f5d04915cfb5dcfd55c0 Mon Sep 17 00:00:00 2001 +From 4c3a6e25aa0d2c32d5746a13108a170452255bd5 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sun, 11 Jan 2015 18:18:22 -0800 Subject: Fix resource module after the initial haiku patch @@ -902,10 +902,10 @@ index 6c5f52f..73758bb 100644 if (PyErr_Occurred()) { -- -2.19.1 +2.21.0 -From c79d2bf308dd1400ef40aa6bd06cc956920ff38d Mon Sep 17 00:00:00 2001 +From bed36c6af79128f0e54922b951320a825dc59fbd Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sun, 11 Jan 2015 18:40:43 -0800 Subject: resource: Fix [gs]et_rlimit() modes detection @@ -981,17 +981,17 @@ index 73758bb..0c396f6 100644 #endif -- -2.19.1 +2.21.0 -From 68948bc3e07f60d2112edc9681e8cb8248549c71 Mon Sep 17 00:00:00 2001 +From 8687a87d528113053311ab3ebbc531224a2b00d1 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Tue, 26 May 2015 19:39:55 +0000 Subject: Haiku hasn't makedev(), _PyInt_FromDev isn't defined. diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c -index 2baf920..5d79438 100644 +index 7a1a694..0f226a0 100644 --- a/Modules/posixmodule.c +++ b/Modules/posixmodule.c @@ -1489,6 +1489,8 @@ _pystat_fromstructstat(STRUCT_STAT *st) @@ -1004,10 +1004,10 @@ index 2baf920..5d79438 100644 PyStructSequence_SET_ITEM(v, 2, _PyInt_FromDev(st->st_dev)); #endif -- -2.19.1 +2.21.0 -From 87694b880f6119298522607432dcf8a127a5d17b Mon Sep 17 00:00:00 2001 +From 73fd37edd447798cc15dc53a00083346c1a9f788 Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Tue, 23 May 2017 19:48:08 +0000 Subject: Implement CTypes's find_library for Haiku @@ -1087,10 +1087,10 @@ index ab10ec5..72e495b 100644 print cdll.LoadLibrary("libm.so") print cdll.LoadLibrary("libcrypt.so") -- -2.19.1 +2.21.0 -From f9854864cdda71a7ec8de6f4bc3fc1f066f8d417 Mon Sep 17 00:00:00 2001 +From fa20f098eb63bbcc688442dd0ed2de1267e889d3 Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Wed, 24 May 2017 11:06:41 +0000 Subject: Map 'c' and 'm' libraries to libroot.so on Haiku @@ -1119,5 +1119,36 @@ index 72e495b..a2cc0a1 100644 if directory.startswith("%A/"): directory = directory.replace('%A', -- -2.19.1 +2.21.0 + + +From 6e5535881d6e13810d56c3153b7c70786d08977c Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Tue, 30 Apr 2019 20:39:51 +0200 +Subject: Python/thread_pthread.h: c89 fix. + + +diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h +index 6d4b3b3..8c42fb8 100644 +--- a/Python/thread_pthread.h ++++ b/Python/thread_pthread.h +@@ -184,6 +184,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) + { + pthread_t th; + int status; ++ pythread_callback *callback; + #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) + pthread_attr_t attrs; + #endif +@@ -213,7 +214,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) + pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM); + #endif + +- pythread_callback *callback = malloc(sizeof(pythread_callback)); ++ callback = malloc(sizeof(pythread_callback)); + + if (callback == NULL) { + return -1; +-- +2.21.0 diff --git a/dev-lang/python/patches/python-3.2.patch b/dev-lang/python/patches/python-3.2.patch deleted file mode 100644 index 8bd1b7908..000000000 --- a/dev-lang/python/patches/python-3.2.patch +++ /dev/null @@ -1,187 +0,0 @@ -diff -urN Python-3.2/Lib/plat-haiku/regen Python-3.2-haiku/Lib/plat-haiku/regen ---- Python-3.2/Lib/plat-haiku/regen 1970-01-01 00:00:00.000000000 +0000 -+++ Python-3.2-haiku/Lib/plat-haiku/regen 2010-11-22 11:11:57.509870080 +0000 -@@ -0,0 +1,3 @@ -+#! /bin/sh -+set -v -+python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /boot/develop/headers/posix/netinet/in.h -diff -urN Python-3.2/Modules/resource.c Python-3.2-haiku/Modules/resource.c ---- Python-3.2/Modules/resource.c 2010-05-09 15:52:27.011796480 +0000 -+++ Python-3.2-haiku/Modules/resource.c 2010-11-22 11:11:57.581173248 +0000 -@@ -86,6 +86,7 @@ - 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)); -@@ -100,7 +101,7 @@ - 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)); -- -+#endif - if (PyErr_Occurred()) { - Py_DECREF(result); - return NULL; -diff -urN Python-3.2/Modules/socketmodule.c Python-3.2-haiku/Modules/socketmodule.c ---- Python-3.2/Modules/socketmodule.c 2010-11-05 17:24:13.021233664 +0000 -+++ Python-3.2-haiku/Modules/socketmodule.c 2010-11-22 11:11:57.722468864 +0000 -@@ -4684,7 +4684,9 @@ - PyModule_AddIntConstant(m, "SOCK_DGRAM", SOCK_DGRAM); - /* We have incomplete socket support. */ - PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW); -+#ifndef __HAIKU__ - PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET); -+#endif - #if defined(SOCK_RDM) - PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM); - #endif -diff -urN Python-3.2/Modules/socketmodule.h Python-3.2-haiku/Modules/socketmodule.h ---- Python-3.2/Modules/socketmodule.h 2010-08-28 20:42:55.019398656 +0000 -+++ Python-3.2-haiku/Modules/socketmodule.h 2010-11-22 11:11:57.790626304 +0000 -@@ -47,6 +47,10 @@ - # undef AF_NETLINK - #endif - -+#if defined (__HAIKU__) -+# undef HAVE_BLUETOOTH_BLUETOOTH_H -+#endif -+ - #ifdef HAVE_BLUETOOTH_BLUETOOTH_H - #include - #include -diff -urN Python-3.2/Modules/spwdmodule.c Python-3.2-haiku/Modules/spwdmodule.c ---- Python-3.2/Modules/spwdmodule.c 2010-05-15 16:27:27.011534336 +0000 -+++ Python-3.2-haiku/Modules/spwdmodule.c 2010-11-22 11:11:57.802422784 +0000 -@@ -80,7 +80,9 @@ - - 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 -urN Python-3.2/Python/bltinmodule.c Python-3.2-haiku/Python/bltinmodule.c ---- Python-3.2/Python/bltinmodule.c 2010-10-17 20:54:53.028049408 +0000 -+++ Python-3.2-haiku/Python/bltinmodule.c 2010-11-22 11:11:57.832831488 +0000 -@@ -22,7 +22,7 @@ - #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) - 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; - #elif defined(HAVE_LANGINFO_H) && defined(CODESET) -diff -urN Python-3.2/configure.in Python-3.2-haiku/configure.in ---- Python-3.2/configure.in 2010-11-01 01:44:30.004980736 +0000 -+++ Python-3.2-haiku/configure.in 2010-11-22 11:14:04.316407808 +0000 -@@ -292,6 +292,7 @@ - case $MACHDEP in - cygwin*) MACHDEP="cygwin";; - darwin*) MACHDEP="darwin";; -+ haiku*) MACHDEP="haiku";; - irix646) MACHDEP="irix6";; - '') MACHDEP="unknown";; - esac -@@ -738,7 +739,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$(LDVERSION).so' - BLDLIBRARY='-L. -lpython$(LDVERSION)' - RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} -@@ -823,6 +824,7 @@ - if test -z "$LN" ; then - case $ac_sys_system in - CYGWIN*) LN="ln -s";; -+ Haiku*) LN="ln -s";; - *) LN=ln;; - esac - fi -@@ -1709,7 +1711,7 @@ - fi - fi - ;; -- Linux*|GNU*|QNX*) -+ Linux*|GNU*|QNX*|Haiku*) - LDSHARED='$(CC) -shared' - LDCXXSHARED='$(CXX) -shared';; - BSD/OS*/4*) -@@ -1778,7 +1780,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*) -@@ -1809,7 +1811,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/*) - LINKFORSHARED="$extra_undefs -framework CoreFoundation" -@@ -1920,6 +1922,8 @@ - AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 - AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets - -+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # For Haiku -+ - AC_MSG_CHECKING(for --with-libs) - AC_ARG_WITH(libs, - AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs]), -@@ -3192,7 +3196,7 @@ - # check for --with-libm=... - AC_SUBST(LIBM) - case $ac_sys_system in --Darwin) ;; -+Darwin|Haiku*) ;; - *) LIBM=-lm - esac - AC_MSG_CHECKING(for --with-libm=STRING) -diff -urN Python-3.2/setup.py Python-3.2-haiku/setup.py ---- Python-3.2/setup.py 2010-10-31 17:11:02.000000000 +0000 -+++ Python-3.2-haiku/setup.py 2010-11-22 11:11:58.034603008 +0000 -@@ -429,6 +429,10 @@ - platform = self.get_platform() - srcdir = sysconfig.get_config_var('srcdir') - -+ if platform == 'haiku1': -+ inc_dirs += ['/boot/develop/headers/posix', '/boot/develop/headers/3rdparty', '/boot/common/include'] -+ lib_dirs += ['/boot/system/lib', '/boot/develop/lib/x86', '/boot/common/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'] -@@ -450,9 +454,9 @@ - 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 or Haiku, which don't need libm.a at all - math_libs = ['m'] -- if platform == 'darwin': -+ if platform == 'darwin' or platform == 'haiku': - math_libs = [] - - # XXX Omitted modules: gl, pure, dl, SGI-specific modules -@@ -1110,7 +1114,7 @@ - exts.append( Extension('resource', ['resource.c']) ) - - # Sun yellow pages. Some systems have the functions in libc. -- if (platform not in ['cygwin', 'qnx6'] and -+ if (platform not in ['cygwin', 'qnx6', 'haiku'] and - find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None): - if (self.compiler.find_library_file(lib_dirs, 'nsl')): - libs = ['nsl'] diff --git a/dev-lang/python/patches/python-3.2a3.patch b/dev-lang/python/patches/python-3.2a3.patch deleted file mode 100644 index e5e38d18f..000000000 --- a/dev-lang/python/patches/python-3.2a3.patch +++ /dev/null @@ -1,187 +0,0 @@ -diff -urN Python-3.2a3/Lib/plat-haiku/regen Python-3.2a3-haiku/Lib/plat-haiku/regen ---- Python-3.2a3/Lib/plat-haiku/regen 1969-12-31 16:00:00.000000000 -0800 -+++ Python-3.2a3-haiku/Lib/plat-haiku/regen 2010-10-25 12:04:00.000000000 -0700 -@@ -0,0 +1,3 @@ -+#! /bin/sh -+set -v -+python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /boot/develop/headers/posix/netinet/in.h -diff -urN Python-3.2a3/Modules/resource.c Python-3.2a3-haiku/Modules/resource.c ---- Python-3.2a3/Modules/resource.c 2010-05-09 08:52:27.038797312 -0700 -+++ Python-3.2a3-haiku/Modules/resource.c 2010-10-26 09:40:31.530055168 -0700 -@@ -86,6 +86,7 @@ - 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)); -@@ -100,7 +101,7 @@ - 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)); -- -+#endif - if (PyErr_Occurred()) { - Py_DECREF(result); - return NULL; -diff -urN Python-3.2a3/Modules/socketmodule.c Python-3.2a3-haiku/Modules/socketmodule.c ---- Python-3.2a3/Modules/socketmodule.c 2010-09-28 15:03:27.048234496 -0700 -+++ Python-3.2a3-haiku/Modules/socketmodule.c 2010-10-26 09:42:24.675545088 -0700 -@@ -4595,7 +4595,9 @@ - PyModule_AddIntConstant(m, "SOCK_DGRAM", SOCK_DGRAM); - /* We have incomplete socket support. */ - PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW); -+#ifndef __HAIKU__ - PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET); -+#endif - #if defined(SOCK_RDM) - PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM); - #endif -diff -urN Python-3.2a3/Modules/socketmodule.h Python-3.2a3-haiku/Modules/socketmodule.h ---- Python-3.2a3/Modules/socketmodule.h 2010-08-28 13:42:55.046399488 -0700 -+++ Python-3.2a3-haiku/Modules/socketmodule.h 2010-10-26 09:36:23.904658944 -0700 -@@ -47,6 +47,10 @@ - # undef AF_NETLINK - #endif - -+#if defined (__HAIKU__) -+# undef HAVE_BLUETOOTH_BLUETOOTH_H -+#endif -+ - #ifdef HAVE_BLUETOOTH_BLUETOOTH_H - #include - #include -diff -urN Python-3.2a3/Modules/spwdmodule.c Python-3.2a3-haiku/Modules/spwdmodule.c ---- Python-3.2a3/Modules/spwdmodule.c 2010-05-15 09:27:27.038535168 -0700 -+++ Python-3.2a3-haiku/Modules/spwdmodule.c 2010-10-26 09:41:38.998506496 -0700 -@@ -80,7 +80,9 @@ - - 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 -urN Python-3.2a3/Python/bltinmodule.c Python-3.2a3-haiku/Python/bltinmodule.c ---- Python-3.2a3/Python/bltinmodule.c 2010-09-27 14:08:38.054788096 -0700 -+++ Python-3.2a3-haiku/Python/bltinmodule.c 2010-10-25 13:10:52.010747904 -0700 -@@ -22,7 +22,7 @@ - #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) - 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; - #elif defined(HAVE_LANGINFO_H) && defined(CODESET) -diff -urN Python-3.2a3/configure.in Python-3.2a3-haiku/configure.in ---- Python-3.2a3/configure.in 2010-10-10 01:10:16.033554432 -0700 -+++ Python-3.2a3-haiku/configure.in 2010-10-25 13:47:17.305135616 -0700 -@@ -292,6 +292,7 @@ - case $MACHDEP in - cygwin*) MACHDEP="cygwin";; - darwin*) MACHDEP="darwin";; -+ haiku*) MACHDEP="haiku";; - irix646) MACHDEP="irix6";; - '') MACHDEP="unknown";; - esac -@@ -733,7 +734,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} -@@ -818,6 +819,7 @@ - if test -z "$LN" ; then - case $ac_sys_system in - CYGWIN*) LN="ln -s";; -+ Haiku*) LN="ln -s";; - *) LN=ln;; - esac - fi -@@ -1748,7 +1750,7 @@ - fi - fi - ;; -- Linux*|GNU*|QNX*) -+ Linux*|GNU*|QNX*|Haiku*) - LDSHARED='$(CC) -shared' - LDCXXSHARED='$(CXX) -shared';; - BSD/OS*/4*) -@@ -1817,7 +1819,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*) -@@ -1848,7 +1850,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/*) - LINKFORSHARED="$extra_undefs -framework CoreFoundation" -@@ -1959,6 +1961,8 @@ - AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 - AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets - -+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # For Haiku -+ - AC_MSG_CHECKING(for --with-libs) - AC_ARG_WITH(libs, - AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs]), -@@ -3215,7 +3219,7 @@ - # check for --with-libm=... - AC_SUBST(LIBM) - case $ac_sys_system in --Darwin) ;; -+Darwin|Haiku*) ;; - *) LIBM=-lm - esac - AC_MSG_CHECKING(for --with-libm=STRING) -diff -urN Python-3.2a3/setup.py Python-3.2a3-haiku/setup.py ---- Python-3.2a3/setup.py 2010-09-14 12:41:23.030670848 -0700 -+++ Python-3.2a3-haiku/setup.py 2010-10-25 13:06:13.069992448 -0700 -@@ -423,6 +423,10 @@ - platform = self.get_platform() - srcdir = sysconfig.get_config_var('srcdir') - -+ if platform == 'haiku1': -+ inc_dirs += ['/boot/develop/headers/posix', '/boot/develop/headers/3rdparty', '/boot/common/include'] -+ lib_dirs += ['/boot/system/lib', '/boot/develop/lib/x86', '/boot/common/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'] -@@ -444,9 +448,9 @@ - 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 or Haiku, which don't need libm.a at all - math_libs = ['m'] -- if platform == 'darwin': -+ if platform == 'darwin' or platform == 'haiku': - math_libs = [] - - # XXX Omitted modules: gl, pure, dl, SGI-specific modules -@@ -1100,7 +1104,7 @@ - exts.append( Extension('resource', ['resource.c']) ) - - # Sun yellow pages. Some systems have the functions in libc. -- if (platform not in ['cygwin', 'qnx6'] and -+ if (platform not in ['cygwin', 'qnx6', 'haiku'] and - find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None): - if (self.compiler.find_library_file(lib_dirs, 'nsl')): - libs = ['nsl'] diff --git a/dev-lang/python/patches/python-3.2a4.patch b/dev-lang/python/patches/python-3.2a4.patch deleted file mode 100644 index 086526d4f..000000000 --- a/dev-lang/python/patches/python-3.2a4.patch +++ /dev/null @@ -1,187 +0,0 @@ -diff -urN Python-3.2a4/Lib/plat-haiku/regen Python-3.2a4-haiku/Lib/plat-haiku/regen ---- Python-3.2a4/Lib/plat-haiku/regen 1970-01-01 00:00:00.000000000 +0000 -+++ Python-3.2a4-haiku/Lib/plat-haiku/regen 2010-11-22 11:11:57.509870080 +0000 -@@ -0,0 +1,3 @@ -+#! /bin/sh -+set -v -+python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /boot/develop/headers/posix/netinet/in.h -diff -urN Python-3.2a4/Modules/resource.c Python-3.2a4-haiku/Modules/resource.c ---- Python-3.2a4/Modules/resource.c 2010-05-09 15:52:27.011796480 +0000 -+++ Python-3.2a4-haiku/Modules/resource.c 2010-11-22 11:11:57.581173248 +0000 -@@ -86,6 +86,7 @@ - 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)); -@@ -100,7 +101,7 @@ - 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)); -- -+#endif - if (PyErr_Occurred()) { - Py_DECREF(result); - return NULL; -diff -urN Python-3.2a4/Modules/socketmodule.c Python-3.2a4-haiku/Modules/socketmodule.c ---- Python-3.2a4/Modules/socketmodule.c 2010-11-05 17:24:13.021233664 +0000 -+++ Python-3.2a4-haiku/Modules/socketmodule.c 2010-11-22 11:11:57.722468864 +0000 -@@ -4684,7 +4684,9 @@ - PyModule_AddIntConstant(m, "SOCK_DGRAM", SOCK_DGRAM); - /* We have incomplete socket support. */ - PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW); -+#ifndef __HAIKU__ - PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET); -+#endif - #if defined(SOCK_RDM) - PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM); - #endif -diff -urN Python-3.2a4/Modules/socketmodule.h Python-3.2a4-haiku/Modules/socketmodule.h ---- Python-3.2a4/Modules/socketmodule.h 2010-08-28 20:42:55.019398656 +0000 -+++ Python-3.2a4-haiku/Modules/socketmodule.h 2010-11-22 11:11:57.790626304 +0000 -@@ -47,6 +47,10 @@ - # undef AF_NETLINK - #endif - -+#if defined (__HAIKU__) -+# undef HAVE_BLUETOOTH_BLUETOOTH_H -+#endif -+ - #ifdef HAVE_BLUETOOTH_BLUETOOTH_H - #include - #include -diff -urN Python-3.2a4/Modules/spwdmodule.c Python-3.2a4-haiku/Modules/spwdmodule.c ---- Python-3.2a4/Modules/spwdmodule.c 2010-05-15 16:27:27.011534336 +0000 -+++ Python-3.2a4-haiku/Modules/spwdmodule.c 2010-11-22 11:11:57.802422784 +0000 -@@ -80,7 +80,9 @@ - - 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 -urN Python-3.2a4/Python/bltinmodule.c Python-3.2a4-haiku/Python/bltinmodule.c ---- Python-3.2a4/Python/bltinmodule.c 2010-10-17 20:54:53.028049408 +0000 -+++ Python-3.2a4-haiku/Python/bltinmodule.c 2010-11-22 11:11:57.832831488 +0000 -@@ -22,7 +22,7 @@ - #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) - 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; - #elif defined(HAVE_LANGINFO_H) && defined(CODESET) -diff -urN Python-3.2a4/configure.in Python-3.2a4-haiku/configure.in ---- Python-3.2a4/configure.in 2010-11-01 01:44:30.004980736 +0000 -+++ Python-3.2a4-haiku/configure.in 2010-11-22 11:14:04.316407808 +0000 -@@ -292,6 +292,7 @@ - case $MACHDEP in - cygwin*) MACHDEP="cygwin";; - darwin*) MACHDEP="darwin";; -+ haiku*) MACHDEP="haiku";; - irix646) MACHDEP="irix6";; - '') MACHDEP="unknown";; - esac -@@ -738,7 +739,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$(LDVERSION).so' - BLDLIBRARY='-L. -lpython$(LDVERSION)' - RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} -@@ -823,6 +824,7 @@ - if test -z "$LN" ; then - case $ac_sys_system in - CYGWIN*) LN="ln -s";; -+ Haiku*) LN="ln -s";; - *) LN=ln;; - esac - fi -@@ -1709,7 +1711,7 @@ - fi - fi - ;; -- Linux*|GNU*|QNX*) -+ Linux*|GNU*|QNX*|Haiku*) - LDSHARED='$(CC) -shared' - LDCXXSHARED='$(CXX) -shared';; - BSD/OS*/4*) -@@ -1778,7 +1780,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*) -@@ -1809,7 +1811,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/*) - LINKFORSHARED="$extra_undefs -framework CoreFoundation" -@@ -1920,6 +1922,8 @@ - AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 - AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets - -+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # For Haiku -+ - AC_MSG_CHECKING(for --with-libs) - AC_ARG_WITH(libs, - AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs]), -@@ -3192,7 +3196,7 @@ - # check for --with-libm=... - AC_SUBST(LIBM) - case $ac_sys_system in --Darwin) ;; -+Darwin|Haiku*) ;; - *) LIBM=-lm - esac - AC_MSG_CHECKING(for --with-libm=STRING) -diff -urN Python-3.2a4/setup.py Python-3.2a4-haiku/setup.py ---- Python-3.2a4/setup.py 2010-10-31 17:11:02.000000000 +0000 -+++ Python-3.2a4-haiku/setup.py 2010-11-22 11:11:58.034603008 +0000 -@@ -429,6 +429,10 @@ - platform = self.get_platform() - srcdir = sysconfig.get_config_var('srcdir') - -+ if platform == 'haiku1': -+ inc_dirs += ['/boot/develop/headers/posix', '/boot/develop/headers/3rdparty', '/boot/common/include'] -+ lib_dirs += ['/boot/system/lib', '/boot/develop/lib/x86', '/boot/common/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'] -@@ -450,9 +454,9 @@ - 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 or Haiku, which don't need libm.a at all - math_libs = ['m'] -- if platform == 'darwin': -+ if platform == 'darwin' or platform == 'haiku': - math_libs = [] - - # XXX Omitted modules: gl, pure, dl, SGI-specific modules -@@ -1110,7 +1114,7 @@ - exts.append( Extension('resource', ['resource.c']) ) - - # Sun yellow pages. Some systems have the functions in libc. -- if (platform not in ['cygwin', 'qnx6'] and -+ if (platform not in ['cygwin', 'qnx6', 'haiku'] and - find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None): - if (self.compiler.find_library_file(lib_dirs, 'nsl')): - libs = ['nsl'] diff --git a/dev-lang/python/patches/python-3.2b2.patch b/dev-lang/python/patches/python-3.2b2.patch deleted file mode 100644 index d8ff7e50a..000000000 --- a/dev-lang/python/patches/python-3.2b2.patch +++ /dev/null @@ -1,187 +0,0 @@ -diff -urN Python-3.2b2/Lib/plat-haiku/regen Python-3.2b2-haiku/Lib/plat-haiku/regen ---- Python-3.2b2/Lib/plat-haiku/regen 1970-01-01 00:00:00.000000000 +0000 -+++ Python-3.2b2-haiku/Lib/plat-haiku/regen 2010-11-22 11:11:57.509870080 +0000 -@@ -0,0 +1,3 @@ -+#! /bin/sh -+set -v -+python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' /boot/develop/headers/posix/netinet/in.h -diff -urN Python-3.2b2/Modules/resource.c Python-3.2b2-haiku/Modules/resource.c ---- Python-3.2b2/Modules/resource.c 2010-05-09 15:52:27.011796480 +0000 -+++ Python-3.2b2-haiku/Modules/resource.c 2010-11-22 11:11:57.581173248 +0000 -@@ -86,6 +86,7 @@ - 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)); -@@ -100,7 +101,7 @@ - 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)); -- -+#endif - if (PyErr_Occurred()) { - Py_DECREF(result); - return NULL; -diff -urN Python-3.2b2/Modules/socketmodule.c Python-3.2b2-haiku/Modules/socketmodule.c ---- Python-3.2b2/Modules/socketmodule.c 2010-11-05 17:24:13.021233664 +0000 -+++ Python-3.2b2-haiku/Modules/socketmodule.c 2010-11-22 11:11:57.722468864 +0000 -@@ -4684,7 +4684,9 @@ - PyModule_AddIntConstant(m, "SOCK_DGRAM", SOCK_DGRAM); - /* We have incomplete socket support. */ - PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW); -+#ifndef __HAIKU__ - PyModule_AddIntConstant(m, "SOCK_SEQPACKET", SOCK_SEQPACKET); -+#endif - #if defined(SOCK_RDM) - PyModule_AddIntConstant(m, "SOCK_RDM", SOCK_RDM); - #endif -diff -urN Python-3.2b2/Modules/socketmodule.h Python-3.2b2-haiku/Modules/socketmodule.h ---- Python-3.2b2/Modules/socketmodule.h 2010-08-28 20:42:55.019398656 +0000 -+++ Python-3.2b2-haiku/Modules/socketmodule.h 2010-11-22 11:11:57.790626304 +0000 -@@ -47,6 +47,10 @@ - # undef AF_NETLINK - #endif - -+#if defined (__HAIKU__) -+# undef HAVE_BLUETOOTH_BLUETOOTH_H -+#endif -+ - #ifdef HAVE_BLUETOOTH_BLUETOOTH_H - #include - #include -diff -urN Python-3.2b2/Modules/spwdmodule.c Python-3.2b2-haiku/Modules/spwdmodule.c ---- Python-3.2b2/Modules/spwdmodule.c 2010-05-15 16:27:27.011534336 +0000 -+++ Python-3.2b2-haiku/Modules/spwdmodule.c 2010-11-22 11:11:57.802422784 +0000 -@@ -80,7 +80,9 @@ - - 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 -urN Python-3.2b2/Python/bltinmodule.c Python-3.2b2-haiku/Python/bltinmodule.c ---- Python-3.2b2/Python/bltinmodule.c 2010-10-17 20:54:53.028049408 +0000 -+++ Python-3.2b2-haiku/Python/bltinmodule.c 2010-11-22 11:11:57.832831488 +0000 -@@ -22,7 +22,7 @@ - #if defined(MS_WINDOWS) && defined(HAVE_USABLE_WCHAR_T) - 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; - #elif defined(HAVE_LANGINFO_H) && defined(CODESET) -diff -urN Python-3.2b2/configure.in Python-3.2b2-haiku/configure.in ---- Python-3.2b2/configure.in 2010-11-01 01:44:30.004980736 +0000 -+++ Python-3.2b2-haiku/configure.in 2010-11-22 11:14:04.316407808 +0000 -@@ -292,6 +292,7 @@ - case $MACHDEP in - cygwin*) MACHDEP="cygwin";; - darwin*) MACHDEP="darwin";; -+ haiku*) MACHDEP="haiku";; - irix646) MACHDEP="irix6";; - '') MACHDEP="unknown";; - esac -@@ -738,7 +739,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$(LDVERSION).so' - BLDLIBRARY='-L. -lpython$(LDVERSION)' - RUNSHARED=LD_LIBRARY_PATH=`pwd`:${LD_LIBRARY_PATH} -@@ -823,6 +824,7 @@ - if test -z "$LN" ; then - case $ac_sys_system in - CYGWIN*) LN="ln -s";; -+ Haiku*) LN="ln -s";; - *) LN=ln;; - esac - fi -@@ -1709,7 +1711,7 @@ - fi - fi - ;; -- Linux*|GNU*|QNX*) -+ Linux*|GNU*|QNX*|Haiku*) - LDSHARED='$(CC) -shared' - LDCXXSHARED='$(CXX) -shared';; - BSD/OS*/4*) -@@ -1778,7 +1780,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*) -@@ -1809,7 +1811,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/*) - LINKFORSHARED="$extra_undefs -framework CoreFoundation" -@@ -1920,6 +1922,8 @@ - AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 - AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets - -+AC_CHECK_LIB(network, socket, [LIBS="-lnetwork $LIBS"], [], $LIBS) # For Haiku -+ - AC_MSG_CHECKING(for --with-libs) - AC_ARG_WITH(libs, - AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs]), -@@ -3192,7 +3196,7 @@ - # check for --with-libm=... - AC_SUBST(LIBM) - case $ac_sys_system in --Darwin) ;; -+Darwin|Haiku*) ;; - *) LIBM=-lm - esac - AC_MSG_CHECKING(for --with-libm=STRING) -diff -urN Python-3.2b2/setup.py Python-3.2b2-haiku/setup.py ---- Python-3.2b2/setup.py 2010-10-31 17:11:02.000000000 +0000 -+++ Python-3.2b2-haiku/setup.py 2010-11-22 11:11:58.034603008 +0000 -@@ -429,6 +429,10 @@ - platform = self.get_platform() - srcdir = sysconfig.get_config_var('srcdir') - -+ if platform == 'haiku1': -+ inc_dirs += ['/boot/develop/headers/posix', '/boot/develop/headers/3rdparty', '/boot/common/include'] -+ lib_dirs += ['/boot/system/lib', '/boot/develop/lib/x86', '/boot/common/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'] -@@ -450,9 +454,9 @@ - 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 or Haiku, which don't need libm.a at all - math_libs = ['m'] -- if platform == 'darwin': -+ if platform == 'darwin' or platform == 'haiku': - math_libs = [] - - # XXX Omitted modules: gl, pure, dl, SGI-specific modules -@@ -1110,7 +1114,7 @@ - exts.append( Extension('resource', ['resource.c']) ) - - # Sun yellow pages. Some systems have the functions in libc. -- if (platform not in ['cygwin', 'qnx6'] and -+ if (platform not in ['cygwin', 'qnx6', 'haiku'] and - find_file('rpcsvc/yp_prot.h', inc_dirs, []) is not None): - if (self.compiler.find_library_file(lib_dirs, 'nsl')): - libs = ['nsl'] diff --git a/dev-lang/python/patches/python3-3.4.3.patchset b/dev-lang/python/patches/python3-3.4.3.patchset deleted file mode 100644 index 5829fc931..000000000 --- a/dev-lang/python/patches/python3-3.4.3.patchset +++ /dev/null @@ -1,543 +0,0 @@ -From aacc2ed7b074730d2ff7f03c6d162a578e73e059 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 d768dc5..21e3fd5 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. -@@ -406,10 +435,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: -@@ -425,7 +460,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 a1452fe..07e2225 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 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 ad5d136..c00666c 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 76aef28..4b06354 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -119,7 +119,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 628dec2..5e6bb3f 100644 ---- a/Modules/posixmodule.c -+++ b/Modules/posixmodule.c -@@ -12023,7 +12023,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..bb56e30 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; -@@ -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 cb44d05..4023304 100644 ---- a/Modules/socketmodule.c -+++ b/Modules/socketmodule.c -@@ -6094,7 +6094,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 4b4f979..48a2897 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 a0d0afa..aad64a8 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -956,7 +956,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:+:${LD_LIBRARY_PATH}} -@@ -964,6 +964,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 -@@ -1055,6 +1058,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 -@@ -2055,7 +2059,7 @@ then - BLDSHARED="$LDSHARED" - fi - ;; -- Linux*|GNU*|QNX*) -+ Linux*|GNU*|QNX*|Haiku*) - LDSHARED='$(CC) -shared' - LDCXXSHARED='$(CXX) -shared';; - BSD/OS*/4*) -@@ -2124,7 +2128,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*) -@@ -2155,7 +2159,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" -@@ -2329,6 +2333,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]), -@@ -3663,6 +3673,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 2779658..b1ff43a 100644 ---- a/setup.py -+++ b/setup.py -@@ -523,6 +523,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']: -@@ -550,9 +556,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 -@@ -762,15 +768,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/' - ] ) -@@ -778,8 +791,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: -@@ -819,8 +832,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" % -@@ -1254,7 +1267,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/patches/python3-3.5.3.patchset b/dev-lang/python/patches/python3-3.5.3.patchset deleted file mode 100644 index 75be7ee99..000000000 --- a/dev-lang/python/patches/python3-3.5.3.patchset +++ /dev/null @@ -1,540 +0,0 @@ -From ac95fb3752253b437b5bf7a2ca20e6e2527a73b6 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 67db007..dc1c894 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. -@@ -406,10 +435,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: -@@ -425,7 +460,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 573724d..10dd008 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 3f78ef5..e2616e8 100644 ---- a/Lib/site.py -+++ b/Lib/site.py -@@ -302,7 +302,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 12f2f11..097ec1b 100644 ---- a/Lib/test/test_fileio.py -+++ b/Lib/test/test_fileio.py -@@ -377,6 +377,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 a88b7d5..c305955 100644 ---- a/Makefile.pre.in -+++ b/Makefile.pre.in -@@ -125,7 +125,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 3e446a5..fd24794 100644 ---- a/Modules/posixmodule.c -+++ b/Modules/posixmodule.c -@@ -12788,7 +12788,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 970ee84..c38c716 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; -@@ -332,19 +348,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 - -@@ -356,31 +372,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 af6cc94..8631fca 100644 ---- a/Modules/socketmodule.c -+++ b/Modules/socketmodule.c -@@ -6443,7 +6443,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 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 4b9f3cd..76e7d46 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 9f5db2a..0091e48 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 0967fc2..e30a59a 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 49d1a37..34a810e 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -1129,6 +1129,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) -@@ -1205,6 +1215,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 -@@ -2437,7 +2448,7 @@ then - BLDSHARED="$LDSHARED" - fi - ;; -- Linux*|GNU*|QNX*) -+ Linux*|GNU*|QNX*|Haiku*) - LDSHARED='$(CC) -shared' - LDCXXSHARED='$(CXX) -shared';; - BSD/OS*/4*) -@@ -2506,7 +2517,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*) -@@ -2537,7 +2548,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" -@@ -2719,6 +2730,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]), -@@ -4066,6 +4083,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 40f8bf2..be498e3 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'] -@@ -563,6 +563,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']: -@@ -811,15 +817,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/' - ] ) -@@ -827,8 +840,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: -@@ -868,8 +881,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" % -@@ -1303,7 +1316,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/patches/python3-3.7.2.patchset b/dev-lang/python/patches/python3-3.7.3.patchset similarity index 95% rename from dev-lang/python/patches/python3-3.7.2.patchset rename to dev-lang/python/patches/python3-3.7.3.patchset index 535174259..66e152866 100644 --- a/dev-lang/python/patches/python3-3.7.2.patchset +++ b/dev-lang/python/patches/python3-3.7.3.patchset @@ -1,4 +1,4 @@ -From 86342bd79fd31f85bfb8df30d0b8bf1cc66cbd75 Mon Sep 17 00:00:00 2001 +From a4cd9d290a0fe86b16dbd55dc5de35390ba2bd0d Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Thu, 10 Apr 2014 16:03:33 +0000 Subject: initial Haiku patch @@ -86,10 +86,10 @@ index 0258d3d..aaec6e6 100644 def finalize_other(self): """Finalizes options for non-posix platforms""" diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py -index 2bcd1dd..8d8ff39 100644 +index 83160f8..7e9fec5 100644 --- a/Lib/distutils/sysconfig.py +++ b/Lib/distutils/sysconfig.py -@@ -99,7 +99,8 @@ def get_python_inc(plat_specific=0, prefix=None): +@@ -107,7 +107,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 @@ -97,9 +97,9 @@ index 2bcd1dd..8d8ff39 100644 + 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: -@@ -129,12 +130,20 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None): + if python_build: + # Include both the include and PC dir to ensure we can find +@@ -142,12 +143,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": @@ -136,7 +136,7 @@ index 0000000..4372ee2 +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 ffd132b..9876642 100644 +index ad11463..e39080e 100644 --- a/Lib/site.py +++ b/Lib/site.py @@ -258,6 +258,14 @@ def _getuserbase(): @@ -215,7 +215,7 @@ index 11180b7..d99f73e 100644 def test_mknod_dir_fd(self): # Test using mknodat() to create a FIFO (the only use specified diff --git a/Makefile.pre.in b/Makefile.pre.in -index d912a19..4829a67 100644 +index 2d2e11f..b1848a2 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -141,7 +141,7 @@ BINDIR= @bindir@ @@ -228,10 +228,10 @@ index d912a19..4829a67 100644 ABIFLAGS= @ABIFLAGS@ diff --git a/Modules/resource.c b/Modules/resource.c -index 113ad5c..b9de0ab 100644 +index e59280f..f1aaef9 100644 --- a/Modules/resource.c +++ b/Modules/resource.c -@@ -102,6 +102,7 @@ resource_getrusage(PyObject *self, PyObject *args) +@@ -102,6 +102,7 @@ resource_getrusage_impl(PyObject *module, int who) PyFloat_FromDouble(doubletime(ru.ru_utime))); PyStructSequence_SET_ITEM(result, 1, PyFloat_FromDouble(doubletime(ru.ru_stime))); @@ -239,7 +239,7 @@ index 113ad5c..b9de0ab 100644 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)); -@@ -116,7 +117,22 @@ resource_getrusage(PyObject *self, PyObject *args) +@@ -116,7 +117,22 @@ resource_getrusage_impl(PyObject *module, int who) 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)); @@ -327,10 +327,10 @@ index 113ad5c..b9de0ab 100644 #endif diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c -index ed31667..e1c163e 100644 +index 988471e..d1f3bcf 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c -@@ -7122,7 +7122,9 @@ PyInit__socket(void) +@@ -7142,7 +7142,9 @@ PyInit__socket(void) /* SOCK_RAW is marked as optional in the POSIX specification */ PyModule_AddIntMacro(m, SOCK_RAW); #endif @@ -341,7 +341,7 @@ index ed31667..e1c163e 100644 PyModule_AddIntMacro(m, SOCK_RDM); #endif diff --git a/Modules/socketmodule.h b/Modules/socketmodule.h -index af7c36a..ca5a873 100644 +index 0b2edc1..1ee4fdd 100644 --- a/Modules/socketmodule.h +++ b/Modules/socketmodule.h @@ -54,6 +54,10 @@ typedef int socklen_t; @@ -381,7 +381,7 @@ index 1601ec0..4c98fe8 100644 else PyErr_SetString(PyExc_KeyError, "getspnam(): name not found"); diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c -index d7b0bbd..ee9bebc 100644 +index 6306c3a..847becf 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -17,7 +17,7 @@ @@ -419,7 +419,7 @@ index 4363c0c..40994b0 100755 def main(): global filedict diff --git a/configure.ac b/configure.ac -index 3f2459a..62bc0c0 100644 +index ad0f4d4..80d2649 100644 --- a/configure.ac +++ b/configure.ac @@ -1151,6 +1151,16 @@ if test $enable_shared = "yes"; then @@ -474,7 +474,7 @@ index 3f2459a..62bc0c0 100644 # -u libsys_s pulls in all symbols in libsys Darwin/*) LINKFORSHARED="$extra_undefs -framework CoreFoundation" -@@ -2949,6 +2960,12 @@ LDFLAGS="-fsanitize=address $LDFLAGS" +@@ -2949,6 +2960,12 @@ LDFLAGS="-fsanitize=undefined $LDFLAGS" AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets @@ -487,7 +487,7 @@ index 3f2459a..62bc0c0 100644 AC_MSG_CHECKING(for --with-libs) AC_ARG_WITH(libs, AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs]), -@@ -4276,6 +4293,7 @@ fi], +@@ -4293,6 +4310,7 @@ AC_CHECK_FUNC(__fpu_control, AC_SUBST(LIBM) case $ac_sys_system in Darwin) ;; @@ -571,15 +571,18 @@ index b4357e3..df227d1 100644 return None libs = [] +-- +2.21.0 -From d9e7a5386b6668d9bf46b1ade6356322ea11fa41 Mon Sep 17 00:00:00 2001 + +From b06b387748b4a4f7dfc989a02ab3e9b0dd5ad4b6 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sun, 16 Apr 2017 10:05:42 +0200 Subject: fix for negative errnos diff --git a/Lib/subprocess.py b/Lib/subprocess.py -index 290ae44..95ec9d3 100644 +index 3c1abb7..5e96075 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -1508,6 +1508,8 @@ class Popen(object): @@ -592,7 +595,7 @@ index 290ae44..95ec9d3 100644 if child_exec_never_called: err_msg = "" diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c -index fe0e554..d2a0d52 100644 +index 3cf0683..adf3608 100644 --- a/Modules/_posixsubprocess.c +++ b/Modules/_posixsubprocess.c @@ -534,6 +534,10 @@ error: @@ -607,17 +610,17 @@ index fe0e554..d2a0d52 100644 *--cur = Py_hexdigits[saved_errno % 16]; saved_errno /= 16; -- -2.19.1 +2.21.0 -From f9408c3d0f3242fa21cb06278ded8b684eafd805 Mon Sep 17 00:00:00 2001 +From 6bb4b749c391d619d74e9f2c741854878b9527dc Mon Sep 17 00:00:00 2001 From: Philippe Houdoin Date: Wed, 24 May 2017 11:09:43 +0000 Subject: Implement CTypes's find_library for Haiku diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py -index 339ae8a..d537963 100644 +index 97973bc..b2e4095 100644 --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py @@ -252,6 +252,56 @@ elif os.name == "posix": @@ -691,5 +694,5 @@ index 339ae8a..d537963 100644 print(cdll.LoadLibrary("libm.so")) print(cdll.LoadLibrary("libcrypt.so")) -- -2.19.1 +2.21.0 diff --git a/dev-lang/python/patches/python3_x86-3.7.2.patchset b/dev-lang/python/patches/python3_x86-3.7.3.patchset similarity index 100% rename from dev-lang/python/patches/python3_x86-3.7.2.patchset rename to dev-lang/python/patches/python3_x86-3.7.3.patchset diff --git a/dev-lang/python/python-2.7.12.recipe b/dev-lang/python/python-2.7.12.recipe deleted file mode 100644 index 7d6784ade..000000000 --- a/dev-lang/python/python-2.7.12.recipe +++ /dev/null @@ -1,111 +0,0 @@ -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="https://www.python.org" -COPYRIGHT="1990-2012, Python Software Foundation" -LICENSE="Python" -REVISION="2" -SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz" -CHECKSUM_SHA256="d7837121dd5652a05fef807c361909d255d173280c4e1a4ded94d73d80a1f978" -SOURCE_DIR="Python-$portVersion" -PATCHES="python-$portVersion.patchset" - -ARCHITECTURES="x86_gcc2 x86 x86_64" - -GLOBAL_WRITABLE_FILES=" - non-packaged/lib/python2.7/site-packages directory keep-old - " - -PROVIDES=" - python = $portVersion compat >= 2.7 - cmd:2to3 = $portVersion compat >= 2.7 - cmd:idle = $portVersion compat >= 2.7 - cmd:pydoc = $portVersion compat >= 2.7 - cmd:python = $portVersion compat >= 2.7 - cmd:python2 = $portVersion compat >= 2.7 - cmd:python2.7 = $portVersion compat >= 2.7 - cmd:python2.7_config = $portVersion compat >= 2.7 - cmd:python2_config = $portVersion compat >= 2.7 - cmd:python_config = $portVersion compat >= 2.7 - cmd:smtpd.py = $portVersion compat >= 2.7 - devel:libpython2.7 = 1.0 - lib:libpython2.7 = 1.0 - " -REQUIRES=" - haiku - lib:libbz2 - lib:libffi - lib:libncurses - lib:libreadline - lib:libsqlite3 - lib:libssl - lib:libz - " - -BUILD_REQUIRES=" - devel:libbz2 - devel:libffi - devel:libncurses - devel:libreadline - devel:libsqlite3 - devel:libssl - devel:libz - " -BUILD_PREREQUIRES=" - haiku_devel - cmd:aclocal - cmd:autoconf - cmd:find - cmd:gcc - cmd:ld - cmd:libtoolize - cmd:make - cmd:pkg_config - " - -BUILD() -{ - cd Modules/_ctypes/libffi - libtoolize --force --copy --install - cd ../../.. - - libtoolize --force --copy --install - aclocal - autoconf - runConfigure ./configure --with-system-ffi \ - --enable-shared \ - --enable-unicode=ucs4 - - # prevent make from rebuilding stuff that requires python - touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h \ - Python/opcode_targets.h - - make $jobArgs -} - -INSTALL() -{ - make install - - prepareInstalledDevelLibs libpython2.7 - fixPkgconfig - - mkdir -p $prefix/lib/python2.7/vendor-packages - echo 'This directory contains packaged python modules.' \ - >$prefix/lib/python2.7/vendor-packages/README - - mkdir -p $prefix/non-packaged/lib/python2.7 - mv $prefix/lib/python2.7/site-packages $prefix/non-packaged/lib/python2.7/ -} - -TEST() -{ - make $jobArgs test -} diff --git a/dev-lang/python/python-2.7.13.recipe b/dev-lang/python/python-2.7.13.recipe deleted file mode 100644 index eec7a8d45..000000000 --- a/dev-lang/python/python-2.7.13.recipe +++ /dev/null @@ -1,111 +0,0 @@ -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="https://www.python.org" -COPYRIGHT="1990-2017, Python Software Foundation" -LICENSE="Python" -REVISION="4" -SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz" -CHECKSUM_SHA256="35d543986882f78261f97787fd3e06274bfa6df29fac9b4a94f73930ff98f731" -SOURCE_DIR="Python-$portVersion" -PATCHES="python-$portVersion.patchset" - -ARCHITECTURES="?x86_gcc2 x86 x86_64" - -GLOBAL_WRITABLE_FILES=" - non-packaged/lib/python2.7/site-packages directory keep-old - " - -PROVIDES=" - python = $portVersion compat >= 2.7 - cmd:2to3 = $portVersion compat >= 2.7 - cmd:idle = $portVersion compat >= 2.7 - cmd:pydoc = $portVersion compat >= 2.7 - cmd:python = $portVersion compat >= 2.7 - cmd:python2 = $portVersion compat >= 2.7 - cmd:python2.7 = $portVersion compat >= 2.7 - cmd:python2.7_config = $portVersion compat >= 2.7 - cmd:python2_config = $portVersion compat >= 2.7 - cmd:python_config = $portVersion compat >= 2.7 - cmd:smtpd.py = $portVersion compat >= 2.7 - devel:libpython2.7 = 1.0 - lib:libpython2.7 = 1.0 - " -REQUIRES=" - haiku - lib:libbz2 - lib:libffi - lib:libncurses - lib:libreadline - lib:libsqlite3 - lib:libssl - lib:libz - " - -BUILD_REQUIRES=" - devel:libbz2 - devel:libffi - devel:libncurses - devel:libreadline - devel:libsqlite3 - devel:libssl - devel:libz - " -BUILD_PREREQUIRES=" - haiku_devel - cmd:aclocal - cmd:autoconf - cmd:find - cmd:gcc - cmd:ld - cmd:libtoolize - cmd:make - cmd:pkg_config - " - -BUILD() -{ - cd Modules/_ctypes/libffi - libtoolize --force --copy --install - cd ../../.. - - libtoolize --force --copy --install - aclocal - autoconf - runConfigure ./configure --with-system-ffi \ - --enable-shared \ - --enable-unicode=ucs4 - - # prevent make from rebuilding stuff that requires python - touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h \ - Python/opcode_targets.h - - make $jobArgs -} - -INSTALL() -{ - make install - - prepareInstalledDevelLibs libpython2.7 - fixPkgconfig - - mkdir -p $prefix/lib/python2.7/vendor-packages - echo 'This directory contains packaged python modules.' \ - >$prefix/lib/python2.7/vendor-packages/README - - mkdir -p $prefix/non-packaged/lib/python2.7 - mv $prefix/lib/python2.7/site-packages $prefix/non-packaged/lib/python2.7/ -} - -TEST() -{ - make $jobArgs test -} diff --git a/dev-lang/python/python-2.7.14.recipe b/dev-lang/python/python-2.7.14.recipe deleted file mode 100644 index 3574801ef..000000000 --- a/dev-lang/python/python-2.7.14.recipe +++ /dev/null @@ -1,111 +0,0 @@ -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="https://www.python.org/" -COPYRIGHT="1990-2017 Python Software Foundation" -LICENSE="Python" -REVISION="2" -SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz" -CHECKSUM_SHA256="71ffb26e09e78650e424929b2b457b9c912ac216576e6bd9e7d204ed03296a66" -SOURCE_DIR="Python-$portVersion" -PATCHES="python-$portVersion.patchset" - -ARCHITECTURES="?x86_gcc2 x86 x86_64" - -GLOBAL_WRITABLE_FILES=" - non-packaged/lib/python2.7/site-packages directory keep-old - " - -PROVIDES=" - python = $portVersion compat >= 2.7 - cmd:2to3 = $portVersion compat >= 2.7 - cmd:idle = $portVersion compat >= 2.7 - cmd:pydoc = $portVersion compat >= 2.7 - cmd:python = $portVersion compat >= 2.7 - cmd:python2 = $portVersion compat >= 2.7 - cmd:python2.7 = $portVersion compat >= 2.7 - cmd:python2.7_config = $portVersion compat >= 2.7 - cmd:python2_config = $portVersion compat >= 2.7 - cmd:python_config = $portVersion compat >= 2.7 - cmd:smtpd.py = $portVersion compat >= 2.7 - devel:libpython2.7 = 1.0 - lib:libpython2.7 = 1.0 - " -REQUIRES=" - haiku - lib:libbz2 - lib:libffi - lib:libncurses - lib:libreadline - lib:libsqlite3 - lib:libssl - lib:libz - " - -BUILD_REQUIRES=" - devel:libbz2 - devel:libffi - devel:libncurses - devel:libreadline - devel:libsqlite3 - devel:libssl - devel:libz - " -BUILD_PREREQUIRES=" - haiku_devel - cmd:aclocal - cmd:autoconf - cmd:find - cmd:gcc - cmd:ld - cmd:libtoolize - cmd:make - cmd:pkg_config - " - -BUILD() -{ - cd Modules/_ctypes/libffi - libtoolize --force --copy --install - cd ../../.. - - libtoolize --force --copy --install - aclocal - autoconf - runConfigure ./configure --with-system-ffi \ - --enable-shared \ - --enable-unicode=ucs4 - - # prevent make from rebuilding stuff that requires python - touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h \ - Python/opcode_targets.h - - make $jobArgs -} - -INSTALL() -{ - make install - - prepareInstalledDevelLibs libpython2.7 - fixPkgconfig - - mkdir -p $prefix/lib/python2.7/vendor-packages - echo 'This directory contains packaged python modules.' \ - >$prefix/lib/python2.7/vendor-packages/README - - mkdir -p $prefix/non-packaged/lib/python2.7 - mv $prefix/lib/python2.7/site-packages $prefix/non-packaged/lib/python2.7/ -} - -TEST() -{ - make $jobArgs test -} diff --git a/dev-lang/python/python-2.7.15.recipe b/dev-lang/python/python-2.7.16.recipe similarity index 96% rename from dev-lang/python/python-2.7.15.recipe rename to dev-lang/python/python-2.7.16.recipe index 4d25a1b63..42dae752d 100644 --- a/dev-lang/python/python-2.7.15.recipe +++ b/dev-lang/python/python-2.7.16.recipe @@ -13,7 +13,7 @@ COPYRIGHT="1990-2018 Python Software Foundation" LICENSE="Python" REVISION="1" SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz" -CHECKSUM_SHA256="22d9b1ac5b26135ad2b8c2901a9413537e08749a753356ee913c84dbd2df5574" +CHECKSUM_SHA256="f222ef602647eecb6853681156d32de4450a2c39f4de93bd5b20235f2e660ed7" SOURCE_DIR="Python-$portVersion" PATCHES="python-$portVersion.patchset" diff --git a/dev-lang/python/python3-3.7.2.recipe b/dev-lang/python/python3-3.7.3.recipe similarity index 98% rename from dev-lang/python/python3-3.7.2.recipe rename to dev-lang/python/python3-3.7.3.recipe index b0f947491..1e227bcac 100644 --- a/dev-lang/python/python3-3.7.2.recipe +++ b/dev-lang/python/python3-3.7.3.recipe @@ -13,7 +13,7 @@ LICENSE="Python" COPYRIGHT="1990-2018 Python Software Foundation" REVISION="1" SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz" -CHECKSUM_SHA256="d83fe8ce51b1bb48bbcf0550fd265b9a75cdfdfa93f916f9e700aef8444bf1bb" +CHECKSUM_SHA256="da60b54064d4cfcd9c26576f6df2690e62085123826cff2e667e72a91952d318" SOURCE_DIR="Python-$portVersion" PATCHES="python3-$portVersion.patchset" if [ "$secondaryArchSuffix" = _x86 ] ; then diff --git a/dev-lang/python/python35-3.5.3.recipe b/dev-lang/python/python35-3.5.3.recipe deleted file mode 100644 index 3daf7a8d9..000000000 --- a/dev-lang/python/python35-3.5.3.recipe +++ /dev/null @@ -1,129 +0,0 @@ -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="https://www.python.org" -LICENSE="Python" -COPYRIGHT="1990-2017, Python Software Foundation" -REVISION="2" -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 -}