diff options
author | Gleb Buzin | 2022-06-05 13:17:35 +0300 |
---|---|---|
committer | Gleb Buzin | 2022-06-05 13:17:35 +0300 |
commit | d9092354b4c967e9d41bbc4ddf87a742a1afa78d (patch) | |
tree | dc4be5afc3828810fe31c195edf7e7bcbe05dbf9 | |
download | aur-gohack-git.tar.gz |
feat(pkg): init
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | PKGBUILD | 44 |
2 files changed, 61 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..0af8764ea9dd --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = gohack-git + pkgdesc = Make temporary edits to your Go module dependencies + pkgver = 1.0.2.r7.g03d2ff3 + pkgrel = 1 + url = https://github.com/rogpeppe/gohack + arch = i686 + arch = x86_64 + license = MIT + makedepends = git + makedepends = go + makedepends = rsync + provides = gohack + conflicts = gohack + source = gohack::git+https://github.com/rogpeppe/gohack#branch=master + sha256sums = SKIP + +pkgname = gohack-git diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..da528f6dbd82 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,44 @@ +# Maintainer: Yuanji <self@gimo.me> +pkgname=gohack-git +_pkgname=gohack +pkgver=1.0.2.r7.g03d2ff3 +pkgrel=1 +pkgdesc="Make temporary edits to your Go module dependencies" +arch=('i686' 'x86_64') +url="https://github.com/rogpeppe/gohack" +license=('MIT') +makedepends=('git' 'go' 'rsync') +conflicts=('gohack') +provides=('gohack') +source=("gohack::git+https://github.com/rogpeppe/gohack#branch=master") +sha256sums=('SKIP') + +pkgver() { + cd "${srcdir}/${_pkgname}" + git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' +} + +build() { + 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" + export GOPATH="${srcdir}/gopath" + export PATH="${srcdir}/gopath/bin:$PATH" + + cd "${srcdir}/${_pkgname}" + go build \ + -trimpath \ + -buildmode=pie \ + -mod=readonly \ + -modcacherw \ + -ldflags "-s -w -X main.version=\"${pkgver}\" -linkmode external -extldflags \"${LDFLAGS}\"" \ + -o bin/gohack ./ +} + +package() { + install -Dm755 "${srcdir}/${_pkgname}/bin/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}" + install -Dm644 "${srcdir}/${_pkgname}/README.md" "${pkgdir}/usr/share/doc/${pkgname}/README.md" + install -Dm644 "${srcdir}/${_pkgname}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} |