aboutsummaryrefslogtreecommitdiffstats
path: root/community/nnn/APKBUILD
blob: 6ec669daea19dcafa16ca91d99996b1c6b695f45 (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
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=nnn
pkgver=3.1
pkgrel=0
pkgdesc="The missing terminal file browser for X"
url="https://github.com/jarun/nnn"
arch="all !armhf !armv7"  # armhf: fails to build
license="BSD-2-Clause"
makedepends="ncurses-dev readline-dev"
options="!check"  # no tests provided and $(nnn -v) requires tty
subpackages="$pkgname-doc
	$pkgname-bash-completion:bashcomp:noarch
	$pkgname-fish-completion:fishcomp:noarch
	$pkgname-zsh-completion:zshcomp:noarch
	"
source="nnn-$pkgver.tar.gz::https://github.com/jarun/nnn/archive/v$pkgver.tar.gz
	nlay"

build() {
	make
}

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

	# Overwrite the provided nlay script with our POSIX compliant version.
	install -m 755 "$srcdir"/nlay "$pkgdir"/usr/bin/nlay
}

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="f17bdcf95bba3eb50d20cb06725022bcdc2fae34a365e55dea1baa49e40c567e175a3d5c66fcf70f560e64a8933f0ed9a8ca39af67fd39edcb81c82be5aedca9  nnn-3.1.tar.gz
9f70f5fec2799caf1624e1334e687072dde94ee550a4cd7ee5a1a6b9b880f3fe40b6cbd631ce2d024cb811b5115249e7cd81c880c88f2289f627cd866fc06036  nlay"