summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0f2b76289e687e3b957e360543e6df9388763233 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Maintainer: Debucquoy Anthony (tonitch) <d.tonitch@gmail.com>

pkgbase=jpterm
pkgname=('jpterm' 'python-txl')
pkgver=0.2.12
pkgrel=1
url="https://davidbrochart.github.io/jpterm/"
license=('MIT')
arch=('any')
depends=('python>=3.10' 'python-rich-click' 'python-asphalt' 'python-asyncio_extras' 'jupyterlab>=4' 'jupyter-collaboration>=2')
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel' 'python-hatchling')
source=("$pkgbase-$pkgver.tar.gz::https://github.com/davidbrochart/$pkgbase/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('d7c8863db4004c721a8334e49055b4ce6f3af970ab98e346723eb6ed1cf6dc71')

_plugins=(
	"cell"     "editors"       "image_viewer"  "kernel"    "local_contents"  "local_terminals"  "notebook_editor"  "remote_contents"  "remote_terminals"  "text_editor"  "widgets"
	"console"  "file_browser"  "jpterm"        "launcher"  "local_kernels"   "markdown_viewer"  "notebook_viewer"  "remote_kernels"   "terminal"          "text_viewer"
)

build() {
	cd "$pkgbase-$pkgver"
	python -m build --wheel --no-isolation

	cd txl
	python -m build --wheel --no-isolation

	cd ../plugins
	for plugin in "${_plugins[@]}"; do
		cd $plugin
		python -m build --wheel --no-isolation
		cd ..
	done
}

package_jpterm() {
	pkgdesc="Jupyter in the terminal."
	depends=("python-txl=$pkgver")

	cd "$pkgbase-$pkgver"
	install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
	python -m installer --destdir="$pkgdir/" dist/*.whl
}

package_python-txl() {
	pkgdesc="The plugin system for jpterm"
	depends=('python-asphalt' 'python-textual' 'python-pycrdt' 'python-jupyter-ydoc' 'python-pycrdt' 'python-anyio' 'python-textual_imageview' 'python-ypywidgets_textual')

	cd "$pkgbase-$pkgver"/txl
	install -Dm 644 LICENSE.txt "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
	python -m installer --destdir="$pkgdir/" dist/*.whl

	cd ../plugins
	for plugin in "${_plugins[@]}"; do
		cd $plugin
		python -m installer --destdir="\$pkgdir/" dist/*.whl
		cd ..
	done

}