summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8af1aab31919f911ff150732e7a4c3a66b6b7cfc (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

# Maintainer: Andrea Feletto <andrea@andreafeletto.com>

pkgname=nfm-git
_pkgname=${pkgname%-*}
pkgver=r132.1048d2d
pkgrel=1
pkgdesc='Neat terminal file manager.'
arch=('x86_64')
url='https://sr.ht/~leon_plickat/nfm'
license=('GPL3')
makedepends=('zig' 'git')
provides=('nfm')
conflicts=('nfm')
source=(
	"git+https://git.sr.ht/~leon_plickat/nfm"
	'git+https://github.com/tiehuis/zig-regex'
	'git+https://git.sr.ht/~leon_plickat/zig-spoon'
)
sha256sums=(
	'SKIP'
	'SKIP'
	'SKIP'
)

prepare() {
	cd "$srcdir/$_pkgname"
	git submodule init
	for dep in regex spoon; do
		git config "submodule.deps/zig-$dep.url" "$srcdir/zig-$dep"
	done
	git submodule update
}

pkgver() {
	cd "$srcdir/$_pkgname"
	printf 'r%s.%s' "$(git rev-list --count HEAD)" \
		"$(git rev-parse --short HEAD)"
}

package() {
	cd "$srcdir/$_pkgname"
	DESTDIR="$pkgdir" zig build -Drelease-safe --prefix '/usr'
	install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$_pkgname"
	install -Dm644 README.md -t "$pkgdir/usr/share/doc/$_pkgname"
}