summaryrefslogtreecommitdiff
path: root/Ports/python3/patches
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-05-06 16:46:43 +0100
committerLinus Groh <mail@linusgroh.de>2021-05-06 16:46:43 +0100
commitf1791eca13af3bc24e82a6813e3d9be82fc6f9a1 (patch)
tree8ff99ef0d491ef34c832de1480a2763a09129b8e /Ports/python3/patches
parent8cfbeb78ff484eaeb6375335db339ea0676f11cc (diff)
downloadserenity-f1791eca13af3bc24e82a6813e3d9be82fc6f9a1.zip
Ports: Always set Python MACHDEP to version-less 'serenityos'
This is used for `sys.platform`, so it's important to get it right and ideally never change it again. When not cross-compiling this would append the `uname -r` version number, so let's explicitly override the generated value and set it to `serenityos`. Various other systems do this as well.
Diffstat (limited to 'Ports/python3/patches')
-rw-r--r--Ports/python3/patches/ReadMe.md2
-rw-r--r--Ports/python3/patches/fix-autoconf.patch26
2 files changed, 22 insertions, 6 deletions
diff --git a/Ports/python3/patches/ReadMe.md b/Ports/python3/patches/ReadMe.md
index 78ebc91d1e..08724930b1 100644
--- a/Ports/python3/patches/ReadMe.md
+++ b/Ports/python3/patches/ReadMe.md
@@ -14,7 +14,7 @@ Disables check for `RLIMIT_CORE` and subsequent `setrlimit()` call. Would be ena
## `fix-autoconf.patch`
-As usual, make the `configure` script recognize Serenity.
+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.
## `remove-setlocale-from-preconfig.patch`
diff --git a/Ports/python3/patches/fix-autoconf.patch b/Ports/python3/patches/fix-autoconf.patch
index b156daf98f..1362ee3512 100644
--- a/Ports/python3/patches/fix-autoconf.patch
+++ b/Ports/python3/patches/fix-autoconf.patch
@@ -10,7 +10,7 @@
os=-sysv4
;;
--- Python-3.9.5/configure.ac 2021-05-03 15:54:42.000000000 +0100
-+++ Python-3.9.5/configure.ac 2021-05-06 12:46:42.579733794 +0100
++++ Python-3.9.5/configure.ac 2021-05-06 16:40:34.503092204 +0100
@@ -391,6 +391,9 @@
# a lot of different things including 'define_xopen_source'
# in the case statement below.
@@ -21,7 +21,15 @@
*-*-linux-android*)
ac_sys_system=Linux-android
;;
-@@ -437,6 +440,9 @@
+@@ -429,6 +432,7 @@
+ linux*) MACHDEP="linux";;
+ cygwin*) MACHDEP="cygwin";;
+ darwin*) MACHDEP="darwin";;
++ serenityos*) MACHDEP="serenityos";;
+ '') MACHDEP="unknown";;
+ esac
+ fi
+@@ -437,6 +441,9 @@
AC_SUBST(_PYTHON_HOST_PLATFORM)
if test "$cross_compiling" = yes; then
case "$host" in
@@ -32,7 +40,7 @@
case "$host_cpu" in
arm*)
--- Python-3.9.5/configure 2021-05-03 15:54:42.000000000 +0100
-+++ Python-3.9.5/configure 2021-05-06 12:48:56.875043814 +0100
++++ Python-3.9.5/configure 2021-05-06 16:39:39.108339089 +0100
@@ -3295,6 +3295,9 @@
# a lot of different things including 'define_xopen_source'
# in the case statement below.
@@ -43,7 +51,15 @@
*-*-linux-android*)
ac_sys_system=Linux-android
;;
-@@ -3342,6 +3345,9 @@
+@@ -3333,6 +3336,7 @@
+ linux*) MACHDEP="linux";;
+ cygwin*) MACHDEP="cygwin";;
+ darwin*) MACHDEP="darwin";;
++ serenityos*) MACHDEP="serenityos";;
+ '') MACHDEP="unknown";;
+ esac
+ fi
+@@ -3342,6 +3346,9 @@
if test "$cross_compiling" = yes; then
case "$host" in
@@ -53,7 +69,7 @@
*-*-linux*)
case "$host_cpu" in
arm*)
-@@ -9646,6 +9652,7 @@
+@@ -9646,6 +9653,7 @@
# LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";;
Linux-android*) LINKFORSHARED="-pie -Xlinker -export-dynamic";;
Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";;