From c0b218f47791117867feb4e5bb53eef6a4e67e9e Mon Sep 17 00:00:00 2001 From: g-w1 <58830309+g-w1@users.noreply.github.com> Date: Tue, 15 Jun 2021 21:25:12 -0400 Subject: [PATCH] update zig to 0.8.0 (#279) zig 0.8.0 got released, so this pr updates it --- packages/zig/0.7.1/build.sh | 2 +- packages/zig/0.8.0/build.sh | 10 ++++++++++ packages/zig/0.8.0/compile | 6 ++++++ packages/zig/0.8.0/environment | 4 ++++ packages/zig/0.8.0/metadata.json | 5 +++++ packages/zig/0.8.0/run | 4 ++++ packages/zig/0.8.0/test.zig | 6 ++++++ 7 files changed, 36 insertions(+), 1 deletion(-) create mode 100755 packages/zig/0.8.0/build.sh create mode 100644 packages/zig/0.8.0/compile create mode 100644 packages/zig/0.8.0/environment create mode 100644 packages/zig/0.8.0/metadata.json create mode 100644 packages/zig/0.8.0/run create mode 100644 packages/zig/0.8.0/test.zig diff --git a/packages/zig/0.7.1/build.sh b/packages/zig/0.7.1/build.sh index 9714794..284214f 100755 --- a/packages/zig/0.7.1/build.sh +++ b/packages/zig/0.7.1/build.sh @@ -7,4 +7,4 @@ curl -L "https://ziglang.org/download/0.7.1/zig-linux-x86_64-0.7.1.tar.xz" -o zi tar xf zig.tar.xz --strip-components=1 rm zig.tar.xz -cd ../ \ No newline at end of file +cd ../ diff --git a/packages/zig/0.8.0/build.sh b/packages/zig/0.8.0/build.sh new file mode 100755 index 0000000..b3bbaf5 --- /dev/null +++ b/packages/zig/0.8.0/build.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +mkdir -p bin +cd bin/ + +curl -L "https://ziglang.org/download/0.8.0/zig-linux-x86_64-0.8.0.tar.xz" -o zig.tar.xz +tar xf zig.tar.xz --strip-components=1 +rm zig.tar.xz + +cd ../ diff --git a/packages/zig/0.8.0/compile b/packages/zig/0.8.0/compile new file mode 100644 index 0000000..75ee6ba --- /dev/null +++ b/packages/zig/0.8.0/compile @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +# optimizing for small programs +rename 's/$/\.zig/' "$@" # Add .zig extension + +zig build-exe -O ReleaseSafe --color off --cache-dir . --global-cache-dir . --name out *.zig diff --git a/packages/zig/0.8.0/environment b/packages/zig/0.8.0/environment new file mode 100644 index 0000000..a85000c --- /dev/null +++ b/packages/zig/0.8.0/environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# compiler path +export PATH=$PWD/bin:$PATH diff --git a/packages/zig/0.8.0/metadata.json b/packages/zig/0.8.0/metadata.json new file mode 100644 index 0000000..7af8ed6 --- /dev/null +++ b/packages/zig/0.8.0/metadata.json @@ -0,0 +1,5 @@ +{ + "language": "zig", + "version": "0.8.0", + "aliases": ["zig"] +} diff --git a/packages/zig/0.8.0/run b/packages/zig/0.8.0/run new file mode 100644 index 0000000..d96e06f --- /dev/null +++ b/packages/zig/0.8.0/run @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +shift # Filename is only used in compile step, so we can take it out here +./out "$@" diff --git a/packages/zig/0.8.0/test.zig b/packages/zig/0.8.0/test.zig new file mode 100644 index 0000000..548c703 --- /dev/null +++ b/packages/zig/0.8.0/test.zig @@ -0,0 +1,6 @@ +const std = @import("std"); + +pub fn main() !void { + const stdout = std.io.getStdOut().writer(); + try stdout.print("OK\n", .{}); +} \ No newline at end of file