From 7e8cd9c63c39e61f77ebaaeac2a776a781619ff2 Mon Sep 17 00:00:00 2001 From: Dan Ellis Echavarria <19101das@gmail.com> Date: Wed, 14 Sep 2022 10:01:55 -0500 Subject: [PATCH 1/2] Added 0.9.1 to piston --- packages/zig/0.9.1/build.sh | 10 ++++++++++ packages/zig/0.9.1/compile | 6 ++++++ packages/zig/0.9.1/environment | 4 ++++ packages/zig/0.9.1/metadata.json | 8 ++++++++ packages/zig/0.9.1/run | 4 ++++ packages/zig/0.9.1/test.zig | 6 ++++++ 6 files changed, 38 insertions(+) create mode 100755 packages/zig/0.9.1/build.sh create mode 100644 packages/zig/0.9.1/compile create mode 100644 packages/zig/0.9.1/environment create mode 100644 packages/zig/0.9.1/metadata.json create mode 100644 packages/zig/0.9.1/run create mode 100644 packages/zig/0.9.1/test.zig diff --git a/packages/zig/0.9.1/build.sh b/packages/zig/0.9.1/build.sh new file mode 100755 index 0000000..6caa1ff --- /dev/null +++ b/packages/zig/0.9.1/build.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +mkdir -p bin +cd bin/ + +curl -L "https://ziglang.org/download/0.9.1/zig-linux-x86_64-0.9.1.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.9.1/compile b/packages/zig/0.9.1/compile new file mode 100644 index 0000000..75ee6ba --- /dev/null +++ b/packages/zig/0.9.1/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.9.1/environment b/packages/zig/0.9.1/environment new file mode 100644 index 0000000..a85000c --- /dev/null +++ b/packages/zig/0.9.1/environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# compiler path +export PATH=$PWD/bin:$PATH diff --git a/packages/zig/0.9.1/metadata.json b/packages/zig/0.9.1/metadata.json new file mode 100644 index 0000000..8c02d33 --- /dev/null +++ b/packages/zig/0.9.1/metadata.json @@ -0,0 +1,8 @@ +{ + "language": "zig", + "version": "0.8.0", + "aliases": ["zig"], + "limit_overrides": { + "compile_timeout": 15000 + } +} diff --git a/packages/zig/0.9.1/run b/packages/zig/0.9.1/run new file mode 100644 index 0000000..d96e06f --- /dev/null +++ b/packages/zig/0.9.1/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.9.1/test.zig b/packages/zig/0.9.1/test.zig new file mode 100644 index 0000000..548c703 --- /dev/null +++ b/packages/zig/0.9.1/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 From 17217c050b3da6cd7aa1e061d7a2783a374300d6 Mon Sep 17 00:00:00 2001 From: Dan Ellis Echavarria <19101das@gmail.com> Date: Wed, 14 Sep 2022 10:03:11 -0500 Subject: [PATCH 2/2] Metada update --- packages/zig/0.9.1/metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/zig/0.9.1/metadata.json b/packages/zig/0.9.1/metadata.json index 8c02d33..e7061cd 100644 --- a/packages/zig/0.9.1/metadata.json +++ b/packages/zig/0.9.1/metadata.json @@ -1,6 +1,6 @@ { "language": "zig", - "version": "0.8.0", + "version": "0.9.1", "aliases": ["zig"], "limit_overrides": { "compile_timeout": 15000