This repository has been archived by the owner on May 20, 2023. It is now read-only.
/
PKGBUILD
89 lines (84 loc) · 2.95 KB
/
PKGBUILD
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Maintainer: David Runge <dvzrv@archlinux.org>
# Maintainer: Daniel M. Capella <polyzen@archlinux.org>
# Contributor: eolianoe <eolianoe [at] googlemail [dot] com>
# Contributor: Hugo Osvaldo Barrera <hugo@barrera.io>
# Contributor: Thomas Weißschuh <thomas t-8ch de>
# Contributor: Étienne Deparis <etienne [at] depar [dot] is>
# Contributor: Max Gautier <mg@max.gautier.name>
pkgname=khal
pkgver=0.11.1
pkgrel=1
pkgdesc='CLI calendar application build around CalDAV'
arch=('any')
url="https://lostpackets.de/khal/"
license=('MIT')
depends=(
'python'
'python-atomicwrites'
'python-click'
'python-click-log'
'python-configobj'
'python-dateutil'
'python-icalendar'
'python-pytz'
'python-pyxdg'
'python-tzlocal'
'python-urwid'
)
makedepends=(
'python-build'
'python-installer'
'python-setuptools-scm'
'python-sphinxcontrib-newsfeed'
'python-wheel'
)
checkdepends=(
'python-pytest'
'python-freezegun'
'python-hypothesis'
'python-packaging'
'vdirsyncer'
)
optdepends=(
'gawk: for mutt2khal'
'python-setproctitle: to set process name'
'vdirsyncer: to synchronize CalDAV calendars'
)
source=("https://files.pythonhosted.org/packages/source/${pkgname::1}/$pkgname/$pkgname-$pkgver.tar.gz")
sha256sums=('0314487cb733f54a832a813d71160bb1004606dce3b847a6832ef5e99663601e')
b2sums=('12f98781b9a64710537f7728a087f24ef1d73600e957eac7b699948047c1676a9c91a38a415741c6acd94a7ba72014d4b009425edab249225c8bef23b94c0387')
build() {
cd $pkgname-$pkgver
python -m build --wheel --skip-dependency-check --no-isolation
make -C doc man PYTHONPATH="$PWD"
}
check() {
cd $pkgname-$pkgver
env
export PYTHONPATH="build:$PYTHONPATH"
export LC_ALL="C"
pytest -v
}
package() {
local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
cd $pkgname-$pkgver
python -m installer --destdir="$pkgdir" dist/*.whl
# executables
install -vDm 755 bin/{i,}"$pkgname" misc/mutt2khal -t "$pkgdir/usr/bin/"
# configuration
install -vDm 644 "$pkgname.conf.sample" "$pkgdir/usr/share/doc/$pkgname/examples/$pkgname.conf"
# man page
install -vDm 644 doc/build/man/${pkgname}.1 -t "$pkgdir/usr/share/man/man1/"
# completions
install -vd "$pkgdir/usr/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
_KHAL_COMPLETE=bash_source "$pkgdir"/usr/bin/khal > "$pkgdir/usr/share/bash-completion/completions/$pkgname"
_KHAL_COMPLETE=fish_source "$pkgdir"/usr/bin/khal > "$pkgdir/usr/share/fish/vendor_completions.d/$pkgname.fish"
_KHAL_COMPLETE=zsh_source "$pkgdir"/usr/bin/khal > "$pkgdir/usr/share/zsh/site-functions/_$pkgname"
# desktop file
install -vDm 644 misc/khal.desktop -t "$pkgdir/usr/share/applications/"
# docs
install -vDm 644 {AUTHORS.txt,{CHANGELOG,CONTRIBUTING,README}.rst} -t "$pkgdir/usr/share/doc/$pkgname/"
# symlink license file
install -d "$pkgdir"/usr/share/licenses/$pkgname
ln -s "$site_packages"/${pkgname}-${pkgver}.dist-info/COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
}