python3.9: update to 3.9.16, sync both _getuserbase() copies. (#7945)

This addresses the "small caveat" issue mentioned on #7531 that
affects all python versions, by making sure that both site.py's
and sysconfig.py's copies of _getuserbase() have the same code.
This commit is contained in:
OscarL
2023-03-11 07:31:05 -03:00
committed by GitHub
parent ba0e97c0ba
commit 0f2e26b159
3 changed files with 70 additions and 41 deletions

View File

@@ -1,4 +1,4 @@
From d3e0c005eefca8718fc56879b4c99ac3248de64a Mon Sep 17 00:00:00 2001
From 0ad4d86cd6bad85d09487b9f9def1e5ae8cd24af 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
@@ -229,7 +229,7 @@ index 2671d6a..d80a5c4 100644
# Somehow /dev/tty appears seekable on some BSDs
self.assertEqual(f.seekable(), False)
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 42b1ec6..031a856 100644
index c0272bf..a13bd6b 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -141,7 +141,7 @@ BINDIR= @bindir@
@@ -341,10 +341,10 @@ index ddbf80b..6b50f0b 100644
#endif
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index a22060d..a52f57a 100644
index 133470f..b29283e 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -7506,7 +7506,9 @@ PyInit__socket(void)
@@ -7513,7 +7513,9 @@ PyInit__socket(void)
/* SOCK_RAW is marked as optional in the POSIX specification */
PyModule_AddIntMacro(m, SOCK_RAW);
#endif
@@ -395,7 +395,7 @@ index 1601ec0..4c98fe8 100644
else
PyErr_SetString(PyExc_KeyError, "getspnam(): name not found");
diff --git a/configure.ac b/configure.ac
index 431d661..90c19a2 100644
index aa515da..2c7f344 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1172,6 +1172,16 @@ if test $enable_shared = "yes"; then
@@ -463,7 +463,7 @@ index 431d661..90c19a2 100644
AC_MSG_CHECKING(for --with-libs)
AC_ARG_WITH(libs,
AS_HELP_STRING([--with-libs='lib1 ...'], [link against additional libs (default is no)]),
@@ -4459,6 +4476,7 @@ AC_CHECK_FUNC(__fpu_control,
@@ -4458,6 +4475,7 @@ AC_CHECK_FUNC(__fpu_control,
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
@@ -472,7 +472,7 @@ index 431d661..90c19a2 100644
esac
AC_MSG_CHECKING(for --with-libm=STRING)
diff --git a/setup.py b/setup.py
index c6023e1..42492e2 100644
index 0bec170..3b862fa 100644
--- a/setup.py
+++ b/setup.py
@@ -65,6 +65,7 @@ CYGWIN = (HOST_PLATFORM == 'cygwin')
@@ -483,7 +483,7 @@ index c6023e1..42492e2 100644
CC = os.environ.get("CC")
if not CC:
CC = sysconfig.get_config_var("CC")
@@ -778,6 +779,11 @@ class PyBuildExt(build_ext):
@@ -780,6 +781,11 @@ class PyBuildExt(build_ext):
with open(config_h) as file:
self.config_h_vars = sysconfig.parse_config_h(file)
@@ -495,7 +495,7 @@ index c6023e1..42492e2 100644
# OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
if HOST_PLATFORM in ['osf1', 'unixware7', 'openunix8']:
self.lib_dirs += ['/usr/ccs/lib']
@@ -823,14 +829,14 @@ class PyBuildExt(build_ext):
@@ -825,14 +831,14 @@ class PyBuildExt(build_ext):
extra_compile_args=['-DPy_BUILD_CORE_MODULE'],
extra_objects=[shared_math],
depends=['_math.h', shared_math],
@@ -512,7 +512,7 @@ index c6023e1..42492e2 100644
# time libraries: librt may be needed for clock_gettime()
time_libs = []
@@ -844,7 +850,7 @@ class PyBuildExt(build_ext):
@@ -846,7 +852,7 @@ class PyBuildExt(build_ext):
# libm is needed by delta_new() that uses round() and by accum() that
# uses modf().
self.add(Extension('_datetime', ['_datetimemodule.c'],
@@ -521,7 +521,7 @@ index c6023e1..42492e2 100644
# zoneinfo module
self.add(Extension('_zoneinfo', ['_zoneinfo.c'])),
# random number generator implemented in C
@@ -936,7 +942,7 @@ class PyBuildExt(build_ext):
@@ -938,7 +944,7 @@ class PyBuildExt(build_ext):
#
# audioop needs libm for floor() in multiple functions.
self.add(Extension('audioop', ['audioop.c'],
@@ -530,7 +530,7 @@ index c6023e1..42492e2 100644
# CSV files
self.add(Extension('_csv', ['_csv.c']))
@@ -2146,7 +2152,7 @@ class PyBuildExt(build_ext):
@@ -2148,7 +2154,7 @@ class PyBuildExt(build_ext):
# function my_sqrt() needs libm for sqrt()
self.add(Extension('_ctypes_test',
sources=['_ctypes/_ctypes_test.c'],
@@ -539,7 +539,7 @@ index c6023e1..42492e2 100644
ffi_inc = sysconfig.get_config_var("LIBFFI_INCLUDEDIR")
ffi_lib = None
@@ -2211,7 +2217,7 @@ class PyBuildExt(build_ext):
@@ -2213,7 +2219,7 @@ class PyBuildExt(build_ext):
'Modules',
'_decimal',
'libmpdec'))]
@@ -548,7 +548,7 @@ index c6023e1..42492e2 100644
sources = [
'_decimal/_decimal.c',
'_decimal/libmpdec/basearith.c',
@@ -2444,7 +2450,7 @@ class PyBuildExt(build_ext):
@@ -2446,7 +2452,7 @@ class PyBuildExt(build_ext):
))
def detect_nis(self):
@@ -558,10 +558,10 @@ index c6023e1..42492e2 100644
return
--
2.30.2
2.37.3
From 4b7865fa9effb59132db0ed935c7ab682d7cac78 Mon Sep 17 00:00:00 2001
From f343605ee8c189698d5ec51d32006a7794f169e3 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
@@ -596,10 +596,10 @@ index d64e0a1..0885a30 100644
*--cur = Py_hexdigits[saved_errno % 16];
saved_errno /= 16;
--
2.30.2
2.37.3
From 5b5e240d597aa98f5ee600e9e7135055fe366b0e Mon Sep 17 00:00:00 2001
From a6265bb8ca1131a02965f6967ff01863baadaf19 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
@@ -680,10 +680,10 @@ index 0c2510e..2b4f04c 100644
print(cdll.LoadLibrary("libm.so"))
print(cdll.LoadLibrary("libcrypt.so"))
--
2.30.2
2.37.3
From 49f12b17d390b7814a2807eb0cec7cae05e36a1c Mon Sep 17 00:00:00 2001
From f0216e9fc2bbc0715c342362d8235d6fd697d210 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
@@ -706,10 +706,10 @@ index 6023c1e..8359531 100755
# Prefer X browsers if present
if os.environ.get("DISPLAY") or os.environ.get("WAYLAND_DISPLAY"):
--
2.30.2
2.37.3
From 0f9d57db38f6eca3fed2c25c15301f70049d1302 Mon Sep 17 00:00:00 2001
From d23b79b7f98ea25ff7271a2b39d9b79248266636 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 4 Oct 2019 22:02:35 +0200
Subject: since 3.8, don't reinit locks on fork.
@@ -729,10 +729,10 @@ index 1ab35a8..c6b54e4 100644
pass # no-op when os.register_at_fork does not exist.
else:
--
2.30.2
2.37.3
From e5ca96567985548860a9a56855602a5c6460a444 Mon Sep 17 00:00:00 2001
From 96d894b820111705c3dbbca1e7d7a673f6fc9d26 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()
@@ -740,10 +740,10 @@ Subject: handle errors returned by internal_connect()
upstream bug #40628 by Ryan C. Gordon
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index a52f57a..e9b380a 100644
index b29283e..7af682d 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -3322,7 +3322,7 @@ sock_connect(PySocketSockObject *s, PyObject *addro)
@@ -3329,7 +3329,7 @@ sock_connect(PySocketSockObject *s, PyObject *addro)
}
res = internal_connect(s, SAS2SA(&addrbuf), addrlen, 1);
@@ -752,7 +752,7 @@ index a52f57a..e9b380a 100644
return NULL;
Py_RETURN_NONE;
@@ -3353,7 +3353,7 @@ sock_connect_ex(PySocketSockObject *s, PyObject *addro)
@@ -3360,7 +3360,7 @@ sock_connect_ex(PySocketSockObject *s, PyObject *addro)
}
res = internal_connect(s, SAS2SA(&addrbuf), addrlen, 0);
@@ -762,20 +762,20 @@ index a52f57a..e9b380a 100644
return PyLong_FromLong((long) res);
--
2.30.2
2.37.3
From afc7faef9e2feb811e23fa02d1242ceb8092aea8 Mon Sep 17 00:00:00 2001
From 9bd5156b56b7abd7d85382482e0cdb2b514f5bb6 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Mon, 19 Oct 2020 18:03:09 +0200
Subject: ttyname_r can use MAXPATHLEN
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 29d6126..aa1ad57 100644
index bf4e648..c8850d6 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -3025,11 +3025,14 @@ static PyObject *
@@ -3039,11 +3039,14 @@ static PyObject *
os_ttyname_impl(PyObject *module, int fd)
/*[clinic end generated code: output=c424d2e9d1cd636a input=9ff5a58b08115c55]*/
{
@@ -792,17 +792,17 @@ index 29d6126..aa1ad57 100644
if (buffer == NULL) {
return PyErr_NoMemory();
--
2.30.2
2.37.3
From c1e2fc1180e777bd61cd01d763e3cf425ef62578 Mon Sep 17 00:00:00 2001
From f5ab2ba2fbdf4f3b56a868452ef3733b888c6b76 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Mon, 23 May 2022 08:45:31 +0200
Subject: Fix search paths for tcl/tk
diff --git a/configure.ac b/configure.ac
index 90c19a2..ad979e6 100644
index 2c7f344..8905063 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3202,8 +3202,13 @@ then
@@ -822,11 +822,10 @@ index 90c19a2..ad979e6 100644
TCLTK_INCLUDES="$with_tcltk_includes"
TCLTK_LIBS="$with_tcltk_libs"
--
2.36.1
2.37.3
From 5818eceb6c228b6f718cbe140656a3570e6b3594 Mon Sep 17 00:00:00 2001
From cd0484017d94caa28766a48b1b3aa5db37459574 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Mon, 6 Mar 2023 22:51:40 +0100
Subject: sysconfig: add haiku schemes
@@ -883,3 +882,33 @@ index e3f79bf..574220b 100644
return 'posix_prefix'
--
2.37.3
From 73fdb04878aabd4a118bb66ef6f9a8046a53195d Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Fri, 10 Mar 2023 19:24:51 -0300
Subject: syncronize both _getuserbase() copies on site.py and sysconfig.py.
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index 574220b..79c3ae5 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -237,6 +237,14 @@ def _getuserbase():
return joinuser("~", "Library", sys._framework,
"%d.%d" % sys.version_info[:2])
+ if sys.platform.startswith('haiku'):
+ try:
+ import subprocess
+ return subprocess.run(['finddir', 'B_USER_NONPACKAGED_DIRECTORY'],
+ stdout=subprocess.PIPE, check=True).stdout.rstrip().decode('utf-8')
+ except:
+ pass
+
return joinuser("~", ".local")
--
2.37.3

View File

@@ -9,14 +9,14 @@ OSI-approved open source license."
HOMEPAGE="https://www.python.org"
LICENSE="Python"
COPYRIGHT="1990-2022 Python Software Foundation"
REVISION="2"
REVISION="1"
SOURCE_URI="https://www.python.org/ftp/python/$portVersion/Python-$portVersion.tar.xz"
CHECKSUM_SHA256="651304d216c8203fe0adf1a80af472d8e92c3b0e0a7892222ae4d9f3ae4debcf"
CHECKSUM_SHA256="22dddc099246dd2760665561e8adb7394ea0cc43a72684c6480f9380f7786439"
SOURCE_DIR="Python-$portVersion"
PATCHES="python39-$portVersion.patchset"
PATCHES="python3.9-$portVersion.patchset"
if [ "$secondaryArchSuffix" = _x86 ] ; then
PATCHES+="
python39_x86-$portVersion.patchset
python3.9_x86-$portVersion.patchset
"
fi