diff --git a/ports/python3/build.sh b/ports/python3/build.sh index 4f957174..c50b61b3 100755 --- a/ports/python3/build.sh +++ b/ports/python3/build.sh @@ -1,25 +1,22 @@ #!/bin/bash ../install.sh NAME='python' -VERSION='3.13.3' -DOWNLOAD_URL="https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tar.xz#40f868bcbdeb8149a3149580bb9bfd407b3321cd48f0be631af955ac92c0e041" +VERSION='3.14.7' +DOWNLOAD_URL="https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tar.xz#3b48dac8fb59f62eaa67ac83c1eb12bda1b7a08406dd286e252c11a66be27f81" TAR_CONTENT="Python-$VERSION" -DEPENDENCIES=('ncurses' 'zlib' 'openssl') +DEPENDENCIES=('ncurses' 'openssl' 'libffi' 'zlib' 'zstd' 'bzip2') CONFIG_SUB=('config.sub') CONFIGURE_OPTIONS=( "--build=$(uname -m)-pc-linux-gnu" - "--with-build-python=python3.13" - '--without-ensurepip' + '--with-build-python=python3.14' '--disable-ipv6' - '--disable-test-modules' '--enable-shared' + '--disable-test-modules' 'ac_cv_file__dev_ptmx=no' 'ac_cv_file__dev_ptc=no' ) -pre_configure() { - if ! command -v python3.13 &>/dev/null ; then - echo "You need to have python3.13 installed on your host machine" >&2 - exit 1 - fi +post_install() { + mkdir -p "$DESTDIR/usr/bin" + ln -sf python3 "$DESTDIR/usr/bin/python" } diff --git a/ports/python3/patches/0001-fix-configure-for-banan_os.patch b/ports/python3/patches/0001-add-support-for-banan_os.patch similarity index 62% rename from ports/python3/patches/0001-fix-configure-for-banan_os.patch rename to ports/python3/patches/0001-add-support-for-banan_os.patch index c8199864..4d39a9f0 100644 --- a/ports/python3/patches/0001-fix-configure-for-banan_os.patch +++ b/ports/python3/patches/0001-add-support-for-banan_os.patch @@ -1,7 +1,7 @@ -diff -ruN Python-3.13.3/configure Python-3.13.3-banan_os/configure ---- Python-3.13.3/configure 2025-04-08 16:54:08.000000000 +0300 -+++ Python-3.13.3-banan_os/configure 2025-04-19 04:25:20.860260051 +0300 -@@ -4052,6 +4052,9 @@ +diff -ru python-3.14.7/configure python-3.14.7-banan_os/configure +--- python-3.14.7/configure 2026-08-05 13:29:49.000000000 +0300 ++++ python-3.14.7-banan_os/configure 2026-08-25 12:39:57.212768646 +0300 +@@ -4112,6 +4112,9 @@ *-*-linux*) ac_sys_system=Linux ;; @@ -11,7 +11,7 @@ diff -ruN Python-3.13.3/configure Python-3.13.3-banan_os/configure *-*-cygwin*) ac_sys_system=Cygwin ;; -@@ -4500,6 +4503,9 @@ +@@ -4591,6 +4594,9 @@ _host_ident=$host_cpu esac ;; @@ -21,7 +21,7 @@ diff -ruN Python-3.13.3/configure Python-3.13.3-banan_os/configure *-*-cygwin*) _host_ident= ;; -@@ -7603,6 +7609,11 @@ +@@ -7751,6 +7757,11 @@ PY3LIBRARY=libpython3.so fi ;; @@ -33,7 +33,7 @@ diff -ruN Python-3.13.3/configure Python-3.13.3-banan_os/configure hp*|HP*) case `uname -m` in ia64) -@@ -12983,7 +12994,7 @@ +@@ -13750,7 +13761,7 @@ Emscripten*|WASI*) LDSHARED='$(CC) -shared' LDCXXSHARED='$(CXX) -shared';; @@ -42,19 +42,12 @@ diff -ruN Python-3.13.3/configure Python-3.13.3-banan_os/configure LDSHARED='$(CC) -shared' LDCXXSHARED='$(CXX) -shared';; FreeBSD*) -@@ -13069,6 +13080,7 @@ +@@ -13835,7 +13846,7 @@ + then CCSHARED="-fPIC"; else CCSHARED="+z"; fi;; - Linux*|GNU*) CCSHARED="-fPIC";; -+ banan_os*) CCSHARED="-fPIC";; +- Linux*|GNU*) CCSHARED="-fPIC";; ++ Linux*|GNU*|banan_os*) CCSHARED="-fPIC";; Emscripten*|WASI*) if test "x$enable_wasm_dynamic_linking" = xyes then : -@@ -23609,6 +23621,7 @@ - - case $ac_sys_system in - Darwin) ;; -+banan_os) ;; - *) LIBM=-lm - esac - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for --with-libm=STRING" >&5 diff --git a/ports/python3/patches/0002-fix-timeval-declaration.patch b/ports/python3/patches/0002-fix-timeval-declaration.patch new file mode 100644 index 00000000..dd141e0d --- /dev/null +++ b/ports/python3/patches/0002-fix-timeval-declaration.patch @@ -0,0 +1,12 @@ +diff -ru python-3.14.7/Include/internal/pycore_time.h python-3.14.7-banan_os/Include/internal/pycore_time.h +--- python-3.14.7/Include/internal/pycore_time.h 2026-08-05 13:29:49.000000000 +0300 ++++ python-3.14.7-banan_os/Include/internal/pycore_time.h 2026-08-25 12:39:57.210172412 +0300 +@@ -59,7 +59,7 @@ + + #include "pycore_runtime_structs.h" // _PyTimeFraction + +-#ifdef __clang__ ++#if defined(__clang__) || defined(__banan_os__) + struct timeval; + #endif + diff --git a/ports/python3/patches/0002-rewrite-info-querying.patch b/ports/python3/patches/0002-rewrite-info-querying.patch deleted file mode 100644 index 3f30e715..00000000 --- a/ports/python3/patches/0002-rewrite-info-querying.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -ruN Python-3.13.3/Objects/mimalloc/prim/unix/prim.c Python-3.13.3-banan_os/Objects/mimalloc/prim/unix/prim.c ---- Python-3.13.3/Objects/mimalloc/prim/unix/prim.c 2025-04-08 16:54:08.000000000 +0300 -+++ Python-3.13.3-banan_os/Objects/mimalloc/prim/unix/prim.c 2025-04-19 02:14:12.417811656 +0300 -@@ -608,10 +608,13 @@ - getrusage(RUSAGE_SELF, &rusage); - pinfo->utime = timeval_secs(&rusage.ru_utime); - pinfo->stime = timeval_secs(&rusage.ru_stime); --#if !defined(__HAIKU__) -+#if !defined(__HAIKU__) && !defined(__banan_os__) - pinfo->page_faults = rusage.ru_majflt; - #endif --#if defined(__HAIKU__) -+#if defined(__banan_os__) -+ pinfo->page_faults = 0; -+ pinfo->peak_rss = 0; -+#elif defined(__HAIKU__) - // Haiku does not have (yet?) a way to - // get these stats per process - thread_info tid; diff --git a/ports/python3/patches/0003-fix-posixmodule.patch b/ports/python3/patches/0003-fix-posixmodule.patch new file mode 100644 index 00000000..f3fd2ca1 --- /dev/null +++ b/ports/python3/patches/0003-fix-posixmodule.patch @@ -0,0 +1,36 @@ +diff -ru python-3.14.7/Modules/posixmodule.c python-3.14.7-banan_os/Modules/posixmodule.c +--- python-3.14.7/Modules/posixmodule.c 2026-08-05 13:29:49.000000000 +0300 ++++ python-3.14.7-banan_os/Modules/posixmodule.c 2026-08-25 12:39:57.421224835 +0300 +@@ -15351,11 +15351,19 @@ + os_eventfd_read_impl(PyObject *module, int fd) + /*[clinic end generated code: output=8f2c7b59a3521fd1 input=110f8b57fa596afe]*/ + { ++#ifndef __banan_os__ + eventfd_t value; ++#else ++ uint64_t value; ++#endif + int result; + Py_BEGIN_ALLOW_THREADS ++#ifndef __banan_os__ + result = eventfd_read(fd, &value); +- Py_END_ALLOW_THREADS ++#else ++ result = (read(fd, &value, sizeof(value)) == sizeof(value)) ? 0 : -1; ++#endif ++ Py_END_ALLOW_THREADS + if (result == -1) { + return PyErr_SetFromErrno(PyExc_OSError); + } +@@ -15377,7 +15385,11 @@ + { + int result; + Py_BEGIN_ALLOW_THREADS ++#ifndef __banan_os__ + result = eventfd_write(fd, value); ++#else ++ result = (write(fd, &value, sizeof(value)) == sizeof(value)) ? 0 : -1; ++#endif + Py_END_ALLOW_THREADS + if (result == -1) { + return PyErr_SetFromErrno(PyExc_OSError); diff --git a/ports/python3/patches/0003-fix-timeval-declaration.patch b/ports/python3/patches/0003-fix-timeval-declaration.patch deleted file mode 100644 index 4d4d9981..00000000 --- a/ports/python3/patches/0003-fix-timeval-declaration.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -ruN Python-3.13.3/Include/internal/pycore_time.h Python-3.13.3-banan_os/Include/internal/pycore_time.h ---- Python-3.13.3/Include/internal/pycore_time.h 2025-04-08 16:54:08.000000000 +0300 -+++ Python-3.13.3-banan_os/Include/internal/pycore_time.h 2025-04-19 02:27:02.327447295 +0300 -@@ -58,9 +58,7 @@ - #endif - - --#ifdef __clang__ - struct timeval; --#endif - - #define _SIZEOF_PYTIME_T 8 - diff --git a/ports/python3/patches/0004-fix-resource-module.patch b/ports/python3/patches/0004-fix-resource.patch similarity index 63% rename from ports/python3/patches/0004-fix-resource-module.patch rename to ports/python3/patches/0004-fix-resource.patch index d9341ec6..d31f0226 100644 --- a/ports/python3/patches/0004-fix-resource-module.patch +++ b/ports/python3/patches/0004-fix-resource.patch @@ -1,15 +1,15 @@ -diff -ruN Python-3.13.3/Modules/resource.c Python-3.13.3-banan_os/Modules/resource.c ---- Python-3.13.3/Modules/resource.c 2025-04-08 16:54:08.000000000 +0300 -+++ Python-3.13.3-banan_os/Modules/resource.c 2025-04-19 02:36:06.945810525 +0300 -@@ -126,6 +126,7 @@ - PyFloat_FromDouble(doubletime(ru.ru_utime))); +diff -ru python-3.14.7/Modules/resource.c python-3.14.7-banan_os/Modules/resource.c +--- python-3.14.7/Modules/resource.c 2026-08-05 13:29:49.000000000 +0300 ++++ python-3.14.7-banan_os/Modules/resource.c 2026-08-25 12:39:57.421597162 +0300 +@@ -125,6 +125,7 @@ PyStructSequence_SetItem(result, 1, PyFloat_FromDouble(doubletime(ru.ru_stime))); -+#if !defined(__banan_os__) PyStructSequence_SetItem(result, 2, PyLong_FromLong(ru.ru_maxrss)); ++#ifndef __banan_os__ PyStructSequence_SetItem(result, 3, PyLong_FromLong(ru.ru_ixrss)); PyStructSequence_SetItem(result, 4, PyLong_FromLong(ru.ru_idrss)); -@@ -140,6 +141,7 @@ + PyStructSequence_SetItem(result, 5, PyLong_FromLong(ru.ru_isrss)); +@@ -138,6 +139,7 @@ PyStructSequence_SetItem(result, 13, PyLong_FromLong(ru.ru_nsignals)); PyStructSequence_SetItem(result, 14, PyLong_FromLong(ru.ru_nvcsw)); PyStructSequence_SetItem(result, 15, PyLong_FromLong(ru.ru_nivcsw)); diff --git a/ports/python3/patches/0005-fix-group-module.patch b/ports/python3/patches/0005-fix-group-module.patch deleted file mode 100644 index fd071350..00000000 --- a/ports/python3/patches/0005-fix-group-module.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -ruN Python-3.13.3/Modules/grpmodule.c Python-3.13.3-banan_os/Modules/grpmodule.c ---- Python-3.13.3/Modules/grpmodule.c 2025-04-08 16:54:08.000000000 +0300 -+++ Python-3.13.3-banan_os/Modules/grpmodule.c 2025-04-19 02:40:57.658713753 +0300 -@@ -91,9 +91,12 @@ - - #define SET(i,val) PyStructSequence_SetItem(v, i, val) - SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_name)); -+#if !defined(__banan_os__) - if (p->gr_passwd) - SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_passwd)); -- else { -+ else -+#endif -+ { - SET(setIndex++, Py_None); - Py_INCREF(Py_None); - } diff --git a/ports/python3/patches/0005-fix-selectmodule.patch b/ports/python3/patches/0005-fix-selectmodule.patch new file mode 100644 index 00000000..d753edfa --- /dev/null +++ b/ports/python3/patches/0005-fix-selectmodule.patch @@ -0,0 +1,14 @@ +diff -ru python-3.14.7/Modules/selectmodule.c python-3.14.7-banan_os/Modules/selectmodule.c +--- python-3.14.7/Modules/selectmodule.c 2026-08-05 13:29:49.000000000 +0300 ++++ python-3.14.7-banan_os/Modules/selectmodule.c 2026-08-25 12:39:57.421740199 +0300 +@@ -71,6 +71,10 @@ + # define SOCKET int + #endif + ++#ifdef __banan_os__ ++#include ++#endif ++ + // WASI SDK 16 does not have POLLPRIO, define as no-op + #if defined(__wasi__) && !defined(POLLPRI) + # define POLLPRI 0 diff --git a/ports/python3/patches/0006-fix-mimalloc-rusage.patch b/ports/python3/patches/0006-fix-mimalloc-rusage.patch new file mode 100644 index 00000000..e650107a --- /dev/null +++ b/ports/python3/patches/0006-fix-mimalloc-rusage.patch @@ -0,0 +1,12 @@ +diff -ru python-3.14.7/Objects/mimalloc/prim/unix/prim.c python-3.14.7-banan_os/Objects/mimalloc/prim/unix/prim.c +--- python-3.14.7/Objects/mimalloc/prim/unix/prim.c 2026-08-05 13:29:49.000000000 +0300 ++++ python-3.14.7-banan_os/Objects/mimalloc/prim/unix/prim.c 2026-08-25 12:39:57.457423411 +0300 +@@ -608,7 +608,7 @@ + getrusage(RUSAGE_SELF, &rusage); + pinfo->utime = timeval_secs(&rusage.ru_utime); + pinfo->stime = timeval_secs(&rusage.ru_stime); +-#if !defined(__HAIKU__) ++#if !defined(__HAIKU__) && !defined(__banan_os__) + pinfo->page_faults = rusage.ru_majflt; + #endif + #if defined(__HAIKU__) diff --git a/ports/python3/patches/0006-fix-select-module.patch b/ports/python3/patches/0006-fix-select-module.patch deleted file mode 100644 index 1c2786a9..00000000 --- a/ports/python3/patches/0006-fix-select-module.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -ruN Python-3.13.3/Modules/selectmodule.c Python-3.13.3-banan_os/Modules/selectmodule.c ---- Python-3.13.3/Modules/selectmodule.c 2025-04-08 16:54:08.000000000 +0300 -+++ Python-3.13.3-banan_os/Modules/selectmodule.c 2025-04-19 02:55:44.944860340 +0300 -@@ -54,6 +54,10 @@ - #include - #endif - -+#if defined(__banan_os__) -+#include -+#endif -+ - #ifdef __sgi - /* This is missing from unistd.h */ - extern void bzero(void *, int); diff --git a/ports/python3/patches/0008-fix-socket-module.patch b/ports/python3/patches/0008-fix-socket-module.patch deleted file mode 100644 index 1804247e..00000000 --- a/ports/python3/patches/0008-fix-socket-module.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -ruN Python-3.13.3/Modules/socketmodule.c Python-3.13.3-banan_os/Modules/socketmodule.c ---- Python-3.13.3/Modules/socketmodule.c 2025-04-08 16:54:08.000000000 +0300 -+++ Python-3.13.3-banan_os/Modules/socketmodule.c 2025-04-19 03:09:49.117436782 +0300 -@@ -1676,10 +1676,17 @@ - default: - /* If we don't know the address family, don't raise an - exception -- return it as an (int, bytes) tuple. */ -+#if defined(__banan_os__) - return Py_BuildValue("iy#", - addr->sa_family, - addr->sa_data, -- sizeof(addr->sa_data)); -+ sizeof(((struct sockaddr_storage){}).ss_storage)); -+#else -+ return Py_BuildValue("iy#", -+ addr->sa_family, -+ addr->sa_data, -+ sizeof(addr->sa_data)); -+#endif - - } - }