summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 53d840b1aad6fa0ad02e8d1bbd6513b1496d234e (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
60
61
62
63
64
65
66
67
68
69
# Maintainer:  Luis Martinez <luis dot martinez at disroot dot org>
# Maintainer:  Dimitris Kiziridis <ragouel at outlook dot com>
# Contributor: Ronuk Raval <ronuk.raval at gmail dot com>
# Contributor: Narrat <autumn-wind at web dot de>
# Contributor: David Scholl <djscholl at gmail dot com>

pkgname=leo
pkgver=6.6.1
pkgrel=1
pkgdesc="Outliner, Editor, and Personal Information Manager"
arch=('any')
url='https://github.com/leo-editor/leo-editor'
license=('MIT' 'BSD')
depends=(
	'python-pyqt5'
	'python-pyqtwebengine'
	'python-asttokens'
	'python-docutils'
	'python-flexx'
	'python-meta'
	'python-pylint'
	'python-pyflakes'
	'python-black'
	'python-pyshortcuts'
	'python-sphinx'
	'jupyter-nbformat'
	'shared-mime-info')
makedepends=(
	'python-build'
	'python-installer'
	'python-setuptools'
	'python-wheel')
optdepends=('python-pyenchant: spellchecking support')
provides=('leo-editor')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz"
        'leo.desktop'
        'leo.xml')
sha256sums=('653902e67d359fcaf60aeeca88fb64c9c207f992e8ff9a8dbf91eea06647ed2b'
            '4633876eb91eff206660359ee7da459211e8f87fd73ebbc680fd437c70b63467'
            '630852279324b0d9acf656c4684f16777d64f49b4062bd101c5cddbfc33c82cb')

prepare() {
	cd "$pkgname-editor-$pkgver"
	sed -i \
		-e '/setupext-janitor/d' \
		-e '/wheel/s/,/]/' \
		-e '/twine/d' \
		pyproject.toml
}

build() {
	cd "$pkgname-editor-$pkgver"
	python -m build --wheel --no-isolation
}

package() {
	export PYTHONHASHSEED=0
	cd "$pkgname-editor-$pkgver"
	python -m installer --destdir="$pkgdir/" dist/*.whl
	install -Dm644 "$srcdir/leo.desktop" -t "$pkgdir/usr/share/applications/"
	install -Dm644 "$srcdir/leo.xml" -t "$pkgdir/usr/share/mime/packages/"
	install -Dm644 "leo/Icons/application-x-leo-outline.png" "$pkgdir/usr/share/pixmaps/leo.png"

	local _site="$(python -c 'import site; print(site.getsitepackages()[0])')"
	install -d "$pkgdir/usr/share/licenses/$pkgname/"
	ln -s \
		"$_site/leo-$pkgver.dist-info/LICENSE" \
		"$pkgdir/usr/share/licenses/$pkgname/"
}