summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ca78eb9db62fb30525ab8342eac6d58f8ded3aa8 (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
46
47
48
49
50
51
52
53
54
55
56
57
# Maintainer: Vianney Bouchaud <aur dot vianney at bouchaud dot org>
# Contributor: Daniel Milde <daniel at milde dot cz>

pkgname=gore
pkgdesc="Yet another Go REPL that works nicely"
pkgver=0.6.0
pkgrel=1
arch=('x86_64')
_gopkg="github.com/x-motemen/gore"
url="https://${_gopkg}"
license=('MIT')
depends=(
  'go'
)

source=(
  "${pkgname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz"
)

sha256sums=(
  'bb145d967605fb42a8f0db3c8a6b4cfd1e2d7ff083423dd816474889e5eea46d'
)

prepare(){
  cd $pkgname-$pkgver
  mkdir -p build/
}

build() {
    cd $pkgname-$pkgver
    export GOPATH="$srcdir/gopath"
    export CGO_CPPFLAGS="${CPPFLAGS}"
    export CGO_CFLAGS="${CFLAGS}"
    export CGO_CXXFLAGS="${CXXFLAGS}"

    go build \
      -trimpath \
      -buildmode=pie \
      -mod=readonly \
      -modcacherw \
      -ldflags "
        -linkmode=external
        -buildid=''
        -extldflags '${LDFLAGS}'
        -X '${_gopkg}/cli.revision=${pkgver}'
      " \
      -o build ./cmd/gore
}

package() {
  cd "$pkgname-$pkgver"

  install -D -m0755 build/gore "${pkgdir}/usr/bin/gore"
  install -D -m0644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

# vim:set ts=2 sw=2 et: