2021-01-20 23:15:24 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-04-06 17:42:04 +03:00
|
|
|
set -e # exit on any error
|
2021-01-20 23:15:24 +03:00
|
|
|
|
|
|
|
if [ -z "$SCHEME" ] || [ -z "$IDRIS2_VERSION" ]; then
|
2021-04-06 17:42:04 +03:00
|
|
|
echo "Required SCHEME or IDRIS2_VERSION env is not set."
|
2021-01-20 23:15:24 +03:00
|
|
|
if [ -z "$SCHEME" ]; then
|
|
|
|
echo "Invoke with SCHEME=[name of chez scheme executable]"
|
|
|
|
fi
|
|
|
|
exit 1
|
|
|
|
fi
|
2021-04-06 17:42:04 +03:00
|
|
|
echo "Bootstrapping SCHEME=$SCHEME IDRIS2_VERSION=$IDRIS2_VERSION"
|
2021-01-20 23:15:24 +03:00
|
|
|
|
|
|
|
# Compile the bootstrap scheme
|
|
|
|
# TODO: Move boot-build to Makefile in bootstrap/Makefile
|
2021-07-04 05:17:13 +03:00
|
|
|
cd bootstrap-build
|
2021-01-20 23:15:24 +03:00
|
|
|
echo "Building idris2-boot from idris2-boot.ss"
|
2021-07-04 05:17:13 +03:00
|
|
|
${SCHEME} --script ../bootstrap/compile.ss
|
2021-01-20 23:15:24 +03:00
|
|
|
|
|
|
|
# Put the result in the usual place where the target goes
|
|
|
|
mkdir -p ../build/exec
|
|
|
|
mkdir -p ../build/exec/idris2_app
|
2023-12-27 17:14:03 +03:00
|
|
|
|
|
|
|
# we "install" bootstrap/idris2-boot.sh as build/exec/idris2
|
|
|
|
# but with the SCHEME var that we already know at this time
|
|
|
|
# baked into it.
|
|
|
|
echo '#!/bin/sh' >../build/exec/idris2
|
|
|
|
echo "SCHEME=\"${SCHEME}\"" >>../build/exec/idris2
|
|
|
|
cat ../bootstrap/idris2-boot.sh >>../build/exec/idris2
|
|
|
|
chmod +x ../build/exec/idris2
|
|
|
|
|
2021-01-20 23:15:24 +03:00
|
|
|
install idris2_app/* ../build/exec/idris2_app
|
2023-12-27 17:14:03 +03:00
|
|
|
echo 'bootstrap stage 1 complete'
|