Skip to content

Commit edf3aee

Browse files
committed
Ports/python3: Update Python to 3.11.0
This now requires `--host` and `--with-build-python` to be passed to the configure script when cross compiling; the former we simply do like in many other package.sh scripts as well, the latter we point to `python3`, which is expected to match the port's version anyway.
1 parent 35ec636 commit edf3aee

9 files changed

+28
-28
lines changed

Diff for: Ports/AvailablePorts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ This list is also available at [ports.serenityos.net](https://ports.serenityos.n
205205
| [`printf`](printf/) | printf (OpenBSD) | 6.6 | https://github.com/ibara/libpuffy |
206206
| [`pt2-clone`](pt2-clone/) | ProTracker 2 clone | 1.49 | https://github.com/8bitbubsy/pt2-clone |
207207
| [`pv`](pv/) | Pipe Viewer | 1.6.20 | http://www.ivarch.com/programs/pv.shtml |
208-
| [`python3`](python3/) | Python | 3.10.4 | https://www.python.org/ |
208+
| [`python3`](python3/) | Python | 3.11.0 | https://www.python.org/ |
209209
| [`qemu`](qemu/) | QEMU | 7.0.0 | https://qemu.org |
210210
| [`qoi`](qoi/) | Quite OK Image Format for fast, lossless image compression | edb8d7b | https://github.com/phoboslab/qoi |
211211
| [`qt6-qtbase`](qt6-qtbase/) | Qt6 QtBase | 6.2.3 | https://qt.io |

Diff for: Ports/python3/package.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ depends=(
3131
configopts=(
3232
'--disable-ipv6'
3333
'--without-ensurepip'
34+
'--with-build-python=python3'
3435
'ac_cv_file__dev_ptmx=no'
3536
'ac_cv_file__dev_ptc=no'
3637
)
3738

3839
export BLDSHARED="${CC} -shared"
3940

40-
pre_configure() {
41-
build="$("${workdir}/config.guess")" # e.g. 'x86_64-pc-linux-gnu'
42-
configopts+=("--build=${build}")
41+
configure() {
42+
run ./configure --host="${SERENITY_ARCH}-pc-serenity" --build="$($workdir/config.guess)" "${configopts[@]}"
4343
}
4444

4545
# Note: The showproperty command is used when linting ports, we don't actually need python at this time.

Diff for: Ports/python3/patches/0001-Enforce-UTF-8-as-the-locale-encoding.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ we can enforce UTF-8 as the encoding.
1010
1 file changed, 1 insertion(+), 1 deletion(-)
1111

1212
diff --git a/Include/pyport.h b/Include/pyport.h
13-
index 6ab0ae4..dffd616 100644
13+
index 93250f4eb1d7a23ec05a312f97cae4236b64dc7c..33d1ca5f1d21751ca90670eabdc848ad68a12ef1 100644
1414
--- a/Include/pyport.h
1515
+++ b/Include/pyport.h
16-
@@ -843,7 +843,7 @@ extern _invalid_parameter_handler _Py_silent_invalid_parameter_handler;
16+
@@ -678,7 +678,7 @@ extern char * _getpty(int *, int, mode_t, int);
1717
# error "Py_TRACE_REFS ABI is not compatible with release and debug ABI"
1818
#endif
1919

Diff for: Ports/python3/patches/0002-Tweak-configure-and-configure.ac.patch

+10-10
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ As usual, make the `configure` script recognize Serenity. Also set
1212
2 files changed, 16 insertions(+), 2 deletions(-)
1313

1414
diff --git a/configure b/configure
15-
index 19f1bd5..340e76e 100755
15+
index 784f8d306092afb980dc7730eccaac1b134c52df..143ff27f07a8605510bca258bee3e621c95d34b8 100755
1616
--- a/configure
1717
+++ b/configure
18-
@@ -3335,6 +3335,9 @@ then
18+
@@ -3811,6 +3811,9 @@ then
1919
# a lot of different things including 'define_xopen_source'
2020
# in the case statement below.
2121
case "$host" in
@@ -25,15 +25,15 @@ index 19f1bd5..340e76e 100755
2525
*-*-linux-android*)
2626
ac_sys_system=Linux-android
2727
;;
28-
@@ -3373,6 +3376,7 @@ then
28+
@@ -3855,6 +3858,7 @@ then
2929
linux*) MACHDEP="linux";;
3030
cygwin*) MACHDEP="cygwin";;
3131
darwin*) MACHDEP="darwin";;
3232
+ serenityos*) MACHDEP="serenityos";;
3333
'') MACHDEP="unknown";;
3434
esac
3535
fi
36-
@@ -3382,6 +3386,9 @@ $as_echo "\"$MACHDEP\"" >&6; }
36+
@@ -3864,6 +3868,9 @@ $as_echo "\"$MACHDEP\"" >&6; }
3737

