diff options
author | Amolith | 2023-08-31 19:04:12 -0400 |
---|---|---|
committer | Amolith | 2023-08-31 19:04:12 -0400 |
commit | 69b14ae1bbd6c7be3bdef37d138fb1ac80327754 (patch) | |
tree | 1720f1b154cb7777ef0eac8864a4d9f8f4de0309 | |
download | aur-invoice-git.tar.gz |
initial commit
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | PKGBUILD | 45 |
3 files changed, 64 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..d517e19e6e88 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = invoice-git + pkgdesc = Command line invoice generator + pkgver = v0.1.0.r9.g4084509 + pkgrel = 1 + url = https://github.com/maaslalani/invoice + arch = any + license = MIT + makedepends = git + makedepends = go + provides = invoice + conflicts = invoice + source = invoice-git::git+https://github.com/maaslalani/invoice.git#branch=main + sha256sums = SKIP + +pkgname = invoice-git diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..39e36fea3e6d --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.pkg.tar.zst +/invoice-git/ +/pkg/ +/src/ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..32339030f35e --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,45 @@ +pkgname=invoice-git +_pkgname=${pkgname%-git} +pkgdesc='Command line invoice generator' +arch=("any") +url="https://github.com/maaslalani/${_pkgname}" +_branch='main' +pkgver=v0.1.0.r9.g4084509 +pkgrel=1 +license=("MIT") +makedepends=("git" "go") +source=("$pkgname::git+$url.git#branch=$_branch") +sha256sums=("SKIP") +provides=($_pkgname) +conflicts=($_pkgname) + +pkgver() { + cd "$pkgname" + ( set -o pipefail + git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + ) +} + +build() { + cd $pkgname + + export CGO_LDFLAGS="${LDFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" + + go build -o "$_pkgname" . +} + +check() { + cd "$pkgname" + go test ./... +} + +package() { + cd "$pkgname" + install -Dm755 "$_pkgname" "$pkgdir/usr/bin/$_pkgname" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$_pkgname/LICENSE" +} |