From 1207d107bde95e4858dcb8e2f0d0ebae1f133a4e Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Sun, 6 Jul 2025 12:44:36 +0200 Subject: [PATCH] python-setuptools: Update to 80.9.0 + cleanup * 0001-mingw-python-fix.patch: easy_install is gone, so no longer needed * 0007-windows-arm64.patch: moved, also use the platform string to check * wininst is long gone, remove the delete logic * Use CFLAGS when building launchers --- .../0001-mingw-python-fix.patch | 13 ------- .../0007-windows-arm64.patch | 10 +++--- mingw-w64-python-setuptools/PKGBUILD | 34 ++++++++----------- 3 files changed, 20 insertions(+), 37 deletions(-) delete mode 100644 mingw-w64-python-setuptools/0001-mingw-python-fix.patch diff --git a/mingw-w64-python-setuptools/0001-mingw-python-fix.patch b/mingw-w64-python-setuptools/0001-mingw-python-fix.patch deleted file mode 100644 index 7881d86a6e..0000000000 --- a/mingw-w64-python-setuptools/0001-mingw-python-fix.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- setuptools-51.1.2/setuptools/command/easy_install.py.orig 2021-01-09 00:44:52.000000000 +0530 -+++ setuptools-51.1.2/setuptools/command/easy_install.py 2021-01-12 11:40:02.894168900 +0530 -@@ -1314,8 +1314,8 @@ - ) - - DEFAULT_SCHEME = dict( -- install_dir='$base/Lib/site-packages', -- script_dir='$base/Scripts', -+ install_dir='$base/lib/python$py_version_short/site-packages', -+ script_dir='$base/bin', - ) - - def _expand(self, *attrs): diff --git a/mingw-w64-python-setuptools/0007-windows-arm64.patch b/mingw-w64-python-setuptools/0007-windows-arm64.patch index 3982fa7e4f..effb738777 100644 --- a/mingw-w64-python-setuptools/0007-windows-arm64.patch +++ b/mingw-w64-python-setuptools/0007-windows-arm64.patch @@ -1,11 +1,11 @@ ---- setuptools-58.2.0/setuptools/command/easy_install.py.orig 2021-10-24 11:48:34.771385900 -0700 -+++ setuptools-58.2.0/setuptools/command/easy_install.py 2021-10-24 11:49:03.364600700 -0700 -@@ -2263,7 +2263,7 @@ +--- setuptools-80.9.0/setuptools/_scripts.py.orig 2025-05-27 02:56:31.000000000 +0200 ++++ setuptools-80.9.0/setuptools/_scripts.py 2025-07-06 12:31:57.777895000 +0200 +@@ -323,7 +323,7 @@ """ - launcher_fn = '%s.exe' % type + launcher_fn = f'{type}.exe' if is_64bit(): - if get_platform() == "win-arm64": -+ if '(arm64)' in sys.version.lower(): ++ if get_platform() == "win-arm64" or "aarch64" in get_platform(): launcher_fn = launcher_fn.replace(".", "-arm64.") else: launcher_fn = launcher_fn.replace(".", "-64.") diff --git a/mingw-w64-python-setuptools/PKGBUILD b/mingw-w64-python-setuptools/PKGBUILD index 275bf909d3..736c370d13 100644 --- a/mingw-w64-python-setuptools/PKGBUILD +++ b/mingw-w64-python-setuptools/PKGBUILD @@ -4,7 +4,7 @@ _realname=setuptools pkgbase=mingw-w64-python-${_realname} pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}") -pkgver=78.1.0 +pkgver=80.9.0 pkgrel=1 pkgdesc="Easily download, build, install, upgrade, and uninstall Python packages (mingw-w64)" arch=('any') @@ -44,7 +44,6 @@ checkdepends=( fi options=(!strip) source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz" - '0001-mingw-python-fix.patch' '0002-Allow-usr-bin-env-in-script.patch' '0003-MinGW-w64-Look-in-same-dir-as-script-for-exe.patch' '0005-execv-warning.patch' @@ -53,21 +52,19 @@ source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realna '0009-launcher-revert-symlink-resolve.patch' '0010-support-py_limited_api.patch' '0011-add-support-for-windmc.patch') -sha256sums=('18fd474d4a82a5f83dac888df697af65afa82dec7323d09c3e37d1f14288da54' - '7b196884ac0151801f9638dabbf9a789fa9070a3b07a4c9e625c5523e8d47387' +sha256sums=('f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c' 'fa54581e3dddb9f4edd332dedbc101f48939a9ca5878e13cf9cf9b3408bc8c22' '39503256652c7c23ce07e26539e8123d269eb5c09f5d9b07e5784b2d7fb8c96f' 'a356b0663f67a296624d1b178b42437b380b48a4bbe05a560d3bf29e93a4c623' 'dbdd96a7ead797b2db9f02dfe19ce853d3775337ccf8fd836377fe3c2a9d1c24' - 'cb897bc7292a733167fa48b5ca18323d76d3374683a7f5e9986c9df63f5332cc' + 'fbf6903e88c0fe0b307365db997505c3d9f07184792aea1442616a3d97f037d9' '391d682a8b8832d7e4be3ac0c3327cfe3c8e520f16e25b43d4441df8036bf147' 'ccb276f9d2d26587d29ecfd4d47a3d4e96fb58738cfaf3a600a8b942c79fc439' '5732980fe5d94f3371ccd0609b160e3b74f88ab71829d0e8b37f6039f4508b79') prepare() { - cd "${srcdir}/setuptools-${pkgver}" + cd "setuptools-${pkgver}" - patch -p1 -i "${srcdir}"/0001-mingw-python-fix.patch patch -p1 -i "${srcdir}"/0002-Allow-usr-bin-env-in-script.patch patch -p1 -i "${srcdir}"/0003-MinGW-w64-Look-in-same-dir-as-script-for-exe.patch patch -p1 -i "${srcdir}"/0005-execv-warning.patch @@ -93,11 +90,11 @@ prepare() { } build() { - cd "${srcdir}"/python-build-${MSYSTEM} + cd "python-build-${MSYSTEM}" rm -f setuptools/{gui,cli}{-32,-64,-arm64,}.exe - local _gui_args="-DGUI=1 -mwindows -O2" - local _cli_args="-DGUI=0 -O2" + local _gui_args="$CFLAGS -DGUI=1 -mwindows" + local _cli_args="$CFLAGS -DGUI=0" if check_option "strip" "y"; then _gui_args+=" -s" _cli_args+=" -s" @@ -106,6 +103,8 @@ build() { i686-w64-mingw32) cc $_cli_args -o setuptools/cli-32.exe launcher.c cc $_gui_args -o setuptools/gui-32.exe launcher.c + # In theory these are not used, but upstream has 32bit launchers + # under both names, so we keep them for compatibility cp setuptools/cli-32.exe setuptools/cli.exe cp setuptools/gui-32.exe setuptools/gui.exe ;; @@ -123,23 +122,20 @@ build() { esac PYTHONPATH="${srcdir}/python-build-${MSYSTEM}" \ - ${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation + python -m build --wheel --skip-dependency-check --no-isolation } check() { - cd "${srcdir}"/python-build-${MSYSTEM} + cd "python-build-${MSYSTEM}" - ${MINGW_PREFIX}/bin/python -m pytest || true + python -m pytest || true } package() { - cd "${srcdir}/python-build-${MSYSTEM}" + cd "python-build-${MSYSTEM}" MSYS2_ARG_CONV_EXCL="--prefix=" \ - ${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \ - --destdir="${pkgdir}" dist/*.whl - - # https://github.com/pypa/distutils/pull/282 - find "${pkgdir}${MINGW_PREFIX}" -name 'wininst-*.exe' -exec rm {} \; + python -m installer --prefix=${MINGW_PREFIX} \ + --destdir="${pkgdir}" dist/*.whl install -Dm644 LICENSE "${pkgdir}"${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE }