From fb95a4dbc093e2c863113541e342d53034a1d1ba Mon Sep 17 00:00:00 2001 From: "Vargas, Dan" Date: Thu, 18 Mar 2021 16:45:14 -0500 Subject: [PATCH] pkg(zig-0.7.1): Add zig 0.7.1 --- packages/zig/0.7.1/build.sh | 10 ++++++++++ packages/zig/0.7.1/compile | 4 ++++ packages/zig/0.7.1/environment | 4 ++++ packages/zig/0.7.1/metadata.json | 6 ++++++ packages/zig/0.7.1/run | 4 ++++ packages/zig/0.7.1/test.zig | 6 ++++++ 6 files changed, 34 insertions(+) create mode 100755 packages/zig/0.7.1/build.sh create mode 100644 packages/zig/0.7.1/compile create mode 100644 packages/zig/0.7.1/environment create mode 100644 packages/zig/0.7.1/metadata.json create mode 100644 packages/zig/0.7.1/run create mode 100644 packages/zig/0.7.1/test.zig diff --git a/packages/zig/0.7.1/build.sh b/packages/zig/0.7.1/build.sh new file mode 100755 index 0000000..9714794 --- /dev/null +++ b/packages/zig/0.7.1/build.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +mkdir -p bin +cd bin/ + +curl -L "https://ziglang.org/download/0.7.1/zig-linux-x86_64-0.7.1.tar.xz" -o zig.tar.xz +tar xf zig.tar.xz --strip-components=1 +rm zig.tar.xz + +cd ../ \ No newline at end of file diff --git a/packages/zig/0.7.1/compile b/packages/zig/0.7.1/compile new file mode 100644 index 0000000..af7e9eb --- /dev/null +++ b/packages/zig/0.7.1/compile @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# optimizing for small programs +zig build-exe -O ReleaseSmall --color off --cache-dir . --global-cache-dir . --name out "$@" diff --git a/packages/zig/0.7.1/environment b/packages/zig/0.7.1/environment new file mode 100644 index 0000000..a85000c --- /dev/null +++ b/packages/zig/0.7.1/environment @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# compiler path +export PATH=$PWD/bin:$PATH diff --git a/packages/zig/0.7.1/metadata.json b/packages/zig/0.7.1/metadata.json new file mode 100644 index 0000000..3de611e --- /dev/null +++ b/packages/zig/0.7.1/metadata.json @@ -0,0 +1,6 @@ +{ + "language": "zig", + "version": "0.7.1", + "aliases": ["zig"], + "author": "Dan Vargas " +} diff --git a/packages/zig/0.7.1/run b/packages/zig/0.7.1/run new file mode 100644 index 0000000..d96e06f --- /dev/null +++ b/packages/zig/0.7.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.7.1/test.zig b/packages/zig/0.7.1/test.zig new file mode 100644 index 0000000..548c703 --- /dev/null +++ b/packages/zig/0.7.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