summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 29056771b15b991028e4ab486ac648d0e9e0ff58 (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: gbr <gbr@protonmail.com>
_pkgname=twittuh
pkgname=twittuh-git
pkgver=r100.e1bd11b
pkgrel=2
pkgdesc='Make RSS, ATOM, or JSON feeds from Twitter timelines'
arch=('x86_64')
url='https://github.com/derat/twittuh'
license=('BSD')
depends=('chromium')
makedepends=('git' 'go')
source=("$_pkgname::git+https://github.com/derat/twittuh.git#branch=master")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgname"
  printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd "$_pkgname"
  go build \
    -o "$_pkgname" \
    -trimpath \
    -buildmode=pie \
    -mod=readonly \
    -modcacherw \
    -ldflags "-extldflags \"${LDFLAGS}\"" \
    .
}

check() {
  cd "$_pkgname"
  go test -v ./...
}

package() {
  cd "$_pkgname"
  install -Dm755 "$_pkgname" "$pkgdir/usr/bin/$_pkgname"
  install -Dm644 'LICENSE' "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
}