diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 42 |
1 files changed, 23 insertions, 19 deletions
@@ -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" } |