This repository was archived by the owner on Jun 17, 2024. It is now read-only.
File tree 3 files changed +44
-0
lines changed
3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change
1
+ 0.12.0-dev.2541+894493549
Original file line number Diff line number Diff line change @@ -166,6 +166,12 @@ The header file requires `zig.h` which is located in the `lib_dir` output by run
166
166
167
167
This process should improve as https://github.com/ziglang/zig/issues/13528 is resolved.
168
168
169
+ ## Installing Zig
170
+
171
+ Running ` ./zigup ` will download and install the zig version specified in the ` .zig-version ` file. We recommend adding
172
+ ` $HOME/.zig/zig-latest ` to your ` PATH ` .
173
+
174
+
169
175
## Python Library
170
176
171
177
TODO: this library will be made available as a Python library using [ Ziggy Pydust] ( https://github.com/fulcrum-so/ziggy-pydust ) .
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -euo pipefail
4
+
5
+ ZIG_HOME=" ${ZIG_HOME:- $HOME / .zig} "
6
+ ZIG_LATEST=" ${ZIG_HOME} /zig-latest"
7
+ mkdir -p " $ZIG_HOME "
8
+
9
+ VERSION=$( cat " .zig-version" | tr -d ' \n ' )
10
+
11
+ osOut=" $( uname -s) "
12
+ case " ${osOut} " in
13
+ Linux* ) OS=" linux" ;;
14
+ Darwin* ) OS=" macos" ;;
15
+ esac
16
+
17
+ archOut=" $( uname -m) "
18
+ case " ${archOut} " in
19
+ arm64* ) ARCH=" aarch64" ;;
20
+ x86_64* ) ARCH=" x86_64" ;;
21
+ esac
22
+
23
+ ARCH_VERSION=" zig-${OS} -${ARCH} -${VERSION} "
24
+
25
+ if [ ! -d " ${ZIG_HOME} /${ARCH_VERSION} " ]
26
+ then
27
+ echo " Downloading Zig version $VERSION "
28
+ curl -s -L " https://ziglang.org/builds/${ARCH_VERSION} .tar.xz" | tar -x -J -C " ${ZIG_HOME} "
29
+ else
30
+ echo " Zig version $VERSION already installed"
31
+ fi
32
+
33
+ # Always update the symlink to the requested version
34
+ rm -f " $ZIG_LATEST "
35
+ ln -s " ${ZIG_HOME} /${ARCH_VERSION} " " $ZIG_LATEST "
36
+
37
+ echo " Add ${ZIG_LATEST} to the \$ PATH"
You can’t perform that action at this time.
0 commit comments