diff --git a/Ports/python3/patches/0002-Tweak-configure-and-configure.ac.patch b/Ports/python3/patches/0002-Tweak-configure-and-configure.ac.patch deleted file mode 100644 index 94fe04f109..0000000000 --- a/Ports/python3/patches/0002-Tweak-configure-and-configure.ac.patch +++ /dev/null @@ -1,95 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Linus Groh -Date: Fri, 14 Jan 2022 23:35:57 +0330 -Subject: [PATCH] Tweak configure and configure.ac - -As usual, make the `configure` script recognize Serenity. Also set -`MACHDEP` (which is used for `sys.platform`) to a version-less -`serenityos`, even when not cross-compiling. ---- - configure | 9 ++++++++- - configure.ac | 9 ++++++++- - 2 files changed, 16 insertions(+), 2 deletions(-) - -diff --git a/configure b/configure -index af4a5bbfdfa1a4cc8069f67f4e4fe20a35fd27ee..c358ca4e8ba46155550c4ce8a25c8486dc45e2aa 100755 ---- a/configure -+++ b/configure -@@ -3814,6 +3814,9 @@ then - # a lot of different things including 'define_xopen_source' - # in the case statement below. - case "$host" in -+ *-*-serenity*) -+ ac_sys_system=SerenityOS -+ ;; - *-*-linux-android*) - ac_sys_system=Linux-android - ;; -@@ -3858,6 +3861,7 @@ then - linux*) MACHDEP="linux";; - cygwin*) MACHDEP="cygwin";; - darwin*) MACHDEP="darwin";; -+ serenityos*) MACHDEP="serenityos";; - '') MACHDEP="unknown";; - esac - fi -@@ -3867,6 +3871,9 @@ $as_echo "\"$MACHDEP\"" >&6; } - - if test "$cross_compiling" = yes; then - case "$host" in -+ *-*-serenity*) -+ _host_cpu=$host_cpu -+ ;; - *-*-linux*) - case "$host_cpu" in - arm*) -@@ -11065,7 +11072,7 @@ then - 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" -diff --git a/configure.ac b/configure.ac -index e1cbb7c7fbe9d94d72ac9ce001f284ba5d0a7dcd..818044ad846dd47cd7d425e8870dc446971cb77a 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -536,6 +536,9 @@ then - # a lot of different things including 'define_xopen_source' - # in the case statement below. - case "$host" in -+ *-*-serenity*) -+ ac_sys_system=SerenityOS -+ ;; - *-*-linux-android*) - ac_sys_system=Linux-android - ;; -@@ -580,6 +583,7 @@ then - linux*) MACHDEP="linux";; - cygwin*) MACHDEP="cygwin";; - darwin*) MACHDEP="darwin";; -+ serenityos*) MACHDEP="serenityos";; - '') MACHDEP="unknown";; - esac - fi -@@ -588,6 +592,9 @@ AC_MSG_RESULT("$MACHDEP") - AC_SUBST(_PYTHON_HOST_PLATFORM) - if test "$cross_compiling" = yes; then - case "$host" in -+ *-*-serenity*) -+ _host_cpu=$host_cpu -+ ;; - *-*-linux*) - case "$host_cpu" in - arm*) -@@ -3289,7 +3296,7 @@ then - 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" diff --git a/Ports/python3/patches/0002-Tweak-configure.patch b/Ports/python3/patches/0002-Tweak-configure.patch new file mode 100644 index 0000000000..7fe71d1f94 --- /dev/null +++ b/Ports/python3/patches/0002-Tweak-configure.patch @@ -0,0 +1,77 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Linus Groh +Date: Fri, 14 Jan 2022 23:35:57 +0330 +Subject: [PATCH] Tweak configure +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +As usual, make the `configure` script recognize Serenity. Also set +`MACHDEP` (which is used for `sys.platform`) to a version-less +`serenityos`, even when not cross-compiling. + +Co-Authored-By: Julian Offenhäuser +Co-Authored-By: Oskar Skog +--- + configure | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/configure b/configure +index af4a5bbfdfa1a4cc8069f67f4e4fe20a35fd27ee..8a043f76112625ffe425c3a69420191abe382f54 100755 +--- a/configure ++++ b/configure +@@ -3814,6 +3814,9 @@ then + # a lot of different things including 'define_xopen_source' + # in the case statement below. + case "$host" in ++ *-*-serenity*) ++ ac_sys_system=SerenityOS ++ ;; + *-*-linux-android*) + ac_sys_system=Linux-android + ;; +@@ -3858,6 +3861,7 @@ then + linux*) MACHDEP="linux";; + cygwin*) MACHDEP="cygwin";; + darwin*) MACHDEP="darwin";; ++ serenityos*) MACHDEP="serenityos";; + '') MACHDEP="unknown";; + esac + fi +@@ -3867,6 +3871,9 @@ $as_echo "\"$MACHDEP\"" >&6; } + + if test "$cross_compiling" = yes; then + case "$host" in ++ *-*-serenity*) ++ _host_cpu=$host_cpu ++ ;; + *-*-linux*) + case "$host_cpu" in + arm*) +@@ -6743,7 +6750,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h + PY3LIBRARY=libpython3.so + fi + ;; +- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|VxWorks*) ++ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|VxWorks*|SerenityOS*) + LDLIBRARY='libpython$(LDVERSION).so' + BLDLIBRARY='-L. -lpython$(LDVERSION)' + RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} +@@ -11028,7 +11035,7 @@ then + else CCSHARED="+z"; + fi;; + Linux-android*) ;; +- Linux*|GNU*) CCSHARED="-fPIC";; ++ Linux*|GNU*|SerenityOS*) CCSHARED="-fPIC";; + Emscripten*|WASI*) + if test "x$enable_wasm_dynamic_linking" = xyes; then : + +@@ -11065,7 +11072,7 @@ then + 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" diff --git a/Ports/python3/patches/0007-Set-name-of-shared-libpython.patch b/Ports/python3/patches/0007-Set-name-of-shared-libpython.patch deleted file mode 100644 index b2606d85f6..0000000000 --- a/Ports/python3/patches/0007-Set-name-of-shared-libpython.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Julian=20Offenh=C3=A4user?= -Date: Fri, 10 Feb 2023 22:48:34 +0100 -Subject: [PATCH] Set name of shared libpython - ---- - configure | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure b/configure -index c358ca4e8ba46155550c4ce8a25c8486dc45e2aa..db10d497b4719543be8ffc65b16f3931c229dad9 100755 ---- a/configure -+++ b/configure -@@ -6750,7 +6750,7 @@ $as_echo "#define Py_ENABLE_SHARED 1" >>confdefs.h - PY3LIBRARY=libpython3.so - fi - ;; -- Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|VxWorks*) -+ Linux*|GNU*|NetBSD*|FreeBSD*|DragonFly*|OpenBSD*|VxWorks*|SerenityOS*) - LDLIBRARY='libpython$(LDVERSION).so' - BLDLIBRARY='-L. -lpython$(LDVERSION)' - RUNSHARED=LD_LIBRARY_PATH=`pwd`${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} diff --git a/Ports/python3/patches/ReadMe.md b/Ports/python3/patches/ReadMe.md index e42aad5759..e03cd18e7f 100644 --- a/Ports/python3/patches/ReadMe.md +++ b/Ports/python3/patches/ReadMe.md @@ -7,14 +7,20 @@ Enforce UTF-8 as the locale encoding By defining `_Py_FORCE_UTF8_LOCALE` as some other platforms already do, we can enforce UTF-8 as the encoding. -## `0002-Tweak-configure-and-configure.ac.patch` +## `0002-Tweak-configure.patch` -Tweak configure and configure.ac +Tweak configure + +Merged patches from Linus Groh, Julian Offenhäuser, Oskar Skog: As usual, make the `configure` script recognize Serenity. Also set `MACHDEP` (which is used for `sys.platform`) to a version-less `serenityos`, even when not cross-compiling. +Set name of shared libpython + +Compile with CCSHARED=-fPIC + ## `0003-Include-sys-uio.h-in-socketmodule.c.patch` Include `sys/uio.h` in `socketmodule.c` @@ -57,6 +63,3 @@ given `TCP_NODELAY` as an argument. This TCP socket option is used in many applications (like pip and requests) for optimization purposes. For now, it can be safely ignored until it's supported in the kernel. -## `0007-Set-name-of-shared-libpython.patch` - -Set name of shared libpython