python: bump version.

* remove two old recipes.
This commit is contained in:
Jerome Duval
2017-09-20 18:54:45 +02:00
parent 43b63a6859
commit a223f56d0e
4 changed files with 167 additions and 1170 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
From c0a96d9df40b6b648dede4fd54ce52c6bef67e1e Mon Sep 17 00:00:00 2001
From c612225170a65eb865430ced699feb7a98da7c46 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 12 Mar 2014 21:17:06 +0000
Subject: initial Haiku patch
@@ -465,7 +465,7 @@ 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 e21e47f..7baf562 100644
index 2825a87..26ca80f 100644
--- a/Lib/test/test_fileio.py
+++ b/Lib/test/test_fileio.py
@@ -308,6 +308,7 @@ class OtherFileTests(unittest.TestCase):
@@ -473,7 +473,7 @@ index e21e47f..7baf562 100644
if sys.platform != "darwin" and \
'bsd' not in sys.platform and \
+ 'haiku' not in sys.platform and \
not sys.platform.startswith('sunos'):
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
@@ -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 5def531..5e3e5cc 100644
index 3e3c05f..12d12d2 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -4871,7 +4871,9 @@ init_socket(void)
@@ -4896,7 +4896,9 @@ init_socket(void)
#ifndef __BEOS__
/* We have incomplete socket support. */
PyModule_AddIntConstant(m, "SOCK_RAW", SOCK_RAW);
@@ -558,7 +558,7 @@ index 12c43b0..206b325 100644
Py_BEGIN_ALLOW_THREADS
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index f052574..6a77f0d 100644
index f03e488..d4b9d8c 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -19,7 +19,7 @@
@@ -584,10 +584,10 @@ 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 78fe3c7..09f4249 100644
index 1273465..93ae44b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -889,7 +889,7 @@ if test $enable_shared = "yes"; then
@@ -909,7 +909,7 @@ if test $enable_shared = "yes"; then
RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
@@ -596,7 +596,7 @@ index 78fe3c7..09f4249 100644
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
@@ -917,6 +917,9 @@ if test $enable_shared = "yes"; then
FreeBSD*)
SOVERSION=`echo $SOVERSION|cut -d "." -f 1`
;;
@@ -606,7 +606,7 @@ index 78fe3c7..09f4249 100644
esac
INSTSONAME="$LDLIBRARY".$SOVERSION
;;
@@ -1012,7 +1015,7 @@ AC_PROG_MKDIR_P
@@ -1018,7 +1021,7 @@ AC_PROG_MKDIR_P
AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
@@ -615,7 +615,7 @@ index 78fe3c7..09f4249 100644
CYGWIN*) LN="ln -s";;
atheos*) LN="ln -s";;
*) LN=ln;;
@@ -2036,7 +2039,7 @@ then
@@ -2211,7 +2214,7 @@ then
BLDSHARED="$LDSHARED"
fi
;;
@@ -624,7 +624,7 @@ index 78fe3c7..09f4249 100644
LDSHARED='$(CC) -shared'
LDCXXSHARED='$(CXX) -shared';;
BSD/OS*/4*)
@@ -2108,7 +2111,7 @@ then
@@ -2283,7 +2286,7 @@ then
then CCSHARED="-fPIC";
else CCSHARED="+z";
fi;;
@@ -633,7 +633,7 @@ index 78fe3c7..09f4249 100644
BSD/OS*/4*) CCSHARED="-fpic";;
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
OpenUNIX*|UnixWare*)
@@ -2140,7 +2143,7 @@ then
@@ -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";;
@@ -642,7 +642,7 @@ index 78fe3c7..09f4249 100644
# -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
@@ -2430,14 +2433,16 @@ case "$ac_sys_system" in
esac
# Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl.
@@ -663,7 +663,7 @@ index 78fe3c7..09f4249 100644
esac
AC_MSG_CHECKING(for --with-libs)
@@ -3602,7 +3607,7 @@ fi],
@@ -3776,7 +3781,7 @@ fi],
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
@@ -673,10 +673,10 @@ index 78fe3c7..09f4249 100644
esac
AC_MSG_CHECKING(for --with-libm=STRING)
diff --git a/setup.py b/setup.py
index 6a6ad23..6bc6782 100644
index 54054c2..bc0ae02 100644
--- a/setup.py
+++ b/setup.py
@@ -525,6 +525,12 @@ class PyBuildExt(build_ext):
@@ -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)
@@ -689,7 +689,7 @@ index 6a6ad23..6bc6782 100644
# 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):
@@ -569,7 +575,7 @@ class PyBuildExt(build_ext):
# Check for MacOS X, which doesn't need libm.a at all
math_libs = ['m']
@@ -698,7 +698,7 @@ index 6a6ad23..6bc6782 100644
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
@@ -792,15 +798,22 @@ class PyBuildExt(build_ext):
@@ -812,15 +818,22 @@ class PyBuildExt(build_ext):
'/usr/local/ssl/include',
'/usr/contrib/ssl/include/'
]
@@ -724,7 +724,7 @@ index 6a6ad23..6bc6782 100644
['/usr/local/ssl/lib',
'/usr/contrib/ssl/lib/'
] )
@@ -808,8 +821,8 @@ class PyBuildExt(build_ext):
@@ -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'],
@@ -735,7 +735,7 @@ index 6a6ad23..6bc6782 100644
libraries = ['ssl', 'crypto'],
depends = ['socketmodule.h']), )
else:
@@ -847,8 +860,8 @@ class PyBuildExt(build_ext):
@@ -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'],
@@ -746,7 +746,7 @@ index 6a6ad23..6bc6782 100644
libraries = ['ssl', 'crypto']) )
else:
print ("warning: openssl 0x%08x is too old for _hashlib" %
@@ -1327,7 +1340,7 @@ class PyBuildExt(build_ext):
@@ -1347,7 +1360,7 @@ class PyBuildExt(build_ext):
missing.append('resource')
# Sun yellow pages. Some systems have the functions in libc.
@@ -756,20 +756,20 @@ index 6a6ad23..6bc6782 100644
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']
--
1.8.3.4
2.12.2
From 8348c402f7f409e3024c78381c1d4e1f842ae448 Mon Sep 17 00:00:00 2001
From ae0b0b760c33129d77351dc44fea85e94f7c27dc Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
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
index e288964..bf4f7ef 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -105,7 +105,7 @@ BINDIR= @bindir@
@@ -110,7 +110,7 @@ BINDIR= @bindir@
LIBDIR= @libdir@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
@@ -779,10 +779,10 @@ index b3b2b36..77340fd 100644
# Detailed destination directories
--
1.8.3.4
2.12.2
From 2f77b7b4f848d6b85cffa3f31c5f1c0026b64e64 Mon Sep 17 00:00:00 2001
From ea5570918e1ed3be7b5dbbb16917ec820cb1b1e6 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Wed, 18 Jun 2014 12:19:13 +0000
Subject: Import missed change from the 2.6.9 patches
@@ -793,7 +793,7 @@ expected with
this version of Python.
diff --git a/Lib/site.py b/Lib/site.py
index 4a09f3c..4b6e01e 100644
index 3b51e81..11fb12c 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -287,6 +287,13 @@ def getsitepackages():
@@ -811,10 +811,10 @@ index 4a09f3c..4b6e01e 100644
sitepackages.append(os.path.join(prefix, "lib",
"python" + sys.version[:3],
--
1.8.3.4
2.12.2
From ef5bdbe6e87e4b5ad6b541c65051f8f13e392676 Mon Sep 17 00:00:00 2001
From db2f0d9278c2f2cb638fb63617d3a0ae83e0ba4a Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 21 Sep 2014 18:59:44 +0200
Subject: gcc2 fix.
@@ -834,20 +834,20 @@ index 37f5a9e..37b0b25 100644
#endif
#define LIKELY(x) __builtin_expect(!!(x),1)
--
1.8.3.4
2.12.2
From 529eb791f594d7559a63b6088efea078fa012e7f Mon Sep 17 00:00:00 2001
From 2f9e5705ef41830863d49df8e2d62a2a726261e4 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
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
index adf91d5..f284408 100644
--- a/Lib/tarfile.py
+++ b/Lib/tarfile.py
@@ -2263,7 +2263,7 @@ class TarFile(object):
@@ -2272,7 +2272,7 @@ class TarFile(object):
(platform limitation), we try to make a copy of the referenced file
instead of a link.
"""
@@ -856,7 +856,7 @@ index 082f361..4451189 100644
# For systems that support symbolic and hard links.
if tarinfo.issym():
if os.path.lexists(targetpath):
@@ -2277,7 +2277,7 @@ class TarFile(object):
@@ -2286,7 +2286,7 @@ class TarFile(object):
os.link(tarinfo._link_target, targetpath)
else:
self._extract_member(self._find_link_target(tarinfo), targetpath)
@@ -866,10 +866,10 @@ index 082f361..4451189 100644
self._extract_member(self._find_link_target(tarinfo), targetpath)
except KeyError:
--
1.8.3.4
2.12.2
From 2f5996ce4a51079584b6d7b4d1dfba9e8e8fb018 Mon Sep 17 00:00:00 2001
From 1ebdc711acc90ac7ee763ede88fd14b314bf38c7 Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
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()) {
--
1.8.3.4
2.12.2
From 57c574a0ce25088f026dffbb9abc06f7b7610a98 Mon Sep 17 00:00:00 2001
From da6620a9816d0eafa8414086c1f8462b992b96fe Mon Sep 17 00:00:00 2001
From: Timothy Gu <timothygu99@gmail.com>
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
--
1.8.3.4
2.12.2
From d9e84b7fdfc5a049e471f63ea49763785b574ee7 Mon Sep 17 00:00:00 2001
From f3b8e2d311c7121cadc1e7e336920033d0d15756 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
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
index e73805f..515c61a 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1483,6 +1483,8 @@ _pystat_fromstructstat(STRUCT_STAT *st)
@@ -1004,5 +1004,120 @@ index 4e86d32..ffe0db1 100644
PyStructSequence_SET_ITEM(v, 2, _PyInt_FromDev(st->st_dev));
#endif
--
1.8.3.4
2.12.2
From 5b76bd46239853ebddecf8579469cce8b598f076 Mon Sep 17 00:00:00 2001
From: Philippe Houdoin <philippe.houdoin@gmail.com>
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 <philippe.houdoin@gmail.com>
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

View File

@@ -1,110 +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="http://www.python.org"
LICENSE="Python"
COPYRIGHT="1990-2012, Python Software Foundation"
SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz"
CHECKSUM_SHA256="1cd3730781b91caf0fa1c4d472dc29274186480161a150294c42ce9b5c5effc0"
REVISION="3"
ARCHITECTURES="x86_gcc2 x86 x86_64"
PATCHES="python-$portVersion.patchset"
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_config = $portVersion compat >= 2.7
cmd:python2.7 = $portVersion compat >= 2.7
cmd:python2.7_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:libncurses
lib:libssl
lib:libreadline
lib:libsqlite3
lib:libz
lib:libffi
"
BUILD_REQUIRES="
devel:libbz2
devel:libffi
devel:libncurses
devel:libssl
devel:libreadline
devel:libsqlite3
devel:libz
"
BUILD_PREREQUIRES="
haiku_devel
cmd:aclocal
cmd:autoconf
cmd:find
cmd:gcc
cmd:ld
cmd:libtoolize
cmd:make
cmd:pkg_config
"
SOURCE_DIR="Python-$portVersion"
GLOBAL_WRITABLE_FILES="
non-packaged/lib/python2.7/site-packages directory keep-old
"
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
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
}

View File

@@ -10,14 +10,15 @@ OSI-approved open source license.
"
HOMEPAGE="http://www.python.org"
LICENSE="Python"
COPYRIGHT="1990-2012, Python Software Foundation"
SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz"
CHECKSUM_SHA256="962b4c45af50124ea61f11a30deb4342fc0bc21126790fa1d7f6c79809413f46"
COPYRIGHT="1990-2017, Python Software Foundation"
REVISION="1"
ARCHITECTURES="x86_gcc2 x86 x86_64"
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"
PROVIDES="
python = $portVersion compat >= 2.7
cmd:2to3 = $portVersion compat >= 2.7
@@ -64,8 +65,6 @@ BUILD_PREREQUIRES="
cmd:pkg_config
"
SOURCE_DIR="Python-$portVersion"
GLOBAL_WRITABLE_FILES="
non-packaged/lib/python2.7/site-packages directory keep-old
"
@@ -84,7 +83,8 @@ BUILD()
--enable-unicode=ucs4
# prevent make from rebuilding stuff that requires python
touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h
touch Parser/asdl* Python/Python-ast.c Include/Python-ast.h \
Python/opcode_targets.h
make $jobArgs
}