# Maintainer: Erich Eckner # Contributor: Philip Goto pkgname=python-ipympl _pkgname="${pkgname#*-}" pkgver=0.8.7 pkgrel=1 pkgdesc="Matplotlib Jupyter Extension" url="https://pypi.org/project/ipympl/" depends=( 'python') makedepends=( 'jupyter' 'jupyterlab' 'jupyterlab_pygments' 'npm' 'python-setuptools' 'python-jupyter_packaging') license=('BSD') arch=(any) source=("https://pypi.python.org/packages/ab/78/fdbeed8afa9e9cd4c907c689cc8d507be7ffd7c50be3806545d85103eef1/${_pkgname}-${pkgver}.tar.gz") sha512sums=('9084bf9cde227b58c2e939d357db5ce37dc352d8907ff94f51c20699e3290d5f2b6c412a95ba9d2b2a405ff14ca2fed51d98918912de58fb05e6ea35a97cb93e') build() { cd "${_pkgname}-${pkgver}" python setup.py build } package() { cd "${_pkgname}-${pkgver}" py_ver=$(python --version | cut -d' ' -f2 | cut -d. -f1,2) python setup.py install --root="${pkgdir}" --optimize=1 --skip-build # install (and enable) extension according to # https://jupyterlab.readthedocs.io/en/latest/extension/extension_dev.html#distributing-a-prebuilt-extension prebuilt_extension_dir_lab="$pkgdir"/usr/share/jupyter/labextensions mkdir -p $prebuilt_extension_dir_lab ln -s /usr/lib/python${py_ver}/site-packages/ipympl/labextension "${prebuilt_extension_dir_lab}/jupyter-matplotlib" # for classic interface prebuilt_extension_dir_classic="$pkgdir"/usr/share/jupyter/nbextensions mkdir -p $prebuilt_extension_dir_classic ln -s /usr/lib/python${py_ver}/site-packages/ipympl/nbextension "${prebuilt_extension_dir_classic}/jupyter-matplotlib" install -D "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" }