# Maintainer: Andrey Novikov pkgname=anycable-go pkgdesc="AnyCable WebSocket Server written in Go" pkgver=1.2.1 pkgrel=1 arch=('i686' 'x86_64') url="http://anycable.io" license=('MIT') makedepends=('go' 'rsync') source=("https://github.com/anycable/anycable-go/archive/v${pkgver}.tar.gz") sha256sums=('b14a2e0a453c121c4d7bb60189e360751c6e6e2d5f3f7ccb8e17dfa1b51b35f7') # See https://wiki.archlinux.org/index.php/Go_package_guidelines prepare(){ mkdir -p gopath/src/github.com/anycable ln -rTsf $pkgname-$pkgver gopath/src/github.com/anycable/$pkgname cd gopath/src/github.com/anycable/$pkgname export GOPATH="$srcdir"/gopath } build() { cd gopath/src/github.com/anycable/$pkgname export GOPATH="$srcdir"/gopath export CGO_ENABLED=0 export GO111MODULE=on export GOFLAGS=-mod=mod go build \ -ldflags "-s -w -X main.version=$pkgver" \ -gcflags "all=-trimpath=$GOPATH" \ -asmflags "all=-trimpath=$GOPATH" \ -a -o $GOPATH/bin/anycable-go cmd/anycable-go/main.go } package() { install -Dm755 gopath/bin/$pkgname "$pkgdir"/usr/bin/$pkgname }