Files
MINGW-packages/mingw-w64-python-pywinpty/PKGBUILD
Maksim Bondarenkov 7410252fb4 add a workaround for maturin-built packages
recent pip update introduced a new check for WHEEL files, and such files produced by maturin are
hardcoded to add `win32` platform, which is different to one from mingw cpython. see https://github.com/msys2/MINGW-packages/pull/22963#issuecomment-2568227418.
adding without rebuild just to prevent confusions in case of package update (and while it's not fixed
in maturin upstream)
2025-01-03 13:45:32 +03:00

53 lines
1.6 KiB
Bash

# Contributor: Mehdi Chinoune <mehdi.chinoune@hotmail.com>
_realname=pywinpty
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=2.0.14
pkgrel=2
pkgdesc="Pseudo terminal support for Windows from Python (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://github.com/andfoy/pywinpty'
msys2_references=(
'pypi: pywinpty'
)
license=('spdx:MIT')
depends=("${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-maturin"
"${MINGW_PACKAGE_PREFIX}-rust")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest")
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('18bd9529e4a5daf2d9719aa17788ba6013e594ae94c5a0c27e83df3278b0660e')
prepare() {
cd "${_realname}-${pkgver}"
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}
build() {
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"
export _PYTHON_HOST_PLATFORM=$(python -c "import sysconfig, sys; sys.stdout.write(sysconfig.get_platform())")
python -m build --wheel --skip-dependency-check --no-isolation
}
check() {
cd "python-build-${MSYSTEM}"
python -m pytest
}
package() {
cd "python-build-${MSYSTEM}"
MSYS2_ARG_CONV_EXCL="--prefix=" \
python -m installer --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl
install -Dm644 LICENSE.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}