summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authordatabase641282023-11-18 19:56:48 +0800
committerdatabase641282023-11-18 19:56:48 +0800
commitd30ae0e0fe51694ca1c2380231054262cad40da1 (patch)
tree85538f898b326a2af9b765336a1f71e73fa5f76e /PKGBUILD
downloadaur-modpack-dl-go-git.tar.gz
💌 Initial commit
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD35
1 files changed, 35 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..a3b36fb5894e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,35 @@
+# Maintainer: database64128 <free122448@hotmail.com>
+
+_pkgname=modpack-dl-go
+pkgname=$_pkgname-git
+pkgver=1.0.0.r0.g140b4b6
+pkgrel=1
+pkgdesc="Minecraft modpack downloader written in Go"
+arch=('x86_64' 'aarch64')
+url="https://github.com/database64128/$_pkgname"
+license=('AGPL3')
+makedepends=('git' 'go')
+provides=("$_pkgname")
+conflicts=("$_pkgname")
+source=("$pkgname::git+$url.git")
+b2sums=('SKIP')
+
+pkgver() {
+ cd $pkgname
+ git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+build() {
+ cd $pkgname
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath"
+ go build -ldflags='-s -w -linkmode=external' ./cmd/$_pkgname
+}
+
+package() {
+ cd $pkgname
+ install -Dm755 $_pkgname "$pkgdir"/usr/bin/$_pkgname
+}