summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 90d7db27ec6e430b79eccc2e1a5a5654e0416cf2 (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
# Maintainer: Lennard Hofmann <lennard dot hofmann at web dot de>
pkgname=(kak-snippets-git kak-snippets-directory-git)
pkgbase=kak-snippets-git
_reponame=kakoune-snippets
pkgver=r62.94931c2
pkgrel=2
pkgdesc='Expand typed text to snippets in Kakoune'
arch=(any)
url="https://github.com/occivink/$_reponame"
license=(Unlicense)
depends=('kakoune>=2019.07.01' 'perl')
makedepends=(git)
provides=("${pkgbase%-git}")
conflicts=("${pkgbase%-git}")
install=$pkgbase.install
source=("git+$url")
sha256sums=('SKIP')

pkgver() {
	# Git, no tags available
	cd "$srcdir/$_reponame"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package_kak-snippets-git() {
	optdepends=('kak-snippets-directory-git: Define snippets as separate files')
	cd "$srcdir/$_reponame"
	install -Dm644 -t "$pkgdir/usr/share/doc/$pkgbase" README.md
	install -Dm544 -t "$pkgdir/usr/share/kak/rc/addons" snippets.kak
}

package_kak-snippets-directory-git() {
	depends=('kak-snippets-git')
	pkgdesc='Define kak-snippets as separate files instead of via an option'
	provides=('kak-snippets-directory')
	conflicts=('kak-snippets-directory')
	cd "$srcdir/$_reponame"
	install -Dm544 -t "$pkgdir/usr/share/kak/rc/addons" snippets-directory.kak
}