blob: 9a948b7f157d04cb2061ff5feb145c6b29cd2d0d (
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
|
# Maintainer: Ralph Torres <mail at ralphptorr dot es>
# Contributor: zneix <zneix@zneix.eu>
_pkgname=twitch-cli
pkgname=$_pkgname-git
pkgver=1.1.24.r8.fd7dac6
pkgrel=3
pkgdesc='The official Twitch CLI to make developing on Twitch easier'
arch=(x86_64)
url=https://github.com/twitchdev/twitch-cli
license=(Apache-2.0)
provides=($_pkgname)
conflicts=($_pkgname)
makedepends=(git go)
source=(git+$url)
sha512sums=(SKIP)
pkgver() {
cd "$srcdir"/$_pkgname
git describe --tags --long --abbrev=7 |\
sed 's/\([^-]*-\)g/r\1/;s/-/./g;s/^production\///;s/^v//'
}
build() {
cd "$srcdir"/$_pkgname
export CGO_CFLAGS="$CFLAGS"
export CGO_CPPFLAGS="$CPPFLAGS"
export CGO_CXXFLAGS="$CXXFLAGS"
export CGO_LDFLAGS="$LDFLAGS"
export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw"
_ldflags="-s -w -X main.buildVersion=$pkgver -linkmode external -extldflags '$LDFLAGS'"
go build -ldflags "$_ldflags" .
}
package() {
cd "$srcdir"/$_pkgname
install -Dm755 $_pkgname "$pkgdir"/usr/bin/${_pkgname%-cli}
install -Dm644 -t "$pkgdir"/usr/share/licenses/$_pkgname LICENSE
install -Dm644 -t "$pkgdir"/usr/share/doc/$_pkgname README.md docs/*.md
}
|