desktop/jupyter/PKGBUILD
Adrián Chaves Fernández e3db04c238 ipython 5.1.0, jupyter 4.1.1
2016-08-20 16:16:18 +02:00

137 lines
5.1 KiB
Bash

pkgbase=jupyter
pkgname=('jupyter' 'ipython2-notebook')
pkgver=4.1.1
pkgrel=1
pkgdesc="A language-agnostic web-based interactive shell/notebook server."
arch=('any')
url="http://jupyter.org/"
license=('BSD')
depends=('ipython3>4.0.0' 'python3-ipykernel' 'python3-setuptools'
'python3-jinja' 'python3-pyzmq' 'python3-tornado' 'python3-jsonschema'
'python3-terminado' 'python3-mistune' 'python3-pygments')
makedepends=('python3-setuptools' 'python2-setuptools' 'npm' 'git')
optdepends=('qt5-svg: jupyter-qtconsole'
'python3-pyqt5: jupyter-qtconsole'
'python3-sip: jupyter-qtconsole')
# some of these will update rapidly, others never
# so _vers will be phased in as new updates are released
_ipywv=5.2.2 # ipywidgets
_qtcv=4.2.1 # qtconsole
_notev=4.2.2 # notebook
_nbcv=4.2.0
_jnbfv=4.1.0
_jconv=5.0.0 # jupyter_console
_jcliv=4.3.0
_pyver=3.5
source=("jupyter_core.tgz::https://github.com/jupyter/jupyter_core/archive/$pkgver.tar.gz"
"ipywidgets.tgz::https://github.com/ipython/ipywidgets/archive/$_ipywv.tar.gz"
"nbformat.tar.gz::https://github.com/jupyter/nbformat/archive/$_jnbfv.tar.gz"
"jupyter_console.tgz::https://github.com/jupyter/jupyter_console/archive/$_jconv.tar.gz"
"jupyter_client.tgz::https://github.com/jupyter/jupyter_client/archive/$_jcliv.tar.gz"
"notebook.tgz::https://github.com/jupyter/notebook/archive/$_notev.tar.gz"
"https://pypi.python.org/packages/source/q/qtconsole/qtconsole-$_qtcv.tar.gz")
sha1sums=('28995f6d0e1167b00dbf7365896b002c44d72935'
'a4e18ed6a91bca345ee074af8d77b2bebc4a1e96'
'378c57a9e89fcd3e76e7a3446d41343168d77f59'
'60cbc801c72cd42370a962a26c29c996734d7822'
'b7bab44679feb4f85c996333273a3f1abee0e1e5'
'2c4ae1adb5b8087a64c80ab3727e11d9709e43ca'
'4a0ea706c88721e3c6d2cfeb46fcf10c9bd1b4dc')
prepare() {
cd "$srcdir"
cp -r jupyter_core-$pkgver python2-jupyter_core-$pkgver
cp -r jupyter_client-$_jcliv python2-jupyter_client-$_jcliv
# cp -r ipykernel-$_ipykv python2-ipykernel-$_ipykv
cp -r qtconsole-$_qtcv python2-qtconsole-$_qtcv
}
build() {
cd "$srcdir"
# FS45999 disable bundled mathjax
cd "$srcdir/notebook-$_notev"
#sed -i 's/^.*MathJax.*$//' bower.json
#sed -i '/Trim mathjax/,/^ static_data.append/d' setupbase.py
#sed -i 's/mj(/#mj(/' setupbase.py
# needs node, downloads a lot of stuff
python3 setup.py build
cd "$srcdir/ipywidgets-$_ipywv"
# needs node, downloads a lot of stuff
python3 setup.py build
}
package_jupyter() {
provides=('ipython3-notebook')
replaces=('ipython3-notebook')
cd "$srcdir/jupyter_core-$pkgver"
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
# cd "$srcdir/ipykernel-$_ipykv"
# this is in the ipython package
# python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
cd "$srcdir/ipywidgets-$_ipywv"
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
cd "$srcdir/notebook-$_notev"
# needs node
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
# FS45999 use system mathjax
ln -s /usr/share/mathjax \
"$pkgdir/usr/lib/python$_pyver/site-packages/notebook/static/components/MathJax"
cd "$srcdir/nbformat-$_jnbfv"
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
cd "$srcdir/jupyter_console-$_jconv"
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
cd "$srcdir/jupyter_client-$_jcliv"
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
cd "$srcdir/qtconsole-$_qtcv"
python3 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
install -Dm644 examples/jupyter-qtconsole.desktop "$pkgdir/usr/share/applications/org.ipython.qtconsole.desktop"
sed -i s!gnome-netstatus-idle!JupyterConsole! \
"$pkgdir/usr/share/applications/org.ipython.qtconsole.desktop"
install -D $pkgdir/usr/lib/python$_pyver/site-packages/qtconsole/resources/icon/JupyterConsole.svg $pkgdir/usr/share/pixmaps/JupyterConsole.svg
# LICENSE
cd "$srcdir"
install -Dm644 "jupyter_core-$pkgver/COPYING.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
package_ipython2-notebook() {
pkgdesc="An enhanced Interactive Python2 shell."
depends=('ipython2>4.0.0' 'python2-ipykernel' 'python2-pyzmq')
optdepends=('python2-pyqt5: jupyter-qtconsole-py2'
'qt5-svg: jupyter-qtconsole-py2'
'python2-sip: jupyter-qtconsole-py2')
# cd "$srcdir/python2-ipykernel-$_ipykv"
# python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
cd "$srcdir/python2-jupyter_core-$pkgver"
python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
cd "$srcdir/python2-jupyter_client-$_jcliv"
python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
cd "$srcdir/python2-qtconsole-$_qtcv"
python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=0
cd "$pkgdir/usr/bin"
rm jupyter
rm jupyter-kernelspec
rm jupyter-migrate
mv jupyter-qtconsole jupyter-qtconsole-py2
cd "$srcdir"
install -Dm644 "jupyter_core-$pkgver/COPYING.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}