diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index 9d48f4f855..e390d1ae47 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -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 | diff --git a/Ports/python3/patches/ReadMe.md b/Ports/python3/patches/ReadMe.md index e17834ec0d..1574c2c439 100644 --- a/Ports/python3/patches/ReadMe.md +++ b/Ports/python3/patches/ReadMe.md @@ -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 :^) diff --git a/Ports/python3/patches/define-have-sigset-t.patch b/Ports/python3/patches/define-have-sigset-t.patch index d1b9b2dd8d..f4025d8604 100644 --- a/Ports/python3/patches/define-have-sigset-t.patch +++ b/Ports/python3/patches/define-have-sigset-t.patch @@ -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 */ diff --git a/Ports/python3/patches/define-py-force-utf8-locale.patch b/Ports/python3/patches/define-py-force-utf8-locale.patch index fc356d4149..ae6f944ac2 100644 --- a/Ports/python3/patches/define-py-force-utf8-locale.patch +++ b/Ports/python3/patches/define-py-force-utf8-locale.patch @@ -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(). diff --git a/Ports/python3/patches/fix-autoconf.patch b/Ports/python3/patches/fix-autoconf.patch index 28d6cd7d47..cf087a8198 100644 --- a/Ports/python3/patches/fix-autoconf.patch +++ b/Ports/python3/patches/fix-autoconf.patch @@ -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" diff --git a/Ports/python3/patches/tweak-setup-py.patch b/Ports/python3/patches/tweak-setup-py.patch index 546dbb91eb..e44b3634d1 100644 --- a/Ports/python3/patches/tweak-setup-py.patch +++ b/Ports/python3/patches/tweak-setup-py.patch @@ -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 = [] diff --git a/Ports/python3/patches/webbrowser.patch b/Ports/python3/patches/webbrowser.patch deleted file mode 100644 index 7714287f81..0000000000 --- a/Ports/python3/patches/webbrowser.patch +++ /dev/null @@ -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: diff --git a/Ports/python3/version.sh b/Ports/python3/version.sh index 72714d6330..4a052ff3eb 100644 --- a/Ports/python3/version.sh +++ b/Ports/python3/version.sh @@ -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"