diff options
author | Michel Zou | 2023-10-02 20:59:30 +0200 |
---|---|---|
committer | Michel Zou | 2023-10-02 20:59:30 +0200 |
commit | 80316626d56092cf4f70543538c575346aa0c424 (patch) | |
tree | 59fdcc9a35c080a2bf4a8594cfe004cd89e4eb68 | |
download | aur-80316626d56092cf4f70543538c575346aa0c424.tar.gz |
3.12.0
-rw-r--r-- | .SRCINFO | 26 | ||||
-rw-r--r-- | PKGBUILD | 64 | ||||
-rw-r--r-- | wine-python.sh | 16 |
3 files changed, 106 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..11ba36e231ce --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,26 @@ +pkgbase = mingw-w64-python311-bin + pkgdesc = Next generation of the python high-level scripting language (native MSVC version) (mingw-w64) + pkgver = 3.12.0 + pkgrel = 1 + url = http://www.python.org/ + arch = any + license = PSF + makedepends = mingw-w64-tools + makedepends = mingw-w64-binutils + depends = mingw-w64-openssl + optdepends = mingw-w64-wine: runtime support + noextract = python-3.12.0-embed-win32.zip + noextract = python-3.12.0-embed-amd64.zip + options = staticlibs + options = !buildflags + options = !strip + source = https://www.python.org/ftp/python/3.12.0/python-3.12.0-embed-win32.zip + source = https://www.python.org/ftp/python/3.12.0/python-3.12.0-embed-amd64.zip + source = https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz + source = wine-python.sh + sha256sums = e1d942b621839e65ac874f0fb2af873484e713e6084351dea43538132862c1cb + sha256sums = c87f000e3dae1a572e98e81daeb622f8bc6f22664093fc9c70989b5f0018d49b + sha256sums = 51412956d24a1ef7c97f1cb5f70e185c13e3de1f50d131c0aac6338080687afb + sha256sums = a76a4715e87d3ed4aca6babc8715de8de94513dae4c683c1681551c43698b5ae + +pkgname = mingw-w64-python311-bin diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..90a5356a8696 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,64 @@ +pkgname=mingw-w64-python311-bin +pkgver=3.12.0 +_pybasever=312 +pkgrel=1 +pkgdesc="Next generation of the python high-level scripting language (native MSVC version) (mingw-w64)" +arch=('any') +license=('PSF') +url="http://www.python.org/" +depends=('mingw-w64-openssl') +optdepends=('mingw-w64-wine: runtime support') +makedepends=('mingw-w64-tools' 'mingw-w64-binutils') +options=('staticlibs' '!buildflags' '!strip') +source=("https://www.python.org/ftp/python/${pkgver}/python-${pkgver}-embed-win32.zip" + "https://www.python.org/ftp/python/${pkgver}/python-${pkgver}-embed-amd64.zip" + "https://www.python.org/ftp/python/${pkgver}/Python-${pkgver}.tgz" + wine-python.sh) +noextract=("python-${pkgver}-embed-win32.zip" + "python-${pkgver}-embed-amd64.zip") +sha256sums=('e1d942b621839e65ac874f0fb2af873484e713e6084351dea43538132862c1cb' + 'c87f000e3dae1a572e98e81daeb622f8bc6f22664093fc9c70989b5f0018d49b' + '51412956d24a1ef7c97f1cb5f70e185c13e3de1f50d131c0aac6338080687afb' + 'a76a4715e87d3ed4aca6babc8715de8de94513dae4c683c1681551c43698b5ae') + +_architectures="i686-w64-mingw32 x86_64-w64-mingw32" + +build() { + cd "${srcdir}/Python-${pkgver}" + for _arch in ${_architectures}; do + target="win32" + if test "${_arch}" = x86_64-w64-mingw32 + then + target="amd64" + fi + mkdir -p "build-${_arch}" && pushd "build-${_arch}" + bsdtar -xf "${srcdir}"/python-${pkgver}-embed-${target}.zip + gendef python3.dll + gendef python${_pybasever}.dll + sed -i "s|PyEval_InitThreads@0|PyEval_InitThreads|g" python${_pybasever}.def + ${_arch}-dlltool --dllname python${_pybasever}.dll --def python${_pybasever}.def --output-lib libpython${_pybasever}.dll.a + ${_arch}-dlltool --dllname python3.dll --def python3.def --output-lib libpython3.dll.a + sed "s|@TRIPLE@|${_arch}|g;s|@PYVER@|${_pybasever}|g" "${srcdir}"/wine-python.sh > ${_arch}-python${_pybasever}-bin + popd + done +} + +package() { + for _arch in ${_architectures}; do + cd "${srcdir}/Python-${pkgver}/build-${_arch}" + install -d "$pkgdir"/usr/${_arch}/lib + install -m644 libpython*.a "$pkgdir"/usr/${_arch}/lib + install -d "$pkgdir"/usr/${_arch}/bin + install -d "$pkgdir"/usr/${_arch}/include/python${_pybasever} + cp -r ../Include/* "$pkgdir"/usr/${_arch}/include/python${_pybasever} + install -m644 ../PC/pyconfig.h "$pkgdir"/usr/${_arch}/include/python${_pybasever} + install -m755 python*.dll "$pkgdir"/usr/${_arch}/bin + install -d "$pkgdir"/usr/${_arch}/lib/python${_pybasever} + install -m644 *.pyd "$pkgdir"/usr/${_arch}/lib/python${_pybasever} + install -m755 python.exe "$pkgdir"/usr/${_arch}/bin/python${_pybasever}.exe + install -m644 python${_pybasever}.zip "$pkgdir"/usr/${_arch}/bin/ + install -d "$pkgdir"/usr/bin + install -m755 ${_arch}-python${_pybasever}-bin "$pkgdir"/usr/bin + ${_arch}-strip --strip-unneeded "$pkgdir"/usr/${_arch}/bin/*.dll + done +} diff --git a/wine-python.sh b/wine-python.sh new file mode 100644 index 000000000000..c41caeeee959 --- /dev/null +++ b/wine-python.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +export PYTHONHOME=/usr/@TRIPLE@ + +if test -z "${PYTHONPATH}" +then + export PYTHONPATH=/usr/@TRIPLE@/lib/python@PYVER@ +else + export PYTHONPATH="${PYTHONPATH};/usr/@TRIPLE@/lib/python@PYVER@" +fi + +# https://bugs.winehq.org/show_bug.cgi?id=51813 +set -o pipefail +@TRIPLE@-wine /usr/@TRIPLE@/bin/python@PYVER@.exe "$@" | tee |