summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorWill Furnass2022-11-04 22:19:13 +0000
committerWill Furnass2022-11-04 22:39:06 +0000
commitce67b10480c789dba4ba4ebc01352e29b5cbb1f8 (patch)
treecaa15c08a656fdf1ea16fa71d28d656217bdb5ac
parent99236647f14153c20207dc8902a3ab7324aad69c (diff)
downloadaur-ce67b10480c789dba4ba4ebc01352e29b5cbb1f8.tar.gz
Incorporate latest Arch packaging guidelines
https://wiki.archlinux.org/title/Go_package_guidelines
-rw-r--r--.SRCINFO3
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD38
3 files changed, 26 insertions, 16 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 684ad2e4ae97..ab2e49676680 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -5,9 +5,8 @@ pkgbase = fn
url = https://fnproject.io/
arch = x86_64
license = Apache
- makedepends = go-pie
+ makedepends = go
depends = docker
- noextract = 0.6.22.tar.gz
source = https://github.com/fnproject/cli/archive/0.6.22.tar.gz
sha256sums = 40581ee36aed8c570ce5dff63ac3dc291b5c0c17dcb92ded54626157d9db702b
diff --git a/.gitignore b/.gitignore
index 2468060d55a3..925921340d28 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+*.tar.gz
fn-*.pkg.tar.zst
pkg/
src/
diff --git a/PKGBUILD b/PKGBUILD
index ddd3422c78ea..a2dbf4004c4e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
pkgname='fn'
pkgver='0.6.22'
-pkgrel='1'
+pkgrel='2'
epoch=
pkgdesc='fn: a container-native, cloud-agnostic tool for defining serverless functions.'
arch=('x86_64')
@@ -10,29 +10,39 @@ url='https://fnproject.io/'
license=('Apache')
groups=()
depends=('docker')
-makedepends=('go-pie')
+makedepends=('go')
source=("https://github.com/fnproject/cli/archive/$pkgver.tar.gz")
-noextract=("$pkgver.tar.gz")
sha256sums=('40581ee36aed8c570ce5dff63ac3dc291b5c0c17dcb92ded54626157d9db702b')
-prepare() {
- tar -zxf ${pkgver}.tar.gz
+prepare(){
+ cd "cli-$pkgver"
}
build() {
- cd "cli-$pkgver"
- export GOFLAGS="-gcflags=all=-trimpath=${PWD} -asmflags=all=-trimpath=${PWD} -ldflags=-extldflags=-zrelro -ldflags=-extldflags=-znow"
- GO111MODULE=on GOFLAGS="-mod=vendor $GOFLAGS" go mod vendor -v
- go build -o fn
+ cd "cli-$pkgver"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+ go build -o $pkgname
}
check() {
- cd "cli-$pkgver"
- test "$(./fn --version) == 'fn version 0.5.86'"
-# go test -v $(go list ./... | grep -Ev "^github.com/fnproject/cli/test$")
+ cd "cli-$pkgver"
+ test "$($pkgname --version)" == "fn version $pkgver"
+ # NB github.com/fnproject/cli/commands tests can't be run as get
+ # 'commands/invoke_windows.go:16:1: misplaced +build comment'
+ go test -v $(go list ./... | grep -Ev '^github.com/fnproject/cli/test$' | grep -Ev '^github.com/fnproject/cli/commands$')
}
package() {
- cd "cli-$pkgver"
- install -Dm755 fn "$pkgdir"/usr/bin/fn
+ cd "cli-$pkgver"
+ install -Dm755 $pkgname "$pkgdir"/usr/bin/$pkgname
}
+
+
+
+
+
+