diff --git a/dev-lang/python/patches/python-2.7.13.patchset b/dev-lang/python/patches/python-2.7.13.patchset index c97dd9405..36d00cd67 100644 --- a/dev-lang/python/patches/python-2.7.13.patchset +++ b/dev-lang/python/patches/python-2.7.13.patchset @@ -1,4 +1,4 @@ -From 77416c48c183b83a1fdf7aa4820d64df073af490 Mon Sep 17 00:00:00 2001 +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 @@ -756,10 +756,10 @@ index 54054c2..bc0ae02 100644 if (self.compiler.find_library_file(lib_dirs, 'nsl')): libs = ['nsl'] -- -2.10.2 +2.12.2 -From d16d03542badc6b541d3d73d0c87d3da690ce029 Mon Sep 17 00:00:00 2001 +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 @@ -779,10 +779,10 @@ index e288964..bf4f7ef 100644 # Detailed destination directories -- -2.10.2 +2.12.2 -From b40889db5ca2fd23962bd07bf3670569e3c1c69f Mon Sep 17 00:00:00 2001 +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 @@ -811,10 +811,10 @@ index 3b51e81..11fb12c 100644 sitepackages.append(os.path.join(prefix, "lib", "python" + sys.version[:3], -- -2.10.2 +2.12.2 -From 92fa53e4a517c45305d4dd473d04c48e42727413 Mon Sep 17 00:00:00 2001 +From db2f0d9278c2f2cb638fb63617d3a0ae83e0ba4a 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.10.2 +2.12.2 -From f2712d5a22bf59d5418f6233b6f6922aaa10de00 Mon Sep 17 00:00:00 2001 +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. @@ -866,10 +866,10 @@ index adf91d5..f284408 100644 self._extract_member(self._find_link_target(tarinfo), targetpath) except KeyError: -- -2.10.2 +2.12.2 -From b733169c0e28c09f826f11d7cca7027f27b8ac8c Mon Sep 17 00:00:00 2001 +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 @@ -902,10 +902,10 @@ index 6c5f52f..73758bb 100644 if (PyErr_Occurred()) { -- -2.10.2 +2.12.2 -From 4cc5f80a471d1261b04c08750cb95c1c8592c4f7 Mon Sep 17 00:00:00 2001 +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 @@ -981,10 +981,10 @@ index 73758bb..0c396f6 100644 #endif -- -2.10.2 +2.12.2 -From 82835c0f1c35f9b92fcb197d029eb1c782114b72 Mon Sep 17 00:00:00 2001 +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. @@ -1004,5 +1004,120 @@ index e73805f..515c61a 100644 PyStructSequence_SET_ITEM(v, 2, _PyInt_FromDev(st->st_dev)); #endif -- -2.10.2 +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/python3-3.6.1.patchset b/dev-lang/python/patches/python3-3.6.1.patchset index dca1817b2..bd8c3e891 100644 --- a/dev-lang/python/patches/python3-3.6.1.patchset +++ b/dev-lang/python/patches/python3-3.6.1.patchset @@ -1,4 +1,4 @@ -From 4f5d1b027f1e5b1bba2155aec103cec7233f9d7c Mon Sep 17 00:00:00 2001 +From 0172d4c19e066892e3009ae5fe41e7aa2a9bcff7 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Thu, 10 Apr 2014 16:03:33 +0000 Subject: initial Haiku patch @@ -536,10 +536,10 @@ index f04bf22..718c03a 100644 if (self.compiler.find_library_file(lib_dirs, 'nsl')): libs = ['nsl'] -- -2.11.0 +2.12.2 -From 7133afd2665e636cd11daadbaa672f1a45ed031e Mon Sep 17 00:00:00 2001 +From 98f3a8c3e3d810181523691d2f340aba0a35f538 Mon Sep 17 00:00:00 2001 From: Jerome Duval Date: Sun, 16 Apr 2017 10:05:42 +0200 Subject: fix for negative errnos @@ -574,5 +574,89 @@ index 5007a39..625c507 100644 *--cur = Py_hexdigits[saved_errno % 16]; saved_errno /= 16; -- -2.11.0 +2.12.2 + + +From 253ba23338ad0d16d6b0df8811d26fe8cd9f7bc0 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 +--- a/Lib/ctypes/util.py ++++ b/Lib/ctypes/util.py +@@ -243,6 +243,56 @@ 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('.') ++ nums = [] ++ try: ++ while parts: ++ nums.insert(0, int(parts.pop())) ++ except ValueError: ++ pass ++ 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', ++ 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): +@@ -328,6 +378,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 diff --git a/dev-lang/python/python-2.7.13.recipe b/dev-lang/python/python-2.7.13.recipe index af9925edc..c10c2d808 100644 --- a/dev-lang/python/python-2.7.13.recipe +++ b/dev-lang/python/python-2.7.13.recipe @@ -11,7 +11,7 @@ OSI-approved open source license. HOMEPAGE="http://www.python.org" LICENSE="Python" COPYRIGHT="1990-2017, Python Software Foundation" -REVISION="1" +REVISION="2" SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz" CHECKSUM_SHA256="35d543986882f78261f97787fd3e06274bfa6df29fac9b4a94f73930ff98f731" SOURCE_DIR="Python-$portVersion" diff --git a/dev-lang/python/python3-3.6.1.recipe b/dev-lang/python/python3-3.6.1.recipe index d13a81f16..f43fccfa4 100644 --- a/dev-lang/python/python3-3.6.1.recipe +++ b/dev-lang/python/python3-3.6.1.recipe @@ -11,7 +11,7 @@ OSI-approved open source license. HOMEPAGE="http://www.python.org" LICENSE="Python" COPYRIGHT="1990-2016, Python Software Foundation" -REVISION="2" +REVISION="3" SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz" CHECKSUM_SHA256="a01810ddfcec216bcdb357a84bfaafdfaa0ca42bbdaa4cb7ff74f5a9961e4041" SOURCE_DIR="Python-$portVersion"