51 lines
1.8 KiB
Bash
51 lines
1.8 KiB
Bash
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
|
|
|
|
_realname=ukpostcodeparser
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
|
|
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
pkgver=1.1.2
|
|
pkgrel=4
|
|
pkgdesc="UK Postcode parser (mingw-w64)"
|
|
arch=('any')
|
|
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
|
|
url='https://github.com/hamstah/ukpostcodeparser'
|
|
license=('MIT')
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python")
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
|
|
options=('staticlibs' 'strip' '!debug')
|
|
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/hamstah/ukpostcodeparser/archive/v${pkgver}.tar.gz")
|
|
sha512sums=('8113522b728c095f937a9f53f21c369130e3e63c4fc3546dbea4ad1c53648742fb0e766b1254c76ee65d69dec585f1a90caa7d39ca540de1765ff5f989a702de')
|
|
|
|
prepare() {
|
|
cd "${srcdir}"
|
|
rm -rf "python-build-${CARCH}" | true
|
|
cp -r "${_realname}-${pkgver}" "python-build-${CARCH}"
|
|
|
|
# Set version for setuptools_scm
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
|
|
}
|
|
|
|
build() {
|
|
msg "Python build for ${CARCH}"
|
|
cd "${srcdir}/python-build-${CARCH}"
|
|
${MINGW_PREFIX}/bin/python setup.py build
|
|
}
|
|
|
|
check() {
|
|
msg "Python test for ${CARCH}"
|
|
cd "${srcdir}/python-build-${CARCH}"
|
|
${MINGW_PREFIX}/bin/python -m unittest discover -s ukpostcodeparser/test -p '*.py' || warning "Tests failed"
|
|
}
|
|
|
|
package() {
|
|
cd "${srcdir}/python-build-${CARCH}"
|
|
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
|
|
${MINGW_PREFIX}/bin/python setup.py install --prefix=${MINGW_PREFIX} \
|
|
--root="${pkgdir}" --optimize=1 --skip-build
|
|
|
|
install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
|
|
}
|