desktop/python-ipykernel/PKGBUILD

40 lines
1.3 KiB
Bash

pkgbase=python-ipykernel
pkgname=('python3-ipykernel' 'python2-ipykernel')
pkgver=4.3.1
pkgrel=1
pkgdesc="The ipython kernel for Jupyter"
arch=('any')
url="https://pypi.python.org/pypi/ipykernel"
license=('BSD')
depends=('python3')
makedepends=('python3' 'python2')
source=("ipykernel-$pkgver.tgz::https://github.com/ipython/ipykernel/archive/$pkgver.tar.gz")
sha1sums=('260a6eb67cded6916484deaaad6193a60483e29b')
prepare() {
cd "$srcdir"
cp -r ipykernel-$pkgver python2-ipykernel-$pkgver
}
package_python3-ipykernel() {
cd "$srcdir/ipykernel-$pkgver"
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
cd "$srcdir"
install -Dm644 "ipykernel-$pkgver/COPYING.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
package_python2-ipykernel() {
depends=('python2')
cd "$srcdir/python2-ipykernel-$pkgver"
python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
cd "$srcdir"
install -d "$pkgdir/usr/share/jupyter/kernels/python2"
echo '{"display_name": "Python 2", "language": "python2", "argv": ["python2", "-c", "from IPython.kernel.zmq.kernelapp import main; main()", "-f", "{connection_file}"],"codemirror_mode": {"version": 2, "name": "ipython2"}}' > "$pkgdir/usr/share/jupyter/kernels/python2/kernel.json"
install -Dm644 "ipykernel-$pkgver/COPYING.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}