78 lines
2.6 KiB
Bash
78 lines
2.6 KiB
Bash
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
|
|
|
|
_realname=cmd2
|
|
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=2.4.3
|
|
pkgrel=2
|
|
pkgdesc="Extra features for standard library's cmd module (mingw-w64)"
|
|
arch=('any')
|
|
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32' 'clangarm64')
|
|
url='https://github.com/python-cmd2/cmd2'
|
|
license=('MIT')
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python-attrs"
|
|
"${MINGW_PACKAGE_PREFIX}-python-pyperclip"
|
|
"${MINGW_PACKAGE_PREFIX}-python-typing_extensions"
|
|
"${MINGW_PACKAGE_PREFIX}-python-pyreadline3"
|
|
"${MINGW_PACKAGE_PREFIX}-python-wcwidth")
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-python-setuptools-scm")
|
|
checkdepends=("${MINGW_PACKAGE_PREFIX}-python-pytest-runner"
|
|
"${MINGW_PACKAGE_PREFIX}-python-pytest-xdist"
|
|
"${MINGW_PACKAGE_PREFIX}-python-mock")
|
|
options=('staticlibs' 'strip' '!debug')
|
|
source=("${_realname}-${pkgver}.tar.gz::https://github.com/python-cmd2/cmd2/archive/${pkgver}.tar.gz")
|
|
sha512sums=('4add072949ba88c7ebd8e26c9c91374543f486763c710b1a2c8a6cfdae46c97b39cafd8a424d71bcc40e20161956d8ac1580075049cd57cc4c01128fb2d3683d')
|
|
|
|
# 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 "${_realname}-${pkgver}" "python-build-${MSYSTEM}"
|
|
# Set version for setuptools_scm
|
|
export SETUPTOOLS_SCM_PRETEND_VERSION=${pkgver}
|
|
export PBR_VERSION=${pkgver}
|
|
}
|
|
|
|
build() {
|
|
msg "Python build for ${MSYSTEM}"
|
|
cd "${srcdir}/python-build-${MSYSTEM}"
|
|
${MINGW_PREFIX}/bin/python setup.py build
|
|
}
|
|
|
|
check() {
|
|
msg "Python test for ${MSYSTEM}"
|
|
cd "${srcdir}/python-build-${MSYSTEM}"
|
|
${MINGW_PREFIX}/bin/python setup.py pytest || true
|
|
}
|
|
|
|
package() {
|
|
cd "${srcdir}/python-build-${MSYSTEM}"
|
|
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"
|
|
}
|