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