| ... | @@ -3,9 +3,9 @@ | ... | @@ -3,9 +3,9 @@ |
| 3 | # It automatically installs a Zig compiler to ./.zig-cache | 3 | # It automatically installs a Zig compiler to ./.zig-cache |
| 4 | # if needed. The output will be in ./zig-out/bin. | 4 | # if needed. The output will be in ./zig-out/bin. |
| 5 | # | 5 | # |
| 6 | # `curl` and `tar` is required in order to download and | 6 | # `curl`, `tar`, and `xz` are required in order to download |
| 7 | # extract Zig, respectively. The rest of the dependencies | 7 | # and extract Zig. The rest of the dependencies are compiled |
| 8 | # are downloaded compiled using the Zig build system. | 8 | # from source using the Zig build system. |
| 9 | cd -- "$(dirname -- "$0")" | 9 | cd -- "$(dirname -- "$0")" |
| 10 | | 10 | |
| 11 | ZIG_VERSION=$(grep .minimum_zig_version build.zig.zon \ | 11 | ZIG_VERSION=$(grep .minimum_zig_version build.zig.zon \ |
| ... | @@ -46,6 +46,7 @@ if [ ! -f "$ZIG" ]; then | ... | @@ -46,6 +46,7 @@ if [ ! -f "$ZIG" ]; then |
| 46 | | 46 | |
| 47 | CURL=$(command -v curl 2>/dev/null) | 47 | CURL=$(command -v curl 2>/dev/null) |
| 48 | TAR=$(command -v tar 2>/dev/null) | 48 | TAR=$(command -v tar 2>/dev/null) |
| | 49 | XZ=$(command -v xz 2>/dev/null) |
| 49 | | 50 | |
| 50 | if [ -z "$CURL" ]; then | 51 | if [ -z "$CURL" ]; then |
| 51 | printf "This script requires 'curl' to be installed.\n" | 52 | printf "This script requires 'curl' to be installed.\n" |
| ... | @@ -53,8 +54,10 @@ if [ ! -f "$ZIG" ]; then | ... | @@ -53,8 +54,10 @@ if [ ! -f "$ZIG" ]; then |
| 53 | if [ -z "$TAR" ]; then | 54 | if [ -z "$TAR" ]; then |
| 54 | printf "This script requires 'tar' to be installed.\n" | 55 | printf "This script requires 'tar' to be installed.\n" |
| 55 | fi | 56 | fi |
| 56 | | 57 | if [ -z "$XZ" ]; then |
| 57 | if [ -z "$CURL" ] || [ -z "$TAR" ]; then | 58 | printf "This script requires 'xz' to be installed.\n" |
| | 59 | fi |
| | 60 | if [ -z "$CURL" ] || [ -z "$TAR" ] || [ -z "$XZ" ]; then |
| 58 | exit 1 | 61 | exit 1 |
| 59 | fi | 62 | fi |
| 60 | | 63 | |