summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO3
-rw-r--r--PKGBUILD42
2 files changed, 25 insertions, 20 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 1d67fdc11596..5ca938eeb138 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,12 +1,13 @@
pkgbase = changie
pkgdesc = Automated changelog tool for preparing releases with lots of customization options.
pkgver = 1.8.0
- pkgrel = 1
+ pkgrel = 2
epoch = 0
url = https://github.com/miniscruff/changie
arch = x86_64
license = MIT
makedepends = go
+ makedepends = git
source = git+https://github.com/miniscruff/changie#tag=v1.8.0
sha256sums = SKIP
diff --git a/PKGBUILD b/PKGBUILD
index 6096dab37edc..a773797321db 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,21 +2,21 @@
pkgname=changie
pkgver=1.8.0
-pkgrel=1
+pkgrel=2
epoch=0
pkgdesc="Automated changelog tool for preparing releases with lots of customization options."
arch=('x86_64')
-url="https://github.com/miniscruff/changie"
+url="https://github.com/miniscruff/$pkgname"
license=('MIT')
depends=()
-makedepends=('go')
+makedepends=('go' 'git')
conflicts=()
-source=("git+https://github.com/miniscruff/changie#tag=v$pkgver")
+source=("git+https://github.com/miniscruff/$pkgname#tag=v$pkgver")
sha256sums=('SKIP')
prepare() {
- mkdir -p "src/github.com/miniscruff"
- mv "changie" "src/github.com/miniscruff/changie"
+ cd "$pkgname"
+ mkdir -p "build/"
case $CARCH in
"x86_64")
_GOARCH="amd64"
@@ -29,21 +29,25 @@ prepare() {
}
build() {
- cd "$srcdir/src/github.com/miniscruff/changie"
- GOOS=linux \
- GOARCH=${_GOARCH} \
- GOARM=${_GOARM} \
- CGO_ENABLED=0 \
- GOPATH="$srcdir" \
- go build \
+ cd "$pkgname"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ go build -o build \
+ -buildmode=pie \
+ -trimpath -ldflags="-linkmode=external -X main.version=$pkgver" \
+ -mod=readonly \
-modcacherw \
- -o "$srcdir/changie" \
- -gcflags "all=-trimpath=$srcdir" \
- -asmflags "all=-trimpath=$srcdir" \
- -ldflags "-extldflags ${LDFLAGS} -X main.version=$pkgver" \
- "github.com/miniscruff/changie"
+ .
+}
+
+check() {
+ cd "$pkgname"
+ go test ./...
}
package() {
- install -Dm0755 "$srcdir/changie" "$pkgdir/usr/bin/changie"
+ cd "$pkgname"
+ install -Dm0755 "build/$pkgname" "$pkgdir/usr/bin/$pkgname"
}