summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d36bd7d52b94b4d4df96b2d49731cfd79217b908 (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
# Maintainer: Peter Roberts <me@peter-r.co.uk>
pkgname=zoom-parallel
pkgver=0.1.2
pkgrel=1
pkgdesc="Parallel command executor with a focus on simplicity and good cross-platform behaviour "
arch=("x86_64")
url="https://github.com/pwr22/zoom"
license=('MIT')
depends=("glibc")
makedepends=("go")
source=("https://github.com/pwr22/zoom/archive/v$pkgver.tar.gz")
sha256sums=("667ba0fa6afab4b71c0fcc3a1047c8f3c047c39b9d769223df56e3d531e01f83")

_cmdname=zoom # name of the command - there's a clash so the package name is longer

# Go stuff based on https://wiki.archlinux.org/index.php/Go_package_guidelines

prepare(){
  mkdir -p "go/src/github.com/pwr22"
  ln -rTsf "$_cmdname-$pkgver" "go/src/github.com/pwr22/$_cmdname"

  export GOPATH="$srcdir/go"
  export GOFLAGS="-gcflags=all=-trimpath=$PWD -asmflags=all=-trimpath=${PWD} -ldflags=-extldflags=$LDFLAGS"

  cd "go/src/github.com/pwr22/$_cmdname" # going through the symlink is necessary to make go get happy
  go get ./...
}

build() {
	cd "$_cmdname-$pkgver"

	export GOPATH="$srcdir/go"
	export GOFLAGS="-gcflags=all=-trimpath=$PWD -asmflags=all=-trimpath=${PWD} -ldflags=-extldflags=$LDFLAGS"

    go build -o "$_cmdname"
}

package() {
	cd "$_cmdname-$pkgver"
	install -Dm755 "$_cmdname" "$pkgdir/usr/bin/$_cmdname"
	mkdir -p "$pkgdir/usr/share/licenses/$pkgname"
	cp LICENSE "$pkgdir/usr/share/licenses/$pkgname"
}