diff options
author | goekce | 2021-04-05 21:51:07 +0200 |
---|---|---|
committer | goekce | 2021-04-05 21:51:07 +0200 |
commit | 52d4d58cbeb4556b1649499ac815e9c691b43e3e (patch) | |
tree | 9656fc6034db3f68798253a0ac84048cb1ac9ad3 | |
parent | ba1449e4f02233a5929b07f7fafd675ffdf2043e (diff) | |
download | aur-52d4d58cbeb4556b1649499ac815e9c691b43e3e.tar.gz |
deploy prebuilt extension directly
This allows ditching the install file. Thanks @mdeff
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 22 | ||||
-rw-r--r-- | python-ipycanvas.install | 21 |
3 files changed, 20 insertions, 30 deletions
@@ -1,9 +1,8 @@ pkgbase = python-ipycanvas-git pkgdesc = Interactive widgets library exposing the browser's Canvas API - pkgver = r297.0cc98b4 - pkgrel = 2 + pkgver = r329.30ccca2 + pkgrel = 1 url = https://github.com/martinRenou/ipycanvas - install = python-ipycanvas.install arch = any license = BSD makedepends = git @@ -11,12 +10,12 @@ pkgbase = python-ipycanvas-git makedepends = python-jupyter_packaging depends = python depends = python-setuptools - depends = python-ipywidgets depends = python-pillow depends = python-numpy depends = python-orjson depends = jupyter depends = jupyterlab + depends = jupyterlab-widgets provides = python-ipycanvas source = git+https://github.com/martinRenou/ipycanvas md5sums = SKIP @@ -2,8 +2,8 @@ _py=ipycanvas pkgname=python-$_py-git provides=("${pkgname%-git}") -pkgver=r297.0cc98b4 -pkgrel=2 +pkgver=r329.30ccca2 +pkgrel=1 pkgdesc="Interactive widgets library exposing the browser's Canvas API" arch=(any) url="https://github.com/martinRenou/ipycanvas" @@ -11,12 +11,12 @@ license=(BSD) depends=( python python-setuptools - python-ipywidgets python-pillow python-numpy python-orjson jupyter jupyterlab + jupyterlab-widgets ) makedepends=( git @@ -35,7 +35,19 @@ build() { } package() { cd $_py - python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 --skip-build + #python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 --skip-build + 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 "$pkgdir"/usr/lib/python*/site-packages/ipycanvas/labextension $prebuilt_extension_dir_lab/$_py + + # for classic interface + prebuilt_extension_dir_classic="$pkgdir"/usr/share/jupyter/nbextensions + mkdir -p $prebuilt_extension_dir_classic + ln -s "$pkgdir"/usr/lib/python*/site-packages/ipycanvas/nbextension $prebuilt_extension_dir_classic/$_py + install -Dm644 $(find LICENSE*|head -1) "$pkgdir/usr/share/licenses/$pkgname/LICENSE" } -install=${pkgname%-git}.install diff --git a/python-ipycanvas.install b/python-ipycanvas.install deleted file mode 100644 index c0db25a7326f..000000000000 --- a/python-ipycanvas.install +++ /dev/null @@ -1,21 +0,0 @@ -post_install() { - echo 'Installing the extension in Jupyterlab:' - jupyter labextension install @jupyter-widgets/jupyterlab-manager ipycanvas - echo 'Installing and enabling the extension in Jupyter notebook (tree):' - jupyter nbextension install --system --py ipycanvas - jupyter nbextension enable --system --py ipycanvas - echo 'Please restart the Jupyter servers to load the new extension' -} - -pre_remove() { - echo 'Uninstalling the extension in Jupyterlab:' - jupyter labextension uninstall @jupyter-widgets/jupyterlab-manager ipycanvas - echo 'Uninstalling and disabling the extension in Jupyter notebook (tree):' - jupyter nbextension disable --system --py ipycanvas - jupyter nbextension uninstall --system --py ipycanvas -} - -post_upgrade() { - pre_remove - post_install -} |