blob: 5761569c29b9194da413f4e7c3e9e780767f865c [file] [log] [blame] [edit]
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
_realname=importlib-metadata
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
pkgver=4.6.0
pkgrel=1
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}=${pkgver}")
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgdesc="Read metadata from Python packages (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url='https://importlib-metadata.readthedocs.io/'
license=('Apache')
depends=("${MINGW_PACKAGE_PREFIX}-python"
"${MINGW_PACKAGE_PREFIX}-python-zipp")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools"
"${MINGW_PACKAGE_PREFIX}-python-setuptools-scm")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pip"
"${MINGW_PACKAGE_PREFIX}-python-pytest-runner"
"${MINGW_PACKAGE_PREFIX}-python-wheel")
source=("${_realname}-${pkgver}.tar.gz"::"https://files.pythonhosted.org/packages/source/${_realname::1}/${_realname//-/_}/${_realname//-/_}-${pkgver}.tar.gz")
sha256sums=('4a5611fea3768d3d967c447ab4e93f567d95db92225b43b7b238dbfb855d70bb')
# Helper macros to help make tasks easier #
apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying $_patch"
patch -Nbp1 -i "${srcdir}/$_patch"
done
}
del_file_exists() {
for _fname in "$@"
do
if [ -f $_fname ]; then
rm -rf $_fname
fi
done
}
# =========================================== #
prepare() {
cd "${srcdir}"
rm -rfpython-build-${CARCH} | true
cp -r "importlib_metadata-${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 setup.py pytest
}
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"
}