75 lines
2.6 KiB
Bash
75 lines
2.6 KiB
Bash
# Maintainer: Konstantin Podsvirov <konstantin@podsvirov.su>
|
|
|
|
_pyname=flask_migrate
|
|
_realname=${_pyname/_/-}
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}"
|
|
"${MINGW_PACKAGE_PREFIX}-python-${_realname}-docs")
|
|
pkgver=4.1.0
|
|
pkgrel=1
|
|
pkgdesc='SQLAlchemy database migrations for Flask applications using Alembic (mingw-w64)'
|
|
arch=('any')
|
|
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
|
|
url='http://flask-migrate.readthedocs.io/'
|
|
msys2_repository_url='https://github.com/miguelgrinberg/Flask-Migrate'
|
|
msys2_references=(
|
|
'purl: pkg:pypi/flask-migrate'
|
|
)
|
|
license=('spdx:MIT')
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python"
|
|
"${MINGW_PACKAGE_PREFIX}-python-alembic"
|
|
"${MINGW_PACKAGE_PREFIX}-python-flask"
|
|
"${MINGW_PACKAGE_PREFIX}-python-flask-sqlalchemy")
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build"
|
|
"${MINGW_PACKAGE_PREFIX}-python-installer"
|
|
"${MINGW_PACKAGE_PREFIX}-python-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-python-sphinx"
|
|
"${MINGW_PACKAGE_PREFIX}-python-sphinx-alabaster-theme")
|
|
source=("https://pypi.org/packages/source/${_realname::1}/${_realname}/${_pyname}-${pkgver}.tar.gz")
|
|
sha256sums=('1a336b06eb2c3ace005f5f2ded8641d534c18798d64061f6ff11f79e1434126d')
|
|
|
|
prepare() {
|
|
rm -rf "python-build-${MSYSTEM}" | true
|
|
cp -r "${_pyname}-${pkgver}" "python-build-${MSYSTEM}"
|
|
}
|
|
|
|
build() {
|
|
msg "Python build for ${MSYSTEM}"
|
|
cd "${srcdir}/python-build-${MSYSTEM}"
|
|
|
|
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation
|
|
|
|
msg "Build documentation"
|
|
cd "${srcdir}/python-build-${MSYSTEM}/docs"
|
|
"${MINGW_PREFIX}"/bin/sphinx-build -M html . _build
|
|
}
|
|
|
|
package_python-flask-migrate() {
|
|
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"
|
|
}
|
|
|
|
package_python-flask-migrate-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;
|