Files
MINGW-packages/mingw-w64-python-contextlib2/PKGBUILD
2023-09-17 21:57:36 +02:00

47 lines
1.7 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Maintainer: Christoph Reiter <reiter.christoph@gmail.com>
#
_realname=contextlib2
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=21.6.0
pkgrel=3
pkgdesc="contextlib2 is a backport of the standard librarys contextlib module to earlier Python versions (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
msys2_references=(
'pypi: contextlib2'
)
url="https://pypi.python.org/pypi/${_pypiname}"
license=('PSF')
depends=("${MINGW_PACKAGE_PREFIX}-python")
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools")
source=("https://pypi.io/packages/source/${_realname:0:1}/${_realname}/${_realname}-${pkgver}.tar.gz")
sha512sums=('a85cafaaf66c7c6a59a4e9ac757941b1a98c17e5a49e41573dc759fafbbf17928a21f582e8aaa0fdc60636413ec702e198bde19a78ac304237b6da1c3d47b730')
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}
export PBR_VERSION=${pkgver}
}
build() {
msg "Python build for ${CARCH}"
cd "${srcdir}/python-build-${CARCH}"
${MINGW_PREFIX}/bin/python setup.py build
}
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}" --skip-build
install -Dm644 LICENSE.txt "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE.txt"
}