desktop/python-sympy/PKGBUILD
2017-11-25 16:42:10 +01:00

59 lines
1.5 KiB
Bash

pkgbase=python-sympy
pkgname=('python2-sympy' 'python3-sympy')
pkgver=1.1.1
pkgrel=1
arch=('any')
pkgdesc='Symbolic manipulation package (Computer Algebra System), written in pure Python'
url='http://sympy.org/en/index.html'
license=('BSD')
makedepends=('python2-mpmath' 'python3-mpmath' 'python3-setuptools' 'python2-setuptools')
source=("https://github.com/sympy/sympy/archive/sympy-${pkgver}.tar.gz")
sha256sums=('4420a1e31939244d7ea73e164fdbb0d4a6a2e764d56e5bf632f57a988f13767f')
prepare() {
cp -a sympy-sympy-$pkgver{,-py2}
}
build() {
cd "$srcdir"/sympy-sympy-$pkgver
python2 setup.py build
cd "$srcdir"/sympy-sympy-$pkgver-py2
python3 setup.py build
}
check() {
cd "$srcdir"/sympy-sympy-$pkgver
python2 setup.py test
cd "$srcdir"/sympy-sympy-$pkgver-py2
python3 setup.py test
}
package_python2-sympy() {
depends=('python2-mpmath')
optdepends=('python2-pyglet: plotting'
'ipython2: user friendly interface for isympy')
cd sympy-sympy-$pkgver-py2
python2 setup.py install --root "${pkgdir}" --optimize=1
install -D -m644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}
package_python3-sympy() {
depends=('python3-mpmath')
optdepends=('ipython3: user friendly interface for isympy')
cd sympy-sympy-$pkgver
python3 setup.py install --root "${pkgdir}" --optimize=1
# rename files that exists in both 'python2-sympy' and 'python3-sympy'
mv "${pkgdir}"/usr/bin/isympy{,-py3}
mv "${pkgdir}"/usr/share/man/man1/isympy{,-py3}.1
install -D -m644 LICENSE "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE
}