summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: e34b8485bf06cb6b0fc0390cd1f7c007ef33fced (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
# Maintainer: SoMuchForSubtlety <s0muchfrsubtlety@gmail.com>
pkgname=f1viewer
pkgver=1.0.0
pkgrel=2
pkgdesc="TUI client for F1TV"
arch=('x86_64')
url="https://github.com/SoMuchForSubtlety/f1viewer"
license=('GPL3')
depends=('mpv')
optdepends=('xclip: copying URLs to clipboard'
            'keepassxc: secret store backend'
            'pass: secret store backend'
            'gnome-keyring: secret store backend'
            'kwallet: secret store backend')
makedepends=('go-pie')
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/SoMuchForSubtlety/f1viewer/archive/v${pkgver}.tar.gz")
sha256sums=('40986b7ed358adf2299882318d9ca81ef7f1bf730ed30b3c5da362518987d6af')

prepare() {
  if pacman -Qi keepassxc >/dev/null 2>&1; then
    return 0
  elif pacman -Qi pass >/dev/null 2>&1; then
    return 0
  elif pacman -Qi gnome-keyring >/dev/null 2>&1; then
    return 0
  elif pacman -Qi kwallet >/dev/null 2>&1; then
    return 0
  fi
  
  echo 'You need to install a secrets backend like gnome-keyring, kwallet, pass or keepassxc - you might want to install it with pacman -S --asdeps package_name' >&2;
  return 1
}

build() {
  cd "${pkgname}-${pkgver}"
  go build \
    -trimpath \
    -ldflags="-extldflags ${LDFLAGS} -s -w -X main.version=${pkgver}" \
    -o $pkgname .
}

package() {
  cd $pkgname-$pkgver
  install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
}