78 lines
2.5 KiB
Bash
78 lines
2.5 KiB
Bash
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
|
|
# Maintainer: Naveen M K <naveen521kk@gmail.com>
|
|
|
|
_realname=importlib-metadata
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}")
|
|
pkgver=6.8.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' 'clangarm64')
|
|
msys2_references=(
|
|
'pypi: importlib-metadata'
|
|
)
|
|
url='https://importlib-metadata.readthedocs.io/'
|
|
license=('spdx:Apache-2.0')
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python"
|
|
"${MINGW_PACKAGE_PREFIX}-python-zipp")
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
|
|
"${MINGW_PACKAGE_PREFIX}-python-setuptools-scm"
|
|
"${MINGW_PACKAGE_PREFIX}-python-installer"
|
|
"${MINGW_PACKAGE_PREFIX}-python-wheel")
|
|
checkdepends=("${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=('dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743')
|
|
|
|
# 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 -rf python-build-${MSYSTEM} | true
|
|
cp -r "importlib_metadata-${pkgver}" "python-build-${MSYSTEM}"
|
|
# Set version for setuptools_scm
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
|
|
}
|
|
|
|
build() {
|
|
msg "Python build for ${MSYSTEM}"
|
|
cd "${srcdir}/python-build-${MSYSTEM}"
|
|
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
|
|
}
|
|
|
|
check() {
|
|
msg "Python test for ${MSYSTEM}"
|
|
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 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE"
|
|
}
|