build: add freebsd support to zig wrapper

This commit is contained in:
CJ van den Berg 2024-06-13 12:15:34 +02:00
parent af68d4386d
commit 6adda64efd

8
zig
View file

@ -13,6 +13,11 @@ if [ "$OS" == "Linux" ] ; then
OS=linux OS=linux
elif [ "$OS" == "Darwin" ] ; then elif [ "$OS" == "Darwin" ] ; then
OS=macos OS=macos
elif [ "$OS" == "FreeBSD" ] ; then
OS=freebsd
if [ "$ARCH" == "amd64" ] ; then
ARCH=x86_64
fi
fi fi
if [ "$ARCH" == "arm64" ] ; then if [ "$ARCH" == "arm64" ] ; then
@ -41,6 +46,9 @@ get_zig() {
mkdir -p "$ZIGDIR" mkdir -p "$ZIGDIR"
cd "$ZIGDIR" cd "$ZIGDIR"
TARBALL="https://ziglang.org/builds/$ZIGVER.tar.xz" TARBALL="https://ziglang.org/builds/$ZIGVER.tar.xz"
if [ "$OS" == "freebsd" ] ; then
TARBALL="https://ziglang.org/download/$VERSION/$ZIGVER.tar.xz"
fi
if [ ! -d "$ZIGVER" ] ; then if [ ! -d "$ZIGVER" ] ; then
curl "$TARBALL" | tar -xJ curl "$TARBALL" | tar -xJ