diff options
| author | andy5995 <arch_stanton5995@protonmail.com> | 2024-03-10 03:53:44 -0500 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-08-06 01:15:21 -0400 |
| commit | 8882d8be6a7de07d19c1d3908da43cba60f7d37b (patch) | |
| tree | 310cf79e09cbb69eb2167bbbd5c029c8b8fd07c2 /ci | |
| parent | fec6cf6d267ebd7f14e6a1ad78cfa418fd0c68dd (diff) | |
| download | meson-8882d8be6a7de07d19c1d3908da43cba60f7d37b.tar.gz | |
Add Zig to ubuntu-rolling image
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
[Eli: do not add to CI tests as this is only a preparatory PR]
Diffstat (limited to 'ci')
| -rwxr-xr-x | ci/ciimage/ubuntu-rolling/install.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ci/ciimage/ubuntu-rolling/install.sh b/ci/ciimage/ubuntu-rolling/install.sh index e1747034f..63e497073 100755 --- a/ci/ciimage/ubuntu-rolling/install.sh +++ b/ci/ciimage/ubuntu-rolling/install.sh @@ -27,6 +27,7 @@ pkgs=( bindgen itstool openjdk-11-jre + jq ) sed -i '/^Types: deb/s/deb/deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources @@ -58,6 +59,29 @@ source "$HOME/.cargo/env" rustup target add x86_64-pc-windows-gnu rustup target add arm-unknown-linux-gnueabihf +# Zig +# Use the GitHub API to get the latest release information +LATEST_RELEASE=$(wget -qO- "https://api.github.com/repos/ziglang/zig/releases/latest") +ZIGVER=$(echo "$LATEST_RELEASE" | jq -r '.tag_name') +ZIG_BASE="zig-linux-x86_64-$ZIGVER" +wget "https://ziglang.org/download/$ZIGVER/$ZIG_BASE.tar.xz" +tar xf "$ZIG_BASE.tar.xz" +rm -rf "$ZIG_BASE.tar.xz" +cd "$ZIG_BASE" + +# As mentioned in the Zig readme, the binary and files under lib can be copied +# https://github.com/ziglang/zig?tab=readme-ov-file#installation +mv zig /usr/bin +mv lib /usr/lib/zig + +# Copy the LICENSE +mkdir -p /usr/share/doc/zig +cp LICENSE /usr/share/doc/zig + +# Remove what's left of the directory +cd .. +rm -rf "$ZIG_BASE" + # cleanup apt-get -y clean apt-get -y autoclean |
