29 lines
668 B
Bash
Executable File
29 lines
668 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
zigdir=out/zig-x86_64-linux-musl-x86_64_v3
|
|
|
|
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 x86_64_v3"
|
|
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 -9 -T0 "$outdir.tar"
|
|
popd
|
|
|
|
echo "$zigdir/$outdir.tar.xz is ready for use"
|