3838
if test "$cross_compiling" = yes; then
3939
case "$host" in
@@ -43,7 +43,7 @@ index 19f1bd5..340e76e 100755
4343
*-*-linux*)
4444
case "$host_cpu" in
4545
arm*)
46-
@@ -9886,7 +9893,7 @@ then
46+
@@ -10834,7 +10841,7 @@ then
4747
LINKFORSHARED="-Wl,-E -Wl,+s";;
4848
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
4949
Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
@@ -53,10 +53,10 @@ index 19f1bd5..340e76e 100755
5353
Darwin/*)
5454
LINKFORSHARED="$extra_undefs -framework CoreFoundation"
5555
diff --git a/configure.ac b/configure.ac
56-
index 763fc69..8d4c0af 100644
56+
index ab5e1de6fabd38ad468ad57392b232de2101011d..17f93fdf69007f322c29b4fbdb4fe16e75ca2520 100644
5757
--- a/configure.ac
5858
+++ b/configure.ac
59-
@@ -391,6 +391,9 @@ then
59+
@@ -536,6 +536,9 @@ then
6060
# a lot of different things including 'define_xopen_source'
6161
# in the case statement below.
6262
case "$host" in
@@ -66,15 +66,15 @@ index 763fc69..8d4c0af 100644
6666
*-*-linux-android*)
6767
ac_sys_system=Linux-android
6868
;;
69-
@@ -429,6 +432,7 @@ then
69+
@@ -580,6 +583,7 @@ then
7070
linux*) MACHDEP="linux";;
7171
cygwin*) MACHDEP="cygwin";;
7272
darwin*) MACHDEP="darwin";;
7373
+ serenityos*) MACHDEP="serenityos";;
7474
'') MACHDEP="unknown";;
7575
esac
7676
fi
77-
@@ -437,6 +441,9 @@ AC_MSG_RESULT("$MACHDEP")
77+
@@ -588,6 +592,9 @@ AC_MSG_RESULT("$MACHDEP")
7878
AC_SUBST(_PYTHON_HOST_PLATFORM)
7979
if test "$cross_compiling" = yes; then
8080
case "$host" in
@@ -84,7 +84,7 @@ index 763fc69..8d4c0af 100644
8484
*-*-linux*)
8585
case "$host_cpu" in
8686
arm*)
87-
@@ -2807,7 +2814,7 @@ then
87+
@@ -3247,7 +3254,7 @@ then
8888
LINKFORSHARED="-Wl,-E -Wl,+s";;
8989
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
9090
Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;

Diff for: Ports/python3/patches/0003-Include-sys-uio.h-in-socketmodule.c.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ the `socket` module.
1010
1 file changed, 1 insertion(+), 1 deletion(-)
1111

1212
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
13-
index ab8618b..0109d97 100644
13+
index 14af496a45f4788dc55ec3d959c2de45147725bc..9dcad434af405f0a6f6233f36ef1e1062086050e 100644
1414
--- a/Modules/socketmodule.c
1515
+++ b/Modules/socketmodule.c
16-
@@ -168,7 +168,7 @@ shutdown(how) -- shut down traffic in one or both directions\n\
16+
@@ -175,7 +175,7 @@ shutdown(how) -- shut down traffic in one or both directions\n\
1717
# undef HAVE_GETHOSTBYNAME_R_6_ARG
1818
#endif
1919

Diff for: Ports/python3/patches/0004-Tweak-setup.py.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ Make some tweaks to Python's `setup.py`:
1717
1 file changed, 8 insertions(+), 3 deletions(-)
1818

1919
diff --git a/setup.py b/setup.py
20-
index e74a275..acd7b05 100644
20+
index 15d0d4576a4772e9920ac2d7c1a9dee75c29b341..e651ac7627e8b796f8b9b4d60f592bc9261b6540 100644
2121
--- a/setup.py
2222
+++ b/setup.py
23-
@@ -848,8 +848,8 @@ class PyBuildExt(build_ext):
23+
@@ -868,8 +868,8 @@ class PyBuildExt(build_ext):
2424
add_dir_to_list(self.compiler.include_dirs,
2525
sysconfig.get_config_var("INCLUDEDIR"))
2626

@@ -31,7 +31,7 @@ index e74a275..acd7b05 100644
3131
# lib_dirs and inc_dirs are used to search for files;
3232
# if a file is found in one of those directories, it can
3333
# be assumed that no additional -I,-L directives are needed.
34-
@@ -1160,7 +1160,12 @@ class PyBuildExt(build_ext):
34+
@@ -1117,7 +1117,12 @@ class PyBuildExt(build_ext):
3535
# Curses support, requiring the System V version of curses, often
3636
# provided by the ncurses library.
3737
curses_defines = []

Diff for: Ports/python3/patches/0005-Tweak-setup.py-sysroot-detection.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ in the detection code.
1515
1 file changed, 2 insertions(+)
1616

1717
diff --git a/setup.py b/setup.py
18-
index acd7b05..6554b1c 100644
18+
index e651ac7627e8b796f8b9b4d60f592bc9261b6540..c4c4e92309a952a88d9de1b853a9535cb86913cc 100644
1919
--- a/setup.py
2020
+++ b/setup.py
21-
@@ -163,6 +163,8 @@ def sysroot_paths(make_vars, subdirs):
21+
@@ -166,6 +166,8 @@ def sysroot_paths(make_vars, subdirs):
2222
for var_name in make_vars:
2323
var = sysconfig.get_config_var(var_name)
2424
if var is not None:

Diff for: Ports/python3/patches/0006-Workaround-for-unsupported-socket-option.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ For now, it can be safely ignored until it's supported in the kernel.
1212
1 file changed, 2 insertions(+)
1313

1414
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
15-
index 0109d97..484e651 100644
15+
index 9dcad434af405f0a6f6233f36ef1e1062086050e..a53a510b0c779dfbba7428229b34e8a23c69ee9e 100644
1616
--- a/Modules/socketmodule.c
1717
+++ b/Modules/socketmodule.c
18-
@@ -3003,6 +3003,8 @@ sock_setsockopt(PySocketSockObject *s, PyObject *args)
18+
@@ -3043,6 +3043,8 @@ sock_setsockopt(PySocketSockObject *s, PyObject *args)
1919
PyBuffer_Release(&optval);
2020

2121
done:

Diff for: Ports/python3/version.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
PYTHON_VERSION="3.10.4"
2-
PYTHON_VERSION_WITHOUT_SUFFIX="3.10.4" # PYTHON_VERSION but without the a1/b1/rc1/... suffix
1+
PYTHON_VERSION="3.11.0"
2+
PYTHON_VERSION_WITHOUT_SUFFIX="3.11.0" # PYTHON_VERSION but without the a1/b1/rc1/... suffix
33
PYTHON_ARCHIVE="Python-${PYTHON_VERSION}.tar.xz"
44
PYTHON_ARCHIVE_URL="https://www.python.org/ftp/python/${PYTHON_VERSION_WITHOUT_SUFFIX}/${PYTHON_ARCHIVE}"
5-
PYTHON_ARCHIVE_SHA256SUM="80bf925f571da436b35210886cf79f6eb5fa5d6c571316b73568343451f77a19"
5+
PYTHON_ARCHIVE_SHA256SUM="a57dc82d77358617ba65b9841cee1e3b441f386c3789ddc0676eca077f2951c3"

0 commit comments

Comments
 (0)