Files
MINGW-packages/mingw-w64-python-codespell/PKGBUILD
2023-10-05 05:49:18 +01:00

53 lines
1.6 KiB
Bash

# Contributor: Mehdi Chinoune <mehdi.chinoune@hotmail.com>
_realname=codespell
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=2.2.6
pkgrel=1
pkgdesc="Fix common misspellings in source code (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64' 'clang32')
msys2_references=(
'archlinux: codespell'
'pypi: codespell'
)
url='https://github.com/codespell-project/codespell'
license=('GPL2')
depends=("${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
"${MINGW_PACKAGE_PREFIX}-python-installer"
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
"${MINGW_PACKAGE_PREFIX}-python-setuptools-scm"
"${MINGW_PACKAGE_PREFIX}-python-wheel")
options=(!strip)
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname}-${pkgver}.tar.gz")
sha256sums=('a8c65d8eb3faa03deabab6b3bbe798bea72e1799c7e9e955d57eca4096abcff9')
prepare() {
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
}
build() {
cd "${srcdir}"
cp -r "${_realname}-${pkgver}" "python-build-${MSYSTEM}" && cd "python-build-${MSYSTEM}"
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
}
check() {
cd "${srcdir}/python-build-${MSYSTEM}"
"${MINGW_PREFIX}"/bin/python -m pytest
}
package() {
cd "${srcdir}/python-build-${MSYSTEM}"
MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \
--destdir="${pkgdir}" dist/*.whl
install -Dm644 COPYING "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
}