29 lines
658 B
Plaintext
29 lines
658 B
Plaintext
|
#!/bin/bash
|
||
|
set -euo pipefail
|
||
|
|
||
|
zigdir=out/zig-x86_64-linux-musl-baseline
|
||
|
|
||
|
if [[ ! "$PWD" =~ /zig-bootstrap$ ]]; then
|
||
|
>&2 echo "expected to be in zig-bootstrap directory. Bailing"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
|
||
|
if [[ ! -f "$zigdir/bin/zig" ]]; then
|
||
|
>&2 echo "$zigdir/bin/zig not found. Please run:"
|
||
|
>&2 echo " ./build -j\$(nproc) x86_64-linux-musl baseline"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
pushd "$zigdir"
|
||
|
vsn=$(bin/zig version)
|
||
|
outdir="zig-linux-x86_64-$vsn"
|
||
|
mkdir -p "$outdir"
|
||
|
cp -r "bin/zig" "$outdir"
|
||
|
cp -r "lib/zig" "$outdir/lib"
|
||
|
tar -cf "$outdir.tar" "$outdir"
|
||
|
xz -vk --fast "$outdir.tar"
|
||
|
popd
|
||
|
|
||
|
echo "$zigdir/$outdir.tar.xz is ready for use"
|