Files
MINGW-packages/mingw-w64-python-atomicwrites/PKGBUILD
2019-12-17 13:38:25 +03:00

66 lines
1.9 KiB
Bash

# Contributor: Christoph Reiter <reiter.christoph@gmail.com>
_realname=atomicwrites
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=1.3.0
pkgrel=3
pkgdesc="Atomic file writes on POSIX (mingw-w64)"
url="https://github.com/untitaker/python-atomicwrites"
license=('MIT')
arch=('any')
depends=("${MINGW_PACKAGE_PREFIX}-python3")
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-setuptools")
checkdepends=("${MINGW_PACKAGE_PREFIX}-python3-pathlib2")
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/untitaker/python-atomicwrites/archive/${pkgver}.tar.gz")
sha256sums=('e286509543a26777e8cb862c9373e89c31f66fe38066d0df7f678d00a97615cd')
# 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 python3-build-${CARCH} | true
cp -r "python-${_realname}-${pkgver}" "python3-build-${CARCH}"
# Set version for setuptools_scm
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
}
build() {
cd "${srcdir}/python3-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python3 setup.py build
}
check() {
msg "Python 3 test for ${CARCH}"
cd "${srcdir}/python3-build-${CARCH}"
PYTHONPATH=build:${PYTHONPATH} ${MINGW_PREFIX}/bin/py.test
}
package() {
cd "${srcdir}/python3-build-${CARCH}"
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
${MINGW_PREFIX}/bin/python3 setup.py install --prefix=${MINGW_PREFIX} \
--root="${pkgdir}" --optimize=1 --skip-build
install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/COPYING"
}