50 lines
1.5 KiB
Bash
Executable File
50 lines
1.5 KiB
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
script_dir=$(CDPATH= cd -- "$(dirname "$0")" && pwd)
|
|
repo_root=$(CDPATH= cd -- "$script_dir/../.." && pwd)
|
|
guix_source_dir=${GUIX_SOURCE_DIR:-"$HOME/repos/guix"}
|
|
|
|
if [ ! -d "$guix_source_dir/guix" ]; then
|
|
echo "Guix source tree not found at $guix_source_dir" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ -n "${GUILE_BIN:-}" ]; then
|
|
guile_bin=$GUILE_BIN
|
|
elif command -v guile3 >/dev/null 2>&1; then
|
|
guile_bin=$(command -v guile3)
|
|
elif command -v guile-3.0 >/dev/null 2>&1; then
|
|
guile_bin=$(command -v guile-3.0)
|
|
else
|
|
echo "Unable to find GUILE_BIN, guile3, or guile-3.0 in PATH" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -x "$guile_bin" ]; then
|
|
echo "Guile binary is not executable: $guile_bin" >&2
|
|
exit 1
|
|
fi
|
|
|
|
guile_prefix=$(CDPATH= cd -- "$(dirname "$guile_bin")/.." && pwd)
|
|
guile_lib_dir=$guile_prefix/lib
|
|
if [ -e "$guile_lib_dir/libguile-3.0.so.1" ]; then
|
|
if [ -n "${LD_LIBRARY_PATH:-}" ]; then
|
|
export LD_LIBRARY_PATH="$guile_lib_dir:$LD_LIBRARY_PATH"
|
|
else
|
|
export LD_LIBRARY_PATH="$guile_lib_dir"
|
|
fi
|
|
fi
|
|
|
|
export GUIX_SOURCE_DIR="$guix_source_dir"
|
|
export GUILE_AUTO_COMPILE=${GUILE_AUTO_COMPILE:-0}
|
|
if [ -n "${GUILE_LOAD_PATH:-}" ]; then
|
|
export GUILE_LOAD_PATH="$repo_root/tests/guile/modules:$guix_source_dir:$GUILE_LOAD_PATH"
|
|
else
|
|
export GUILE_LOAD_PATH="$repo_root/tests/guile/modules:$guix_source_dir"
|
|
fi
|
|
|
|
echo "Using Guile: $guile_bin" >&2
|
|
echo "Using LD_LIBRARY_PATH: ${LD_LIBRARY_PATH:-<unset>}" >&2
|
|
exec "$guile_bin" -s "$repo_root/tests/guile/verify-phase1.scm" "$@"
|