python3.7: add sysconfig haiku schemes

This commit is contained in:
Jerome Duval
2023-03-07 18:56:45 +01:00
parent 6a86ae3bdd
commit da07c7b2bf
2 changed files with 90 additions and 30 deletions

View File

@@ -1,4 +1,4 @@
From 5c4b11a81a6defd12a01f2123e4fcb783d28c2fe Mon Sep 17 00:00:00 2001
From 81ff2eec69f0338cc9edd62c1662f15ba380fe41 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 10 Apr 2014 16:03:33 +0000
Subject: initial Haiku patch
@@ -215,7 +215,7 @@ index 1cd9e56..893cf1f 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 35ca1a8..d316694 100644
index ef2bfb1..f73ab1f 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -143,7 +143,7 @@ BINDIR= @bindir@
@@ -419,10 +419,10 @@ index 4363c0c..40994b0 100755
def main():
global filedict
diff --git a/configure.ac b/configure.ac
index f1cc8e9..b0cca04 100644
index edd2051..dc3c9ae 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1151,6 +1151,16 @@ if test $enable_shared = "yes"; then
@@ -1153,6 +1153,16 @@ if test $enable_shared = "yes"; then
PY3LIBRARY=libpython3.so
fi
;;
@@ -439,7 +439,7 @@ index f1cc8e9..b0cca04 100644
hp*|HP*)
case `uname -m` in
ia64)
@@ -1226,6 +1236,7 @@ AC_PROG_MKDIR_P
@@ -1228,6 +1238,7 @@ AC_PROG_MKDIR_P
AC_SUBST(LN)
if test -z "$LN" ; then
case $ac_sys_system in
@@ -447,7 +447,7 @@ index f1cc8e9..b0cca04 100644
CYGWIN*) LN="ln -s";;
*) LN=ln;;
esac
@@ -2614,7 +2625,7 @@ then
@@ -2616,7 +2627,7 @@ then
BLDSHARED="$LDSHARED"
fi
;;
@@ -456,7 +456,7 @@ index f1cc8e9..b0cca04 100644
LDSHARED='$(CC) -shared'
LDCXXSHARED='$(CXX) -shared';;
FreeBSD*)
@@ -2681,7 +2692,7 @@ then
@@ -2683,7 +2694,7 @@ then
else CCSHARED="+z";
fi;;
Linux-android*) ;;
@@ -465,7 +465,7 @@ index f1cc8e9..b0cca04 100644
FreeBSD*|NetBSD*|OpenBSD*|DragonFly*) CCSHARED="-fPIC";;
OpenUNIX*|UnixWare*)
if test "$GCC" = "yes"
@@ -2707,7 +2718,7 @@ then
@@ -2709,7 +2720,7 @@ then
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
@@ -474,7 +474,7 @@ index f1cc8e9..b0cca04 100644
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
LINKFORSHARED="$extra_undefs -framework CoreFoundation"
@@ -2952,6 +2963,12 @@ LDFLAGS="-fsanitize=undefined $LDFLAGS"
@@ -2954,6 +2965,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 f1cc8e9..b0cca04 100644
AC_MSG_CHECKING(for --with-libs)
AC_ARG_WITH(libs,
AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs]),
@@ -4314,6 +4331,7 @@ AC_CHECK_FUNC(__fpu_control,
@@ -4316,6 +4333,7 @@ AC_CHECK_FUNC(__fpu_control,
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
@@ -572,10 +572,10 @@ index bf90600..397acca 100644
libs = []
--
2.28.0
2.37.3
From 3b0375cba65c406f43a1669837c737920b233d73 Mon Sep 17 00:00:00 2001
From a4f568304810ac91cef6201f9849ec43ed84f510 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sun, 16 Apr 2017 10:05:42 +0200
Subject: fix for negative errnos
@@ -610,20 +610,20 @@ index 3cf0683..adf3608 100644
*--cur = Py_hexdigits[saved_errno % 16];
saved_errno /= 16;
--
2.28.0
2.37.3
From a261fb454a9c843fea23936d23eca4e4e95ff694 Mon Sep 17 00:00:00 2001
From 841d1e34987d273a3f08e786449153ccaaab87de Mon Sep 17 00:00:00 2001
From: Philippe Houdoin <philippe.houdoin@gmail.com>
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 97973bc..b2e4095 100644
index 0c2510e..2b4f04c 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -252,6 +252,56 @@ elif os.name == "posix":
@@ -265,6 +265,56 @@ elif os.name == "posix":
def find_library(name, is64 = False):
return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
@@ -680,7 +680,7 @@ index 97973bc..b2e4095 100644
else:
def _findSoname_ldconfig(name):
@@ -349,6 +399,12 @@ def test():
@@ -367,6 +417,12 @@ def test():
print(f"crypt\t:: {cdll.LoadLibrary(find_library('crypt'))}")
print(f"crypto\t:: {find_library('crypto')}")
print(f"crypto\t:: {cdll.LoadLibrary(find_library('crypto'))}")
@@ -694,10 +694,10 @@ index 97973bc..b2e4095 100644
print(cdll.LoadLibrary("libm.so"))
print(cdll.LoadLibrary("libcrypt.so"))
--
2.28.0
2.37.3
From ff662b9d4cb680ec9f960565d6d6ccb446433b5b Mon Sep 17 00:00:00 2001
From edf4baf89b8f25f3b74ed5d52ac0fdf62b32f9cc Mon Sep 17 00:00:00 2001
From: Philipp Wolfer <phil@parolu.io>
Date: Mon, 23 Sep 2019 09:14:58 +0200
Subject: webbrowser: Support for default browsers on Haiku
@@ -720,10 +720,10 @@ index b04ec7b..c59cdee 100755
# Prefer X browsers if present
if os.environ.get("DISPLAY") or os.environ.get("WAYLAND_DISPLAY"):
--
2.28.0
2.37.3
From 79a8f791905b604c31b52a8e005dacec09529228 Mon Sep 17 00:00:00 2001
From 0ecdde0fd8915fad5a55b3765bc54a8ddc92ab43 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sat, 30 Nov 2019 23:26:57 +0100
Subject: don't reinit locks on fork.
@@ -743,10 +743,10 @@ index b596f80..431f750 100644
pass # no-op when os.register_at_fork does not exist.
else:
--
2.28.0
2.37.3
From 8c7414695d2ff888f56b3027425476acdf0ec68f Mon Sep 17 00:00:00 2001
From 48c2782e9f65a281472a3b2722a26c6059301dd0 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 15 May 2020 15:20:57 +0200
Subject: handle errors returned by internal_connect()
@@ -776,20 +776,20 @@ index 3173b3b..88b66ed 100644
return PyLong_FromLong((long) res);
--
2.28.0
2.37.3
From 719b6b5d78c02d7eb025ec52d1e71d08c596cce5 Mon Sep 17 00:00:00 2001
From f2e4edc4fa209f8d2cdebf97056379ee62b727d8 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Mon, 23 May 2022 14:53:35 +0200
Subject: Fix search paths for tcl/tk
diff --git a/configure.ac b/configure.ac
index b0cca04..6b708fb 100644
index dc3c9ae..e331924 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3077,8 +3077,13 @@ then
@@ -3079,8 +3079,13 @@ then
then
AC_MSG_ERROR([use both --with-tcltk-includes='...' and --with-tcltk-libs='...' or neither])
fi
@@ -806,5 +806,65 @@ index b0cca04..6b708fb 100644
TCLTK_INCLUDES="$with_tcltk_includes"
TCLTK_LIBS="$with_tcltk_libs"
--
2.36.1
2.37.3
From a73ff1680867da8938b1edf5b1e8b6120fc6a3c7 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 7 Mar 2023 17:59:04 +0100
Subject: sysconfig: add haiku schemes
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index d15cec8..8a12ac0 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -79,7 +79,33 @@ _INSTALL_SCHEMES = {
'scripts': '{userbase}/bin',
'data': '{userbase}',
},
- }
+ 'haiku': {
+ 'stdlib': '{installed_base}/lib/python{py_version_short}',
+ 'platstdlib': '{platbase}/lib/python{py_version_short}',
+ 'purelib': '{base}/non-packaged/lib/python{py_version_short}/site-packages',
+ 'platlib': '{platbase}/non-packaged/lib/python{py_version_short}/site-packages',
+ 'include': '{base}/non-packaged/develop/headers/python{py_version_short}',
+ 'scripts': '{base}/non-packaged/bin',
+ 'data' : '{base}/non-packaged',
+ },
+ 'haiku_vendor': {
+ 'stdlib': '{installed_base}/lib/python{py_version_short}',
+ 'platstdlib': '{platbase}/lib/python{py_version_short}',
+ 'purelib': '{base}/lib/python{py_version_short}/vendor-packages',
+ 'platlib': '{platbase}/lib/python{py_version_short}/vendor-packages',
+ 'include': '{base}/develop/headers/python{py_version_short}',
+ 'scripts': '{base}/bin',
+ 'data' : '{base}',
+ },
+ 'haiku_home': {
+ 'stdlib': '{userbase}/lib/python{py_version_short}',
+ 'platstdlib': '{platbase}/lib/python{py_version_short}',
+ 'purelib': '{userbase}/lib/python',
+ 'platlib': '{userbase}/lib/python',
+ 'include': '{userbase}/develop/headers/python/$dist_name',
+ 'scripts': '{userbase}/bin',
+ 'data' : '{userbase}',
+ }, }
_SCHEME_KEYS = ('stdlib', 'platstdlib', 'purelib', 'platlib', 'include',
'scripts', 'data')
@@ -179,6 +205,10 @@ def _expand_vars(scheme, vars):
def _get_default_scheme():
+ if sys.platform.startswith('haiku'):
+ if os.environ.get('HAIKU_USE_VENDOR_DIRECTORIES') == '1':
+ return 'haiku_vendor'
+ return 'haiku'
if os.name == 'posix':
# the default scheme for posix is posix_prefix
return 'posix_prefix'
--
2.37.3