summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Lisin2020-04-27 13:20:15 +0200
committerml2020-05-01 04:53:30 +0200
commit22af44f01c0c8297be14ab9413659f0275909203 (patch)
treed4757503df53c6fc6c6c520f7463348714a3838d
parentdb036b9ac8dd02452ef36a1accb6566a28560124 (diff)
downloadaur-22af44f01c0c8297be14ab9413659f0275909203.tar.gz
Improve various tiny things.
- Remove variable in install= to shut up the vim lint. It's fixed anyway - arch: Rename armv7 to armv7h - Replace fixed _commit with magnificent and mostly unknown magic trick. - yarn: Drop --non-interactive. I assume it's assumed when invoked by makepkg - Move `date` inside of -ldflags. Cmd is short enough and good to read. - Do the opposite of what I preached earlier and add CGO_* vars (Sorry) - Add (incomplete) GOFLAGS env. It is exported, therefore picked up by `go test` as well, but without -trimpath.
-rw-r--r--.SRCINFO5
-rw-r--r--PKGBUILD25
2 files changed, 16 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ec3a7455bd57..40f37a40e826 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,16 +1,17 @@
pkgbase = gotify-server
pkgdesc = A simple server for sending and receiving messages in real-time per WebSocket.
pkgver = 2.0.15
- pkgrel = 1
+ pkgrel = 2
url = https://gotify.net/
install = gotify-server.install
arch = x86_64
arch = i686
arch = aarch64
- arch = armv7
+ arch = armv7h
license = MIT
makedepends = git
makedepends = go
+ makedepends = gzip
makedepends = yarn
depends = glibc
options = emptydirs
diff --git a/PKGBUILD b/PKGBUILD
index 0892d814f911..dced457b889c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,16 +2,15 @@
# Contributor: ml <ml@visu.li>
pkgname=gotify-server
pkgver=2.0.15
-_commit=e56f7bc4c7efdb61fea88a0b65d501277604cefa
-pkgrel=1
+pkgrel=2
pkgdesc='A simple server for sending and receiving messages in real-time per WebSocket.'
-arch=('x86_64' 'i686' 'aarch64' 'armv7')
+arch=('x86_64' 'i686' 'aarch64' 'armv7h')
url='https://gotify.net/'
license=('MIT')
depends=('glibc')
-makedepends=('git' 'go' 'yarn')
+makedepends=('git' 'go' 'gzip' 'yarn')
backup=('etc/gotify/config.yml')
-install="${pkgname}.install"
+install=gotify-server.install
options=(emptydirs)
source=(
"$pkgname-$pkgver.tar.gz::https://github.com/gotify/server/archive/v${pkgver}.tar.gz"
@@ -29,23 +28,25 @@ prepare() {
}
build() {
+ local _commit=$(zcat "${pkgname}-${pkgver}.tar.gz" | git get-tar-commit-id)
cd "server-$pkgver"
(
cd ui
- yarn --non-interactive --frozen-lockfile
- NODE_ENV=production yarn --non-interactive --frozen-lockfile build
+ yarn --frozen-lockfile
+ NODE_ENV=production yarn --frozen-lockfile build
)
go run hack/packr/packr.go
- local build_date=$(date -u -d "@${SOURCE_DATE_EPOCH}" +%F-%T)
- export CGO_LDFLAGS="${LDFLAGS}"
- export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CFLAGS="$CFLAGS"
+ export CGO_LDFLAGS="$LDFLAGS"
+ export CGO_CPPFLAGS="$CPPFLAGS"
+ export CGO_CXXFLAGS="$CXXFLAGS"
+ export GOFLAGS='-buildmode=pie -modcacherw'
go build \
-o "$pkgname" \
-trimpath \
- -buildmode=pie \
-ldflags "-X 'main.Version=${pkgver}' \
-X 'main.Commit=${_commit}' \
- -X 'main.BuildDate=${build_date}' \
+ -X 'main.BuildDate=$(date -u -d "@${SOURCE_DATE_EPOCH}" +%F-%T)' \
-X 'main.Mode=prod'"
}