Ports: Update Python to 3.10.0rc1

Released on 2021-08-02.
https://www.python.org/downloads/release/python-3100rc1/

This contains the first upstreamed change for SerenityOS, making the
webbrowser module work with Browser out of the box :^)
This commit is contained in:
Linus Groh 2021-08-03 19:24:01 +01:00
parent 5a0a426c18
commit 18f507520e
Notes: sideshowbarker 2024-07-18 07:31:06 +09:00
8 changed files with 40 additions and 47 deletions

View file

@ -124,7 +124,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`SDLPoP`](SDLPoP/) | Prince of Persia game | | https://github.com/NagyD/SDLPoP |
| [`printf`](printf/) | printf (OpenBSD) | 6.6 | https://github.com/ibara/libpuffy |
| [`pt2-clone`](pt2-clone/) | ProTracker 2 clone | 1.28 | https://github.com/8bitbubsy/pt2-clone |
| [`python3`](python3/) | Python | 3.9.6 | https://www.python.org/ |
| [`python3`](python3/) | Python | 3.10.0rc1 | https://www.python.org/ |
| [`quake`](quake/) | Quake | 0.65 | https://github.com/SerenityOS/SerenityQuake |
| [`quake2`](quake2/) | QuakeII | 0.1 | https://github.com/SerenityOS/SerenityQuakeII |
| [`r0`](r0/) | r0 (minimalistic commandline hexadecimal editor) | 0.8 | https://github.com/radareorg/r0 |

View file

@ -18,9 +18,3 @@ Make some tweaks to Python's `setup.py` files:
- Add `/usr/local/lib` / `/usr/local/include` to the system lib / include dirs, relative to the sysroot when crosscompiling. These are by default only included when not crosscompiling for some reason.
- Add `/usr/local/include/ncurses` to the curses include paths so it can build the `_curses` module. This is by default included for a bunch of extensions, but not `_curses`.
## `webbrowser.patch`
Register the SerenityOS Browser in the [`webbrowser`](https://docs.python.org/3/library/webbrowser.html) module.
Note: This change [has been added to upstream CPython](https://github.com/python/cpython/pull/25947) and will be included in the Python 3.10 release :^)

View file

@ -1,5 +1,5 @@
--- Python-3.9.6/Modules/posixmodule.h 2021-02-21 20:22:43.839024851 +0100
+++ Python-3.9.6/Modules/posixmodule.h 2021-02-21 20:28:35.823057995 +0100
--- Python-3.10.0rc1/Modules/posixmodule.h 2021-08-03 19:01:36.368000000 +0100
+++ Python-3.10.0rc1/Modules/posixmodule.h 2021-08-03 19:01:54.120205211 +0100
@@ -19,7 +19,8 @@
#endif /* MS_WINDOWS */

View file

@ -1,11 +1,11 @@
--- Python-3.9.6/Include/pyport.h 2021-02-21 20:22:43.946024250 +0100
+++ Python-3.9.6/Include/pyport.h 2021-02-21 20:29:32.457743589 +0100
@@ -838,7 +838,7 @@
--- Python-3.10.0rc1/Include/pyport.h 2021-08-03 18:40:05.313000000 +0100
+++ Python-3.10.0rc1/Include/pyport.h 2021-08-03 18:40:28.722351782 +0100
@@ -843,7 +843,7 @@
# error "Py_TRACE_REFS ABI is not compatible with release and debug ABI"
#endif
-#if defined(__ANDROID__) || defined(__VXWORKS__)
+#if defined(__ANDROID__) || defined(__VXWORKS__) || defined(__serenity__)
/* Ignore the locale encoding: force UTF-8 */
# define _Py_FORCE_UTF8_LOCALE
#endif
// Use UTF-8 as the locale encoding, ignore the LC_CTYPE locale.
// See _Py_GetLocaleEncoding(), PyUnicode_DecodeLocale()
// and PyUnicode_EncodeLocale().

View file

@ -1,5 +1,5 @@
--- Python-3.9.6/config.sub 2021-02-21 20:22:43.901024503 +0100
+++ Python-3.9.6/config.sub 2021-02-21 20:24:35.079400552 +0100
--- Python-3.10.0rc1/config.sub 2021-08-03 19:03:07.361000000 +0100
+++ Python-3.10.0rc1/config.sub 2021-08-03 19:04:06.425786525 +0100
@@ -1485,6 +1485,8 @@
-oss*)
os=-sysv3
@ -9,8 +9,8 @@
-svr4*)
os=-sysv4
;;
--- Python-3.9.6/configure.ac 2021-05-03 15:54:42.000000000 +0100
+++ Python-3.9.6/configure.ac 2021-05-06 16:40:34.503092204 +0100
--- Python-3.10.0rc1/configure.ac 2021-08-03 19:04:59.784000000 +0100
+++ Python-3.10.0rc1/configure.ac 2021-08-03 19:08:42.069896469 +0100
@@ -391,6 +391,9 @@
# a lot of different things including 'define_xopen_source'
# in the case statement below.
@ -39,9 +39,18 @@
*-*-linux*)
case "$host_cpu" in
arm*)
--- Python-3.9.6/configure 2021-07-07 19:12:57.444219201 +0100
+++ Python-3.9.6/configure 2021-07-07 19:14:55.184825202 +0100
@@ -3295,6 +3295,9 @@
@@ -2757,7 +2764,7 @@
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
+ Linux*|GNU*|SerenityOS*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
LINKFORSHARED="$extra_undefs -framework CoreFoundation"
--- Python-3.10.0rc1/configure 2021-08-03 19:06:33.593000000 +0100
+++ Python-3.10.0rc1/configure 2021-08-03 19:08:53.870858123 +0100
@@ -3697,6 +3697,9 @@
# a lot of different things including 'define_xopen_source'
# in the case statement below.
case "$host" in
@ -51,7 +60,7 @@
*-*-linux-android*)
ac_sys_system=Linux-android
;;
@@ -3333,6 +3336,7 @@
@@ -3735,6 +3738,7 @@
linux*) MACHDEP="linux";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
@ -59,8 +68,8 @@
'') MACHDEP="unknown";;
esac
fi
@@ -3342,6 +3346,9 @@
@@ -3744,6 +3748,9 @@
if test "$cross_compiling" = yes; then
case "$host" in
+ *-*-serenity*)
@ -69,11 +78,12 @@
*-*-linux*)
case "$host_cpu" in
arm*)
@@ -9649,6 +9656,7 @@
@@ -10788,7 +10795,7 @@
LINKFORSHARED="-Wl,-E -Wl,+s";;
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
+ SerenityOS*) LINKFORSHARED="-Xlinker -export-dynamic";;
- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;
+ Linux*|GNU*|SerenityOS*) LINKFORSHARED="-Xlinker -export-dynamic";;
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
LINKFORSHARED="$extra_undefs -framework CoreFoundation"

