summaryrefslogtreecommitdiff
path: root/community/vhs/APKBUILD
blob: fe29c2518c75b14c45bc26ab4257311e6f2b0dc1 (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
# Contributor: Grigory Kirillov <txgk@bk.ru>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=vhs
pkgver=0.7.2
pkgrel=3
pkgdesc="Tool for automatic recording of terminal sessions"
url="https://github.com/charmbracelet/vhs"
arch="all"
license="MIT"
depends="ffmpeg ttyd"
makedepends="go"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	$pkgname-fish-completion
	$pkgname-zsh-completion
	"
source="https://github.com/charmbracelet/vhs/archive/v$pkgver/vhs-$pkgver.tar.gz"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"

build() {
	mkdir builddir

	go build -v \
		-trimpath \
		-ldflags "-X main.Version=$pkgver -extldflags \"$LDFLAGS\"" \
		-o builddir .

	./builddir/vhs man > builddir/vhs.1
	./builddir/vhs completion bash > completion.bash
	./builddir/vhs completion fish > completion.fish
	./builddir/vhs completion zsh > completion.zsh
}

check() {
	go test -v ./...
}

package() {
	install -Dm755 builddir/vhs -t "$pkgdir"/usr/bin/
	install -Dm644 builddir/vhs.1 -t "$pkgdir"/usr/share/man/man1/

	install -Dm644 completion.bash \
		"$pkgdir"/usr/share/bash-completion/completions/vhs
	install -Dm644 completion.fish \
		"$pkgdir"/usr/share/fish/vendor_completions.d/vhs.fish
	install -Dm644 completion.zsh \
		"$pkgdir"/usr/share/zsh/site-functions/_vhs
}

sha512sums="
8451974a75bc257ac08327779be3c9cf0d2b53386a865284d3f1e4a5a0460f420e04f2142330ee50a61737a023c1d23c89ab871cc4029c4fe2bbf18fbc5341a1  vhs-0.7.2.tar.gz
"