Files
MINGW-packages/mingw-w64-python-setuptools-rust/PKGBUILD
Christoph Reiter bd08ada171 Use pypi PURLs instead of plain pypi names
This allows us to include a version and we already use PURL
for other things, so might as well remove the pypi special case.

Normalize the names, since that is required for PURLs.
2025-02-17 09:02:11 +01:00

49 lines
1.6 KiB
Bash

# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>
_realname=setuptools-rust
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=1.10.2
pkgrel=2
pkgdesc="Compile and distribute Python extensions written in rust as easily as if they were written in C (mingw-w64)"
arch=('any')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url='https://github.com/PyO3/setuptools-rust'
msys2_references=(
'archlinux: python-setuptools-rust'
'purl: pkg:pypi/setuptools-rust'
)
license=('spdx:MIT')
depends=("${MINGW_PACKAGE_PREFIX}-rust"
"${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-semantic-version"
"${MINGW_PACKAGE_PREFIX}-python-setuptools")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools-scm")
source=("https://pypi.org/packages/source/${_realname::1}/${_realname/-/_}/${_realname/-/_}-${pkgver}.tar.gz")
sha256sums=('5d73e7eee5f87a6417285b617c97088a7c20d1a70fcea60e3bdc94ff567c29dc')
prepare() {
cp -r "${_realname/-/_}-${pkgver}" "python-build-${MSYSTEM}"
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
}
build() {
cd "python-build-${MSYSTEM}"
python -m build --wheel --skip-dependency-check --no-isolation
}
package() {
cd "python-build-${MSYSTEM}"
MSYS2_ARG_CONV_EXCL="--prefix=" \
python -m installer --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl
install -Dm644 "${srcdir}/${_realname/-/_}-${pkgver}/LICENSE" \
"${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}