summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 266857e5dc14a139bbc5ba949b9dfc5927445e77 (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
pkgname=path-extractor
pkgver=0.2.0
pkgrel=3
pkgdesc='A unix filter which outputs the filepaths found in stdin'
arch=('x86_64')
repo="github.com/edi9999/$pkgname"
url="https://$repo"
license=('NONE')
makedepends=('go')
source=("$url/archive/v$pkgver.tar.gz")
sha256sums=('7d6c7463e833305e6d27c63727fec1029651bfe8bca5e8d23ac7db920c2066e7')

gopkg="gopath/src/$repo"

prepare() {
  mkdir -p "${gopkg%/*}"
  ln -rTsf "$pkgname-$pkgver" "$gopkg"
  export GOPATH="$srcdir/gopath"
  cd "$gopkg"
  go get -v -d
}

build() {
  export GOPATH="$srcdir/gopath"
  cd "$gopkg"
  go install \
    -trimpath \
    -ldflags "-extldflags ${LDFLAGS}" \
    -v ./...
}

# Skip check, they don't pass
# check() {
#   export GOPATH="$srcdir"/gopath
#   cd $gopkg
#   go test ./...
# }

package() {
  install -Dm755 "gopath/bin/$pkgname" -t "$pkgdir/usr/bin"
}