From 80afd88b0a6db976c2445cce68b087838bc29484 Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Mon, 13 Mar 2023 19:46:19 -0400 Subject: [PATCH] +ziglang.org (#73) * +ziglang.org * use vendored bins --- projects/ziglang.org/package.yml | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 projects/ziglang.org/package.yml diff --git a/projects/ziglang.org/package.yml b/projects/ziglang.org/package.yml new file mode 100644 index 00000000..8f8c3229 --- /dev/null +++ b/projects/ziglang.org/package.yml @@ -0,0 +1,51 @@ +distributable: + url: https://github.com/ziglang/zig/archive/refs/tags/{{version}}.tar.gz + strip-components: 1 + +versions: + github: ziglang/zig/tags + +warnings: + - vendored + +#FIXME proper system for re-using pre-built binaries +# we must require the vendor to provide signatures against a published public +# key. If they don’t then really we should build ourselves or warn the user +# about the fact. +# The thing is, we trust the sources implicitly currently because signing is +# so rare. The only way wide spread signing will occur is via our protocol. + +build: + dependencies: + curl.se: '*' + gnu.org/tar: '*' + tukaani.org/xz: '*' + script: | + case "{{hw.platform}}+{{hw.arch}}" in + darwin+aarch64) PLATFORM="macos-aarch64" ;; + darwin+x86-64) PLATFORM="macos-x86_64" ;; + linux+aarch64) PLATFORM="linux-aarch64" ;; + linux+x86-64) PLATFORM="linux-x86_64" ;; + esac + + curl -Lfo zig.tar.xz "https://ziglang.org/download/{{ version }}/zig-${PLATFORM}-{{ version }}.tar.xz" + tar Jxf zig.tar.xz + + mkdir -p "{{ prefix }}/bin" + mv zig-${PLATFORM}-{{ version }}/zig "{{ prefix }}/bin/zig" + mv zig-${PLATFORM}-{{ version }}/lib "{{ prefix }}" + +test: + script: | + cp $FIXTURE hello.zig + zig build-exe hello.zig + ./hello + fixture: | + const std = @import("std"); + pub fn main() !void { + const stdout = std.io.getStdOut().writer(); + try stdout.print("Hello, world!", .{}); + } + +provides: + - bin/zig