addpkg: goreleaser

This commit is contained in:
MedzikUser 2022-06-06 22:43:55 +02:00
parent f5d50f0a59
commit 72aae3117a
No known key found for this signature in database
GPG Key ID: A5FAC1E185C112DB
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,42 @@
# Maintainer: MedzikUser <nivua1fn@duck.com>
pkgname='goreleaser'
pkgver='1.9.2'
pkgrel=1
pkgdesc='Deliver Go binaries as fast and easily as possible'
arch=('x86_64')
url="https://github.com/goreleaser/goreleaser"
license=('MIT')
depends=('go')
makedepends=('go')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('f50f8d7c4809eacb0824a215a7b70329b10f241b0a8bbf9cec0fcba3329914a6')
build() {
cd "$pkgname-$pkgver"
local _flags
_flags=(
-X main.version="$pkgver"
-X main.builtBy="medzikuser"
)
export CGO_CPPFLAGS="$CPPFLAGS"
export CGO_CFLAGS="$CFLAGS"
export CGO_CXXFLAGS="$CXXFLAGS"
export CGO_LDFLAGS="$LDFLAGS"
export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -modcacherw"
go build \
-v \
-ldflags "${_flags[*]}" \
-o bin/$pkgname \
.
}
package() {
cd "$pkgname-$pkgver"
install -Dm 755 bin/$pkgname "$pkgdir/usr/bin/$pkgname"
install -Dm 644 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

View File

@ -0,0 +1 @@
GITHUB_REPO="goreleaser/goreleaser"