blob: 718b387ec3f617631a791c40717136d1651c3f62 (
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
|
# Maintainer: Mike Yuan <me@yhndnzj.com>
pkgname=ov
pkgver=0.39.0
pkgrel=1
pkgdesc="Feature-rich terminal-based text viewer"
arch=('x86_64')
url="https://github.com/noborus/ov"
license=('MIT')
makedepends=('go' 'git')
_tag="v$pkgver"
source=("$pkgname::git+https://github.com/noborus/ov.git#tag=$_tag")
b2sums=('0ae637aaf4a04f25bcb50e595aa9656f81e93b061e37058853fbfef0d5452d60b5725863c90e44128bc99d2e1b6053b6b4a0125a8445ae4d4532e2db10d336c8')
prepare() {
cd "$pkgname"
mkdir build/
}
build() {
cd "$pkgname"
local revision="$(git rev-parse --short "$_tag")"
export CGO_CFLAGS="$CFLAGS"
export CGO_CXXFLAGS="$CXXFLAGS"
export CGO_CPPFLAGS="$CPPFLAGS"
export CGO_LDFLAGS="$LDFLAGS"
go build \
-trimpath \
-buildmode=pie \
-mod=readonly \
-modcacherw \
-ldflags="-linkmode=external -X main.Version=$_tag -X main.Revision=$revision -extldflags '$LDFLAGS'" \
-o build
}
check() {
cd "$pkgname"
go test
}
package() {
cd "$pkgname"
install -Dm755 "build/$pkgname" "$pkgdir/usr/bin/$pkgname"
install -Dt "$pkgdir/usr/share/doc/$pkgname" -m644 ov.yaml ov-less.yaml ov-disable-default.yaml ov.plugin.zsh
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
|