Files
MINGW-packages/mingw-w64-python-sqlalchemy-migrate/PKGBUILD
2019-12-06 15:01:18 +01:00

74 lines
2.7 KiB
Bash

# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
_realname=sqlalchemy-migrate
pkgbase=mingw-w64-python-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
pkgver=0.13.0
pkgrel=2
pkgdesc="Database schema migration for SQLAlchemy (mingw-w64)"
arch=('any')
url='https://pypi.python.org/pypi/sqlalchemy-migrate'
license=('Apache')
depends=("${MINGW_PACKAGE_PREFIX}-python3"
"${MINGW_PACKAGE_PREFIX}-python3-six"
"${MINGW_PACKAGE_PREFIX}-python3-pbr"
"${MINGW_PACKAGE_PREFIX}-python3-sqlalchemy"
"${MINGW_PACKAGE_PREFIX}-python3-decorator"
"${MINGW_PACKAGE_PREFIX}-python3-sqlparse"
"${MINGW_PACKAGE_PREFIX}-python3-tempita")
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-setuptools")
#checkdepends=("${MINGW_PACKAGE_PREFIX}-python3-mock"
# "${MINGW_PACKAGE_PREFIX}-python3-testrepository"
# "${MINGW_PACKAGE_PREFIX}-python3-scripttest"
# "${MINGW_PACKAGE_PREFIX}-python3-ibm-db-sa"
# "${MINGW_PACKAGE_PREFIX}-mysql-python")
options=('staticlibs' 'strip' '!debug')
source=(#"${_realname}-${pkgver}.tar.gz"::"https://github.com/openstack/sqlalchemy-migrate/archive/${pkgver}.tar.gz"
https://files.pythonhosted.org/packages/36/bb/40f66b12b18fb03da76dcee31df75cca9e54b71d9d8a784bb95bfbadee2c/${_realname}-${pkgver}.tar.gz)
sha512sums=('1ca826a5d80c1373ffc4b2366dfb6d5dd24204964462873451c97d8ff4d75fc6c63f663c4769b7f6cc00002f6a98d425f41d759e5c010b4b81a8b74ffbb102b6')
prepare() {
cd "${srcdir}/${_realname}-${pkgver}"
# Set version for setuptools_scm
export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
export PBR_VERSION=$pkgver
}
build() {
cd "${srcdir}/${_realname}-${pkgver}"
${MINGW_PREFIX}/bin/python3 setup.py build
}
#check() {
# cd "${srcdir}/${_realname}-${pkgver}"
#
# ${MINGW_PREFIX}/bin/python3 setup.py testr || warning "Tests failed"
#}
package() {
#This package install is needed for .fixups with .EXE's
#in the bit directory. The install files "python-exe-installs"
#and should be renamed to your _realname .
install=${_realname}3-${CARCH}.install
cd "${srcdir}/${_realname}-${pkgver}"
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
# This entire section should be removed if the package does NOT install
# anything in the /mingw*/bin directory.
### begin section ###
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
# fix python command in files
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do
sed -e "s|/usr/bin/env |${MINGW_PREFIX}|g" \
-e "s|${PREFIX_WIN}|${MINGW_PREFIX}|g" -i ${_f}
done
#### end section ####
}