summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9742377cefac2f73008d9bc3c52cacafea6bc6d2 (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
# Maintainer: Benjamin Chausse <benjamin@chausse.xyz>

pkgname=termpicker-git
pkgver=v1.5.1
pkgrel=1
pkgdesc="A color picker for the terminal"
arch=('x86_64')
url="https://github.com/ChausseBenjamin/termpicker"
license=('Beerware')
options=('!debug')
depends=()
makedepends=('git' 'go' 'upx')
optdepends=(
  'wl-clipboard: clipboard support on wayland'
  'xsel: clipboard support on X11'
)
provides=('termpicker')
conflicts=('termpicker' 'termpicker-bin')
source=("${pkgname}::git+https://github.com/ChausseBenjamin/termpicker.git#tag=v1.5.1")
sha256sums=('SKIP')



build() {
  cd "$srcdir/${pkgname}"
  commit_hash=$(git rev-parse --short HEAD)
  export GOAMD64=v3
  export CGO_ENABLED=0
  go generate ./...
  go build -trimpath -ldflags "-s -w -X main.version=${pkgver}-git" -o termpicker .
  upx -9 termpicker
}

package() {
  cd "$srcdir/${pkgname}"
  install -Dm755 termpicker "${pkgdir}/usr/bin/termpicker"
  install -Dm644 internal/documentation/termpicker.1 "${pkgdir}/usr/share/man/man1/termpicker.1"
  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}