61 lines
1.9 KiB
Bash
61 lines
1.9 KiB
Bash
# Maintainer: J. Peter Mugaas <jpmugaas@suddenlink.net>
|
|
|
|
_realname=sqlparse
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
pkgver=0.3.0
|
|
pkgrel=2
|
|
pkgdesc="Non-validating SQL parser for Python (mingw-w64)"
|
|
arch=('any')
|
|
url='https://github.com/andialbrecht/sqlparse'
|
|
license=('BSD')
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python3")
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python3-setuptools")
|
|
options=('staticlibs' 'strip' '!debug')
|
|
source=("${_realname}-$pkgver.tar.gz::https://github.com/andialbrecht/sqlparse/archive/${pkgver}.tar.gz")
|
|
sha256sums=('a75fddae009fba1d66786203c9dd3a842aa4415475c466d15484139117108474')
|
|
|
|
prepare() {
|
|
cd "${srcdir}/${_realname}-${pkgver}"
|
|
|
|
# Set version for setuptools_scm
|
|
export SETUPTOOLS_SCM_PRETEND_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 test
|
|
}
|
|
|
|
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
|
|
|
|
install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python3-${_realname}/LICENSE"
|
|
|
|
# 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 ####
|
|
}
|