summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authornycex2021-04-03 16:14:23 +0200
committernycex2021-04-03 16:14:23 +0200
commite05a393add9ec74143b99a775b8fff5a4d2d53a6 (patch)
treeee0fd18bf86a19dae18add1583b3bc511008e87b
parent9e9e52ae4802c574aa842866aab9136328ad6f87 (diff)
downloadaur-e05a393add9ec74143b99a775b8fff5a4d2d53a6.tar.gz
create a hacky aur devel package for the zig master builds
-rw-r--r--.SRCINFO13
-rw-r--r--PKGBUILD45
2 files changed, 39 insertions, 19 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6d79462b057..9b10e4a62c0 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,14 +1,17 @@
-pkgbase = zig-static
+pkgbase = zig-master-bin
pkgdesc = robust, optimal, and clear programming language
- pkgver = 0.7.1
+ pkgver = 0.8.0_dev.1712+2f07d76ee
pkgrel = 1
url = https://ziglang.org/
arch = x86_64
+ arch = aarch64
license = MIT
+ makedepends = jq
+ makedepends = curl
provides = zig
conflicts = zig
- source = https://ziglang.org/download/0.7.1/zig-linux-x86_64-0.7.1.tar.xz
- md5sums = fd4167264ed40766a17ccd25c878d825
+ source = https://ziglang.org/download/index.json
+ md5sums = SKIP
-pkgname = zig-static
+pkgname = zig-master-bin
diff --git a/PKGBUILD b/PKGBUILD
index b44e5a71906..3de858fc1e9 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,24 +1,41 @@
-# Maintainer: Henry Nelson <hcnelson99@gmail.com>
-pkgname=zig-static
-pkgver=0.7.1
+# Maintainer: nycex <nycex / cccp.org>
+pkgname=zig-master-bin
+pkgver=0.8.0_dev.1712+2f07d76ee
pkgrel=1
-epoch=
pkgdesc="robust, optimal, and clear programming language"
-arch=('x86_64')
+arch=('x86_64' 'aarch64')
url="https://ziglang.org/"
license=('MIT')
depends=()
-makedepends=()
+makedepends=('jq' 'curl')
provides=('zig')
conflicts=('zig')
-source=("https://ziglang.org/download/$pkgver/zig-linux-x86_64-$pkgver.tar.xz")
-md5sums=('fd4167264ed40766a17ccd25c878d825')
+source=("https://ziglang.org/download/index.json")
+md5sums=('SKIP')
+
+pkgver() {
+ cd "${srcdir}"
+ if build_version="$(jq -r '.master.version' 'index.json' 2>/dev/null)" &&
+ [ "${build_version}" != 'null' ]; then
+
+ printf '%s' "${build_version//-/_}"
+ else
+ printf 'Error: Failed to parse index.json\n' >&2
+ exit 1
+ fi
+}
+
+build() {
+ cd "${srcdir}"
+ curl -O "https://ziglang.org/builds/zig-linux-${arch}-${pkgver//_/-}.tar.xz"
+ tar xf "zig-linux-${arch}-${pkgver//_/-}.tar.xz"
+}
package() {
- cd "$srcdir/zig-linux-x86_64-$pkgver"
- install -D zig "$pkgdir/usr/bin/zig"
- install -D LICENSE "$pkgdir/usr/share/licenses/zig/LICENSE"
- cp -r lib "$pkgdir/usr"
- install -d "$pkgdir/usr/share/doc"
- cp -r docs "$pkgdir/usr/share/doc/zig"
+ cd "${srcdir}/zig-linux-${arch}-${pkgver//_/-}"
+ install -D zig "${pkgdir}/usr/bin/zig"
+ install -D LICENSE "${pkgdir}/usr/share/licenses/zig/LICENSE"
+ cp -r lib "${pkgdir}/usr"
+ install -d "${pkgdir}/usr/share/doc"
+ cp -r docs "${pkgdir}/usr/share/doc/zig"
}