summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1102d7b8e0f162a1f0910c03f58908cfb2adc674 (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: Mark Wagie <mark dot wagie at tutanota dot com>
# Contributor: iboyperson <tjquillan at gmail dot com>
pkgname=tldr++
pkgver=0.6.1
pkgrel=8
pkgdesc="Community driven man pages improved with smart user interaction"
arch=('i686' 'x86_64' 'arm' 'aarch64')
url="https://isacikgoz.me/tldr"
license=('MIT')
makedepends=('go' 'dep' 'git')
provides=("${pkgname%++}")
conflicts=("${pkgname%++}" 'nodejs-tldr' 'tldr-bash-git' 'tldr-cpp-client' 'tldr-python-client')
source=("$pkgname-$pkgver.tar.gz"::"https://github.com/isacikgoz/tldr/archive/v$pkgver.tar.gz")
sha256sums=('e377942c6dd9cbe3f9f55b7614e17b7c5f0694b326ad3993d0cde59aca8dc8fa')

prepare() {
	mkdir -p gopath/src/github.com/isacikgoz
	ln -rTsf "${pkgname%++}-$pkgver" "gopath/src/github.com/isacikgoz/${pkgname%++}"

	export GOPATH="$srcdir/gopath"
	go clean -modcache

	cd "gopath/src/github.com/isacikgoz/${pkgname%++}"
	dep init -v
	dep ensure -v
}

build() {
	export GOPATH="$srcdir"/gopath
	cd "gopath/src/github.com/isacikgoz/${pkgname%++}"

	go build \
		-trimpath \
		-buildmode=pie \
		-ldflags "-extldflags \"${LDFLAGS}\"" \
		-v -o $pkgname .

	# Clean mod cache for makepkg -C
	go clean -modcache
}

package() {
	cd "gopath/src/github.com/isacikgoz/${pkgname%++}"
	install -Dm755 "$pkgname" "$pkgdir/usr/bin/${pkgname%++}"
	install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}