# Maintainer: Erich Eckner # Contributor: Leonid B # Upstream contact: silx at esrf dot fr pkgbase=python-pyfai pkgname=(python2-pyfai python-pyfai) _pkgname=pyFAI pkgver=0.18.0 pkgrel=2 pkgdesc="Fast Azimuthal Integration in Python." arch=('i686' 'pentium4' 'x86_64') url="http://www.silx.org" license=('GPLv3' 'BSD' 'MIT') _deppy2=( 'python2>=2.7' 'python2<2.8' ) _deppy=( 'python>=3.7' 'python<3.8' ) _depends=( 'python-bash_kernel' 'cython' 'python-fabio' 'python-h5py' 'python-matplotlib' 'python-numexpr' 'python-numpy' 'python-pyfai' 'python-scipy' 'python-silx') _makedepends=( 'cython' 'python-setuptools') _optdepends=() source=("${_pkgname}-${pkgver}.tar.gz::https://github.com/silx-kit/${_pkgname}/archive/v${pkgver}.tar.gz") sha512sums=('046b7c7830b7e95b2a974133dfb17c442691255689ef250141c9435d3aa07970f9221d4f10425bde3a3eb79110da659c8e518b478855397c6df5ef4a9c877d8d') makedepends=( "${_deppy[@]}" "${_deppy2[@]}" "${_depends[@]}" "${_depends[@]//python/python2}" "${_makedepends[@]}" "${_makedepends[@]//ython/ython2}" ) prepare() { cp -r "${_pkgname}-${pkgver}" "py2-${_pkgname}-${pkgver}" mv "${_pkgname}-${pkgver}" "py-${_pkgname}-${pkgver}" } build() { cd "${srcdir}/py2-${_pkgname}-${pkgver}" python2 setup.py build cd "${srcdir}/py-${_pkgname}-${pkgver}" python setup.py build } package_python2-pyfai() { depends=( "${_deppy2[@]}" "${_depends[@]//python/python2}" 'python2-ipympl' ) optdepends=( "${_optdepends[@]//python/python2}" ) cd "${srcdir}/py2-${_pkgname}-${pkgver}" python2 setup.py install --root="${pkgdir}/" --optimize=1 install -D LICENSES.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" install -D copyright "${pkgdir}/usr/share/licenses/${pkgname}/COPYRIGHT" find "${pkgdir}/usr/bin" -maxdepth 1 -type f -printf '%f\n' | \ while read -r f; do mv "${pkgdir}/usr/bin/${f}" "${pkgdir}/usr/bin/python2-${f}" sed -i '1 s/python/python2/' "${pkgdir}/usr/bin/python2-${f}" done } package_python-pyfai() { depends=( "${_deppy[@]}" "${_depends[@]}" 'python-ipympl' ) optdepends=( "${_optdepends[@]}" ) cd "${srcdir}/py-${_pkgname}-${pkgver}" python setup.py install --root="${pkgdir}/" --optimize=1 install -D LICENSES.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" install -D copyright "${pkgdir}/usr/share/licenses/${pkgname}/COPYRIGHT" }