View file

@ -1,6 +1,6 @@
--- Python-3.9.6/setup.py.orig 2021-07-10 00:09:56.322423573 +0100
+++ Python-3.9.6/setup.py 2021-07-10 00:13:39.447453427 +0100
@@ -750,8 +750,8 @@
--- Python-3.10.0rc1/setup.py 2021-08-03 18:59:05.650000000 +0100
+++ Python-3.10.0rc1/setup.py 2021-08-03 19:00:23.210495643 +0100
@@ -832,8 +832,8 @@
add_dir_to_list(self.compiler.include_dirs,
sysconfig.get_config_var("INCLUDEDIR"))
@ -11,7 +11,7 @@
# lib_dirs and inc_dirs are used to search for files;
# if a file is found in one of those directories, it can
# be assumed that no additional -I,-L directives are needed.
@@ -1052,7 +1052,12 @@
@@ -1144,7 +1144,12 @@
# Curses support, requiring the System V version of curses, often
# provided by the ncurses library.
curses_defines = []

View file

@ -1,12 +0,0 @@
--- Python-3.9.6/Lib/webbrowser.py 2021-05-03 15:54:42.000000000 +0100
+++ Python-3.9.6/Lib/webbrowser.py 2021-05-06 14:21:34.242964786 +0100
@@ -574,6 +574,9 @@
if shutil.which("w3m"):
register("w3m", None, GenericBrowser("w3m"))
+ # SerenityOS Browser
+ register("Browser", None, BackgroundBrowser("Browser"))
+
# OK, now that we know what the default preference orders for each
# platform are, allow user to override them with the BROWSER variable.
if "BROWSER" in os.environ:

View file

@ -1,4 +1,5 @@
PYTHON_VERSION="3.9.6"
PYTHON_VERSION="3.10.0rc1"
PYTHON_VERSION_WITHOUT_SUFFIX="3.10.0" # PYTHON_VERSION but without the a1/b1/rc1/... suffix
PYTHON_ARCHIVE="Python-${PYTHON_VERSION}.tar.xz"
PYTHON_ARCHIVE_URL="https://www.python.org/ftp/python/${PYTHON_VERSION}/${PYTHON_ARCHIVE}"
PYTHON_ARCHIVE_SHA256SUM="397920af33efc5b97f2e0b57e91923512ef89fc5b3c1d21dbfc8c4828ce0108a"
PYTHON_ARCHIVE_URL="https://www.python.org/ftp/python/${PYTHON_VERSION_WITHOUT_SUFFIX}/${PYTHON_ARCHIVE}"
PYTHON_ARCHIVE_SHA256SUM="135b56c2703ad8e01a2728b564f13ffe5cea691fc244f40df4d9e1b3841e690c"