143 lines
5.0 KiB
Bash
143 lines
5.0 KiB
Bash
# Maintainer: Andrew Sun <adsun701@gmail.com>
|
|
|
|
_realname=tox
|
|
pkgbase=mingw-w64-python-${_realname}
|
|
pkgname=("${MINGW_PACKAGE_PREFIX}-python2-${_realname}" "${MINGW_PACKAGE_PREFIX}-python3-${_realname}")
|
|
pkgver=3.6.1
|
|
pkgrel=1
|
|
pkgdesc="Python virtualenv management and testing tool (mingw-w64)"
|
|
arch=('any')
|
|
url="https://tox.readthedocs.io"
|
|
license=('GPL2')
|
|
makedepends=("${MINGW_PACKAGE_PREFIX}-python2"
|
|
"${MINGW_PACKAGE_PREFIX}-python3"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-setuptools-scm"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-setuptools-scm"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-filelock"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-filelock"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-toml"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-toml"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-py"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-py"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-six"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-six"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-virtualenv"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-virtualenv"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-pluggy"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-pluggy"
|
|
"util-linux")
|
|
options=('staticlibs' 'strip' '!debug')
|
|
source=("${_realname}-${pkgver}.tar.gz"::"https://pypi.io/packages/source/t/tox/${_realname}-${pkgver}.tar.gz")
|
|
sha256sums=('2a8d8a63660563e41e64e3b5b677e81ce1ffa5e2a93c2c565d3768c287445800')
|
|
|
|
prepare() {
|
|
find ${_realname}-${pkgver} -name "*.pyc" -delete
|
|
|
|
for builddir in python{2,3}-build-${CARCH}; do
|
|
rm -rf ${builddir} | true
|
|
cp -r "${_realname}-${pkgver}" "${builddir}"
|
|
done
|
|
}
|
|
|
|
build() {
|
|
for pver in {2,3}; do
|
|
msg "Python ${pver} build for ${CARCH}"
|
|
cd "${srcdir}/python${pver}-build-${CARCH}"
|
|
${MINGW_PREFIX}/bin/python${pver} setup.py build
|
|
done
|
|
}
|
|
|
|
#This hangs when I try this.
|
|
#check() {
|
|
# (
|
|
# cd "${srcdir}/python2-build-${CARCH}"
|
|
# msg "Python 2 build for ${CARCH}"
|
|
# ${MINGW_PREFIX}/bin/virtualenv2 "$srcdir/pyvenv-py2" --system-site-packages
|
|
# . "$srcdir/pyvenv-py2/bin/activate"
|
|
# ${MINGW_PREFIX}/bin/python setup.py install
|
|
# ${MINGW_PREFIX}/bin/python setup.py pytest
|
|
# )
|
|
#
|
|
#(
|
|
# cd "${srcdir}/python3-build-${CARCH}"
|
|
# msg "Python 3 build for ${CARCH}"
|
|
# ${MINGW_PREFIX}/bin/virtualenv "$srcdir/pyvenv" --system-site-packages
|
|
# . "$srcdir/pyvenv/bin/activate"
|
|
# ${MINGW_PREFIX}/bin/python3 setup.py install
|
|
# ${MINGW_PREFIX}/bin/python3 setup.py pytest
|
|
# )
|
|
#
|
|
#}
|
|
|
|
package_python3-tox() {
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python3"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-py"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-six"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-virtualenv"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-setuptools-scm"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-filelock"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-toml"
|
|
"${MINGW_PACKAGE_PREFIX}-python3-pluggy")
|
|
install=${_realname}3-${CARCH}.install
|
|
|
|
cd "${srcdir}/python3-build-${CARCH}"
|
|
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}/COPYING"
|
|
|
|
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
|
|
# fix python command in files
|
|
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do
|
|
sed -e "s|${PREFIX_WIN}/bin/|${MINGW_PREFIX}/bin/|g" -i ${_f}
|
|
done
|
|
}
|
|
|
|
package_python2-tox() {
|
|
depends=("${MINGW_PACKAGE_PREFIX}-python2"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-py"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-six"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-virtualenv"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-setuptools"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-setuptools-scm"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-filelock"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-toml"
|
|
"${MINGW_PACKAGE_PREFIX}-python2-pluggy")
|
|
install=${_realname}2-${CARCH}.install
|
|
|
|
cd "${srcdir}/python2-build-${CARCH}"
|
|
MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
|
|
${MINGW_PREFIX}/bin/python2 setup.py install --prefix=${MINGW_PREFIX} \
|
|
--root="${pkgdir}" --optimize=1 --skip-build
|
|
|
|
install -Dm644 LICENSE "${pkgdir}${MINGW_PREFIX}/share/licenses/python2-${_realname}/COPYING"
|
|
|
|
local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
|
|
# fix python command in files
|
|
for _f in "${pkgdir}${MINGW_PREFIX}"/bin/*.py; do
|
|
sed -e "s|${PREFIX_WIN}/bin/|${MINGW_PREFIX}/bin/|g" -i ${_f}
|
|
done
|
|
|
|
rename -v "tox" "tox2" "${pkgdir}${MINGW_PREFIX}"/bin/*
|
|
}
|
|
|
|
package_mingw-w64-i686-python2-tox() {
|
|
package_python2-tox
|
|
}
|
|
|
|
package_mingw-w64-i686-python3-tox() {
|
|
package_python3-tox
|
|
}
|
|
|
|
package_mingw-w64-x86_64-python2-tox() {
|
|
package_python2-tox
|
|
}
|
|
|
|
package_mingw-w64-x86_64-python3-tox() {
|
|
package_python3-tox
|
|
}
|