87 lines
3.2 KiB
Bash
87 lines
3.2 KiB
Bash
# Maintainer: Konstantin Podsvirov <konstantin@podsvirov.su>
|
|
|
|
_realname=flask-wtf
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}"
|
|
"${MINGW_PACKAGE_PREFIX}-python-${_realname}-docs")
|
|
pkgver=1.2.2
|
|
pkgrel=1
|
|
pkgdesc='Simple integration of Flask and WTForms (mingw-w64)'
|
|
arch=('any')
|
|
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
|
url='https://github.com/wtforms/flask-wtf'
|
|
msys2_references=(
|
|
'purl: pkg:pypi/flask-wtf'
|
|
)
|
|
license=('spdx:BSD-3-Clause')
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python"
|
|
"${MINGW_PACKAGE_PREFIX}-python-flask"
|
|
"${MINGW_PACKAGE_PREFIX}-python-flask-babel"
|
|
"${MINGW_PACKAGE_PREFIX}-python-wtforms"
|
|
"${MINGW_PACKAGE_PREFIX}-python-werkzeug")
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
|
|
"${MINGW_PACKAGE_PREFIX}-python-installer"
|
|
"${MINGW_PACKAGE_PREFIX}-python-hatchling"
|
|
"${MINGW_PACKAGE_PREFIX}-python-pallets-sphinx-themes"
|
|
"${MINGW_PACKAGE_PREFIX}-python-sphinx"
|
|
"${MINGW_PACKAGE_PREFIX}-python-sphinx-issues"
|
|
"${MINGW_PACKAGE_PREFIX}-python-sphinxcontrib-log-cabinet")
|
|
optdepends=("${MINGW_PACKAGE_PREFIX}-python-email-validator: for email validation")
|
|
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_realname/-/_}-${pkgver}.tar.gz")
|
|
sha256sums=('79d2ee1e436cf570bccb7d916533fa18757a2f18c290accffab1b9a0b684666b')
|
|
|
|
prepare() {
|
|
rm -rf "python-build-${MSYSTEM}" | true
|
|
cp -r "${_realname/-/_}-${pkgver}" "python-build-${MSYSTEM}"
|
|
|
|
rm -rf "python-install-${MSYSTEM}" | true
|
|
}
|
|
|
|
build() {
|
|
msg "Python build for ${MSYSTEM}"
|
|
cd "${srcdir}/python-build-${MSYSTEM}"
|
|
|
|
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
|
|
|
|
# Forward installation for building documentation
|
|
_pkgdir="${srcdir}/python-install-${MSYSTEM}"
|
|
MSYS2_ARG_CONV_EXCL="--prefix=" \
|
|
"${MINGW_PREFIX}"/bin/python -m installer --prefix=${MINGW_PREFIX} \
|
|
--destdir="${_pkgdir}" dist/*.whl
|
|
|
|
msg "Build documentation"
|
|
cd "${srcdir}/python-build-${MSYSTEM}/docs"
|
|
_pyver=$("${MINGW_PREFIX}"/bin/python -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}')")
|
|
PYTHONPATH="${_pkgdir}${MINGW_PREFIX}/lib/python${_pyver}/site-packages" \
|
|
"${MINGW_PREFIX}"/bin/sphinx-build -M html . _build
|
|
}
|
|
|
|
package_python-flask-wtf() {
|
|
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.rst "${pkgdir}${MINGW_PREFIX}/share/licenses/python-${_realname}/LICENSE.rst"
|
|
}
|
|
|
|
package_python-flask-wtf-docs() {
|
|
pkgdesc+=" (documentation)"
|
|
depends=()
|
|
|
|
mkdir -p "${pkgdir}${MINGW_PREFIX}/share/doc/python-${_realname}"
|
|
cp -a "${srcdir}/python-build-${MSYSTEM}/docs/_build/html" "${pkgdir}${MINGW_PREFIX}/share/doc/python-${_realname}/html"
|
|
}
|
|
|
|
# template start; name=mingw-w64-splitpkg-wrappers; version=1.0;
|
|
# vim: set ft=bash :
|
|
|
|
# generate wrappers
|
|
for _name in "${pkgname[@]}"; do
|
|
_short="package_${_name#${MINGW_PACKAGE_PREFIX}-}"
|
|
_func="$(declare -f "${_short}")"
|
|
eval "${_func/#${_short}/package_${_name}}"
|
|
done
|
|
# template end;
|