diff --git a/python/009-3.8-export-PySignal_SetWakeupFd.patch b/python/009-3.8-export-PySignal_SetWakeupFd.patch deleted file mode 100644 index 5164aba641f..00000000000 --- a/python/009-3.8-export-PySignal_SetWakeupFd.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Python-3.8.0a2-orig/Include/cpython/pyerrors.h 2019-02-25 07:08:32.000000000 -0500 -+++ Python-3.8.0a2/Include/cpython/pyerrors.h 2019-03-11 11:35:44.868187500 -0400 -@@ -132,7 +132,7 @@ PyAPI_FUNC(PyObject *) _PyErr_TrySetFrom - - /* In signalmodule.c */ - --int PySignal_SetWakeupFd(int fd); -+PyAPI_FUNC(int) PySignal_SetWakeupFd(int fd); - PyAPI_FUNC(int) _PyErr_CheckSignals(void); - - /* Support for adding program text to SyntaxErrors */ diff --git a/python/012-3.8-pep3149-cygwin.patch b/python/012-3.8-pep3149-cygwin.patch index 1e50cacd1e6..c6f82daf246 100644 --- a/python/012-3.8-pep3149-cygwin.patch +++ b/python/012-3.8-pep3149-cygwin.patch @@ -9,20 +9,20 @@ ".dll", #else /* !__CYGWIN__ */ "." SOABI ".so", ---- Python-3.12.4/configure.ac.orig 2024-06-06 20:26:44.000000000 +0200 -+++ Python-3.12.4/configure.ac 2024-07-06 12:06:46.609582400 +0200 -@@ -1080,6 +1080,14 @@ - darwin +--- Python-3.13.7/Misc/platform_triplet.c.orig 2025-08-21 08:17:40.030191600 +0200 ++++ Python-3.13.7/Misc/platform_triplet.c 2025-08-21 08:18:24.329873900 +0200 +@@ -265,6 +265,14 @@ + # endif #elif defined(__VXWORKS__) - vxworks + PLATFORM_TRIPLET=vxworks +#elif defined(__CYGWIN__) -+# if defined(__x86_64__) -+ x86_64-cygwin -+# elif defined(__i386__) -+ i386-cygwin -+# else ++# if defined(__x86_64__) ++PLATFORM_TRIPLET=x86_64-cygwin ++# elif defined(__i386__) ++PLATFORM_TRIPLET=i386-cygwin ++# else +# error unknown platform triplet -+# endif ++# endif #elif defined(__wasm32__) # if defined(__EMSCRIPTEN__) - wasm32-emscripten + PLATFORM_TRIPLET=wasm32-emscripten diff --git a/python/900-msysize.patch b/python/900-msysize.patch index 2a0e31a6d3e..b243aaa45b1 100644 --- a/python/900-msysize.patch +++ b/python/900-msysize.patch @@ -1,22 +1,26 @@ ---- Python-3.8.7.cygwin/configure.ac 2021-05-11 21:07:52.839122100 +0200 -+++ Python-3.8.7/configure.ac 2021-05-11 21:10:48.366063600 +0200 -@@ -1137,7 +1148,7 @@ - case $ac_sys_system in +--- Python-3.13.7/configure.ac.orig 2025-08-21 08:21:12.150460400 +0200 ++++ Python-3.13.7/configure.ac 2025-08-21 08:22:09.955175000 +0200 +@@ -1545,7 +1545,7 @@ CYGWIN*) - LDLIBRARY='libpython$(LDVERSION).dll.a' -- DLLLIBRARY='libpython$(LDVERSION).dll' -+ DLLLIBRARY='msys-python$(LDVERSION).dll' - ;; + LDLIBRARY='libpython$(LDVERSION).dll.a' + BLDLIBRARY='-L. -lpython$(LDVERSION)' +- DLLLIBRARY='libpython$(LDVERSION).dll' ++ DLLLIBRARY='msys-python$(LDVERSION).dll' + ;; SunOS*) - LDLIBRARY='libpython$(LDVERSION).so' ---- Python-3.8.7.orig/Lib/ctypes/__init__.py 2020-12-21 17:25:24.000000000 +0100 -+++ Python-3.8.7/Lib/ctypes/__init__.py 2021-05-11 22:26:25.866873900 +0200 -@@ -456,7 +456,7 @@ + LDLIBRARY='libpython$(LDVERSION).so' +--- Python-3.13.11/Lib/ctypes/__init__.py.orig 2025-12-15 18:35:35.827163200 +0100 ++++ Python-3.13.11/Lib/ctypes/__init__.py 2025-12-15 18:41:18.111377300 +0100 +@@ -486,9 +486,11 @@ + if _os.name == "nt": pythonapi = PyDLL("python dll", None, _sys.dllhandle) - elif _sys.platform == "cygwin": -- pythonapi = PyDLL("libpython%d.%d.dll" % _sys.version_info[:2]) -+ pythonapi = PyDLL("msys-python%d.%d.dll" % _sys.version_info[:2]) +-elif _sys.platform in ["android", "cygwin"]: ++elif _sys.platform in ["android"]: + # These are Unix-like platforms which use a dynamically-linked libpython. + pythonapi = PyDLL(_sysconfig.get_config_var("LDLIBRARY")) ++elif _sys.platform == "cygwin": ++ pythonapi = PyDLL(_sysconfig.get_config_var("DLLLIBRARY")) else: pythonapi = PyDLL(None) @@ -44,8 +48,8 @@ print(find_library("crypt")) else: print(cdll.LoadLibrary("libm.so")) ---- Python-3.12.8/Lib/sysconfig.py.orig 2024-12-03 19:42:41.000000000 +0100 -+++ Python-3.12.8/Lib/sysconfig.py 2025-02-01 17:39:28.925188300 +0100 +--- Python-3.12.8/Lib/sysconfig/__init__.py.orig 2024-12-03 19:42:41.000000000 +0100 ++++ Python-3.12.8/Lib/sysconfig/__init__.py 2025-02-01 17:39:28.925188300 +0100 @@ -815,13 +815,13 @@ elif osname[:3] == "aix": from _aix_support import aix_platform diff --git a/python/960-cygwin-time_clockid_converter.patch b/python/960-cygwin-time_clockid_converter.patch new file mode 100644 index 00000000000..1e440de9264 --- /dev/null +++ b/python/960-cygwin-time_clockid_converter.patch @@ -0,0 +1,13 @@ +diff --git a/Modules/timemodule.c b/Modules/timemodule.c +index 1bfbf3f6a0b991..3271d87ddc27f2 100644 +--- a/Modules/timemodule.c ++++ b/Modules/timemodule.c +@@ -187,7 +187,7 @@ time_clockid_converter(PyObject *obj, clockid_t *p) + { + #ifdef _AIX + long long clk_id = PyLong_AsLongLong(obj); +-#elif defined(__DragonFly__) ++#elif defined(__DragonFly__) || defined(__CYGWIN__) + long clk_id = PyLong_AsLong(obj); + #else + int clk_id = PyLong_AsInt(obj); diff --git a/python/970-ossaudiodev.patch b/python/970-ossaudiodev.patch deleted file mode 100644 index ab6a6702a52..00000000000 --- a/python/970-ossaudiodev.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- Python-3.11.2/Modules/ossaudiodev.c.orig 2023-02-07 14:37:51.000000000 +0100 -+++ Python-3.11.2/Modules/ossaudiodev.c 2023-02-13 20:51:13.398293500 +0100 -@@ -964,7 +964,7 @@ - }; - - static PyTypeObject OSSAudioType = { -- PyVarObject_HEAD_INIT(&PyType_Type, 0) -+ PyVarObject_HEAD_INIT(NULL, 0) - "ossaudiodev.oss_audio_device", /*tp_name*/ - sizeof(oss_audio_t), /*tp_basicsize*/ - 0, /*tp_itemsize*/ -@@ -998,7 +998,7 @@ - }; - - static PyTypeObject OSSMixerType = { -- PyVarObject_HEAD_INIT(&PyType_Type, 0) -+ PyVarObject_HEAD_INIT(NULL, 0) - "ossaudiodev.oss_mixer_device", /*tp_name*/ - sizeof(oss_mixer_t), /*tp_basicsize*/ - 0, /*tp_itemsize*/ diff --git a/python/991-fix-pc.patch b/python/991-fix-pc.patch new file mode 100644 index 00000000000..6687aded9ea --- /dev/null +++ b/python/991-fix-pc.patch @@ -0,0 +1,13 @@ +--- Python-3.13.7/configure.ac.orig 2025-08-14 13:12:11.000000000 +0200 ++++ Python-3.13.7/configure.ac 2025-09-12 13:23:33.609233300 +0200 +@@ -6320,6 +6320,10 @@ + if test "$PY_ENABLE_SHARED" = "1" && ( test -n "$ANDROID_API_LEVEL" || test "$MACHDEP" = "cygwin"); then + MODULE_DEPS_SHARED="$MODULE_DEPS_SHARED \$(LDLIBRARY)" + LIBPYTHON="\$(BLDLIBRARY)" ++ LIBPYTHON="$BLDLIBRARY" ++ LIBPYTHON=$(echo "$LIBPYTHON" | sed "s/\$(LDVERSION)/$LDVERSION/g") ++ LIBPYTHON=$(echo "$LIBPYTHON" | sed "s/\$(VERSION)/$VERSION/g") ++ LIBPYTHON=$(echo "$LIBPYTHON" | sed "s/\$(ABIFLAGS)/$ABIFLAGS/g") + fi + + # On iOS the shared libraries must be linked with the Python framework diff --git a/python/991-py-limited-api.patch b/python/991-py-limited-api.patch index bbf042eb497..cd03709d568 100644 --- a/python/991-py-limited-api.patch +++ b/python/991-py-limited-api.patch @@ -1,6 +1,6 @@ ---- Python-3.12.12/Makefile.pre.in.orig 2025-10-28 19:07:38.381429100 +0100 -+++ Python-3.12.12/Makefile.pre.in 2025-10-28 20:29:59.489772400 +0100 -@@ -263,6 +263,8 @@ +--- Python-3.13.11/Makefile.pre.in.orig 2025-12-15 18:59:49.824354600 +0100 ++++ Python-3.13.11/Makefile.pre.in 2025-12-15 19:00:42.395566600 +0100 +@@ -278,6 +278,8 @@ LINK_PYTHON_DEPS=@LINK_PYTHON_DEPS@ PY_ENABLE_SHARED= @PY_ENABLE_SHARED@ STATIC_LIBPYTHON= @STATIC_LIBPYTHON@ @@ -9,16 +9,16 @@ LIBS= @LIBS@ -@@ -615,7 +617,7 @@ +@@ -696,7 +698,7 @@ .PHONY: build_all - build_all: check-clean-src $(BUILDPYTHON) platform sharedmods \ + build_all: check-clean-src check-app-store-compliance $(BUILDPYTHON) platform sharedmods \ - gdbhooks Programs/_testembed scripts checksharedmods rundsymutil + gdbhooks Programs/_testembed scripts checksharedmods rundsymutil $(ABI3DLLLIBRARY) $(ABI3LDLIBRARY) .PHONY: build_wasm build_wasm: check-clean-src $(BUILDPYTHON) platform sharedmods \ -@@ -883,6 +885,10 @@ +@@ -995,6 +997,10 @@ else true; \ fi @@ -29,7 +29,7 @@ # wasm32-emscripten browser build # wasm assets directory is relative to current build dir, e.g. "./usr/local". # --preload-file turns a relative asset path into an absolute path. -@@ -1982,6 +1989,7 @@ +@@ -2214,6 +2220,7 @@ if test -n "$(DLLLIBRARY)" ; then \ $(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \ $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBDIR); \ @@ -37,7 +37,7 @@ else \ $(INSTALL_SHARED) $(LDLIBRARY) $(DESTDIR)$(LIBDIR)/$(INSTSONAME); \ if test $(LDLIBRARY) != $(INSTSONAME); then \ -@@ -2458,6 +2466,7 @@ +@@ -2698,6 +2705,7 @@ if test "$(PYTHONFRAMEWORKDIR)" = no-framework; then \ if test "$(SHLIB_SUFFIX)" = .dll; then \ $(INSTALL_DATA) $(LDLIBRARY) $(DESTDIR)$(LIBPL) ; \ @@ -45,7 +45,7 @@ else \ $(INSTALL_DATA) $(LIBRARY) $(DESTDIR)$(LIBPL)/$(LIBRARY) ; \ fi; \ -@@ -2711,7 +2720,7 @@ +@@ -3006,7 +3014,7 @@ .PHONY: clobber clobber: clean diff --git a/python/PKGBUILD b/python/PKGBUILD index 22fc36f9648..30b54010aae 100644 --- a/python/PKGBUILD +++ b/python/PKGBUILD @@ -3,8 +3,8 @@ pkgbase=python pkgname=('python' 'python-devel') -pkgver=3.12.12 -pkgrel=3 +pkgver=3.13.11 +pkgrel=1 _pybasever=${pkgver%.*} pkgdesc="Next generation of the python high-level scripting language" arch=('i686' 'x86_64') @@ -33,32 +33,32 @@ makedepends=( source=(https://www.python.org/ftp/python/${pkgver%rc*}/Python-${pkgver}.tar.xz 003-3.4-select-cygwin.patch 005-3.7-ctypes-cygwin.patch - 009-3.8-export-PySignal_SetWakeupFd.patch 012-3.8-pep3149-cygwin.patch 027-install-import-library.patch 900-msysize.patch 920-allow-win-drives-in-os-path-isabs.patch 940-rebase-python-dll.patch 950-rebase-dlls.patch - 970-ossaudiodev.patch + 960-cygwin-time_clockid_converter.patch 980-fix-module-lib-dep.patch 990-cygwin-default-to-spawn-for-multiprocessing-and-disa.patch 991-py-limited-api.patch + 991-fix-pc.patch EXTERNALLY-MANAGED) -sha256sums=('fb85a13414b028c49ba18bbd523c2d055a30b56b18b92ce454ea2c51edc656c4' +sha256sums=('16ede7bb7cdbfa895d11b0642fa0e523f291e6487194d53cf6d3b338c3a17ea2' '82cfafc5b31ad4c9bb4c9786044c39c75762dbc2656abdfdc433c23fee69c02f' 'f0bb75ca69c63894fc43e0f8218c9dbcc746935bf5ea095a724e6fb2f5dcc566' - '70f854f00de71372e49f2ebbff7491e09e9e036e8e3f3646fe2984e30fb4a9da' - '24cc76e155b5e017d2e46e784eb3407de60f2f1fd26e691ef222bc2088bbb9d5' + '9cb8b53dc72d8bfdbe59978067d707911cf3a8c79218f0b46335a09a680c14cf' '9d0efb7e7e913e96b9f7953802311bbc2d046a7bfdcc3ffaf11fc509731b4d18' - 'a0acb9da960df3d509dfb530f548adeffbcab616e7f4f2fc92fc98659649d43b' + '5fecb91bcb50e3470db6369e66b132611eaeeb97d4caa8d43246e91b91a2d33a' '85d9d042e0fa3493ec54b364e6b4fb6d2b12ba09641e01047bc84a09605ef76b' 'b439ff4f0a1f13858f8fb596414b74ed2c14fc3103d90287bb8e461ee89288b9' 'bcdb4e7922e30f7dfbd3993ffe6db2dfd0df29326bebd12203dce376ea3451d9' - 'ee109d91a1c7ea84d278d9a8b0e1feb397e691b8868d79f77ea7bb6b1b3b1968' + '32e8250f3c9432f99c7bb77117c4930f260075599d843602ce01f2d460693811' 'e2861218f05741bfe99b05bb41cf88e14f57747aedec251626691b05482a50bd' 'd04ca4778f150b880e23b9bc1fe5c5385e41228399093320c80ad4d5e29c6aab' - '2124efe25780baee553f5634b1d0487a0fc631622f30198dcf4976b9665aa2a6' + 'fce607316ab780a8c2916e545d86071d34b734f4f883fa497d0f8a0551c15b2b' + '5e5b69211025a4f89319d7084263bcfa611dc3d3d7573e025370b81ce92baf5c' '2c8cdad18085b8736e985653c0f18523958f29b72125e15124806a0f3d1a20ee') apply_patch_with_msg() { @@ -75,15 +75,13 @@ prepare() { apply_patch_with_msg \ 003-3.4-select-cygwin.patch \ 005-3.7-ctypes-cygwin.patch \ - 009-3.8-export-PySignal_SetWakeupFd.patch \ 012-3.8-pep3149-cygwin.patch \ 027-install-import-library.patch \ 900-msysize.patch \ 920-allow-win-drives-in-os-path-isabs.patch \ 940-rebase-python-dll.patch \ 950-rebase-dlls.patch \ - 970-ossaudiodev.patch \ - 980-fix-module-lib-dep.patch + 960-cygwin-time_clockid_converter.patch \ # https://github.com/msys2/MSYS2-packages/pull/4743#issuecomment-2213043559 apply_patch_with_msg \ @@ -94,6 +92,10 @@ prepare() { apply_patch_with_msg \ 991-py-limited-api.patch + # github.com/python/cpython/issues/138800 + apply_patch_with_msg \ + 991-fix-pc.patch + # Ensure that we are using the system copy of various libraries (expat, zlib and libffi), # rather than copies shipped in the tarball rm -r Modules/expat @@ -102,10 +104,12 @@ prepare() { } build() { - cd "${srcdir}/Python-${pkgver}" - export MSYSTEM=CYGWIN - ./configure \ + + mkdir -p "${srcdir}/build-${MSYSTEM}" + cd "${srcdir}/build-${MSYSTEM}" + + "${srcdir}/Python-${pkgver}"/configure \ --prefix=/usr \ --build=${CHOST} \ --host=${CHOST} \ @@ -124,8 +128,8 @@ build() { } check() { - cd "${srcdir}/Python-${pkgver}" - "${srcdir}/Python-${pkgver}/python.exe" -m test.regrtest -x test_posixpath test_logging + cd "${srcdir}/build-${MSYSTEM}" + "./python.exe" -m test.regrtest -x test_posixpath test_logging } package_python() { @@ -135,7 +139,7 @@ package_python() { provides=('python3') replaces=('python3') - cd "${srcdir}/Python-${pkgver}" + cd "${srcdir}/build-${MSYSTEM}" make DESTDIR="${pkgdir}" install # Why are these not done by default... @@ -150,7 +154,7 @@ package_python() { install -Dm644 "$srcdir"/EXTERNALLY-MANAGED -t "${pkgdir}/usr/lib/python${_pybasever}/" # License - install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" + install -Dm644 "${srcdir}/Python-${pkgver}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } package_python-devel() {