diff options
author | nycex | 2021-04-03 16:14:23 +0200 |
---|---|---|
committer | nycex | 2021-04-03 16:14:23 +0200 |
commit | e05a393add9ec74143b99a775b8fff5a4d2d53a6 (patch) | |
tree | ee0fd18bf86a19dae18add1583b3bc511008e87b /PKGBUILD | |
parent | 9e9e52ae4802c574aa842866aab9136328ad6f87 (diff) | |
download | aur-e05a393add9ec74143b99a775b8fff5a4d2d53a6.tar.gz |
create a hacky aur devel package for the zig master builds
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 45 |
1 files changed, 31 insertions, 14 deletions
@@ -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" } |