aboutsummaryrefslogtreecommitdiffstats
path: root/community/nnn/APKBUILD
blob: 0d2d17b36dbfd5aa57ea11236b4f3ec157d7b01a (plain) (blame)
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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=nnn
pkgver=3.5
pkgrel=2
pkgdesc="The unorthodox terminal file manager"
url="https://github.com/jarun/nnn"
arch="all"
license="BSD-2-Clause"
makedepends="ncurses-dev readline-dev"
install="$pkgname-plugins.post-install"
options="!check"  # no tests provided and $(nnn -v) requires tty
subpackages="$pkgname-doc
	$pkgname-plugins::noarch
	$pkgname-bash-completion:bashcomp:noarch
	$pkgname-fish-completion:fishcomp:noarch
	$pkgname-zsh-completion:zshcomp:noarch
	"
source="https://github.com/jarun/nnn/archive/v$pkgver/$pkgname-$pkgver.tar.gz
	nnn-getplugs
	"

build() {
	make
}

package() {
	make install DESTDIR="$pkgdir" PREFIX=/usr
}

plugins() {
	pkgdesc="nnn official plugins"
	local destdir="$subpkgdir/usr/share/$pkgname/plugins"

	cd "$builddir"
	mkdir -p "$destdir"
	cp -r plugins "${destdir%/*}"/

	cd "$destdir"
	rm README* getplugs upgrade

	install -D -m 0755 "$srcdir"/nnn-getplugs "$destdir"/getplugs
	mkdir -p "$subpkgdir"/usr/bin
	ln -s "$destdir"/getplugs "$subpkgdir"/usr/bin/nnn-getplugs
}

bashcomp() {
	pkgdesc="Bash completions for $pkgname"
	depends=""
	install_if="$pkgname=$pkgver-r$pkgrel bash-completion"

	cd "$builddir"
	install -D -m 644 misc/auto-completion/bash/nnn-completion.bash \
		"$subpkgdir"/usr/share/bash-completion/completions/$pkgname
}

fishcomp() {
	pkgdesc="Fish completions for $pkgname"
	depends=""
	install_if="$pkgname=$pkgver-r$pkgrel fish"

	cd "$builddir"
	install -D -m 644 misc/auto-completion/fish/nnn.fish \
		"$subpkgdir"/usr/share/fish/completions/$pkgname.fish
}

zshcomp() {
	pkgdesc="ZSH completions for $pkgname"
	depends=""
	install_if="$pkgname=$pkgver-r$pkgrel zsh"

	cd "$builddir"
	install -D -m 644 misc/auto-completion/zsh/_nnn \
		"$subpkgdir"/usr/share/zsh/site-functions/_$pkgname
}

sha512sums="87710ca251906d22afc8d329675675c81fdf1d6e71f4f4991ab36868105906b6d45c2c84dd118beafa79644a0677a66bfa346ffe9a4516082d899c5148c5cffd  nnn-3.5.tar.gz
5870bd38c897c0738778952d3c65131ae37b44d8a5032add81645bcf46cae4c66700f319b514f8ab369e15900e4de1058736664ca3603a850ef0212a8ce8e7ee  nnn-getplugs"