summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7950e26834f255f136103ae51c71ec7e11109735 (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: tarball <bootctl@gmail.com>
# Contributor: dalz <aur @t alsd d0t eu>

pkgname=gemget
pkgver=1.9.0
pkgrel=1
pkgdesc='Command line downloader for the Gemini protocol'
arch=('x86_64')
url='https://github.com/makew0rld/gemget'
license=('MIT')
makedepends=('go' 'git')
source=(git+$url.git#tag=v$pkgver)
sha256sums=('SKIP')

prepare() {
  cd $pkgname
  go mod download
}

build() {
  cd $pkgname
  GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" \
    make BUILDER=gemget-AUR
}

check() {
  cd $pkgname

  # verify version
  diff \
    <(./gemget --version) \
    <(
      cat <<EOF
$pkgname v$pkgver
Commit: $(git rev-parse HEAD)
Built by: gemget-AUR
EOF
    )
}

package() {
  cd $pkgname
  install -D gemget "$pkgdir/usr/bin/gemget"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}