2020-05-18 16:43:12 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-05-24 07:44:35 +03:00
|
|
|
set -e # Exit on any error
|
|
|
|
|
|
|
|
echo "bootstrapping SCHEME=$SCHEME IDRIS2_VERSION=$IDRIS2_VERSION"
|
|
|
|
if [ -z "$SCHEME" ] || [ -z "$IDRIS2_VERSION" ]
|
2020-05-19 23:05:52 +03:00
|
|
|
then
|
2020-05-24 07:44:35 +03:00
|
|
|
echo "Required ENV not set."
|
2020-05-25 15:47:44 +03:00
|
|
|
if [ -z "$SCHEME" ]
|
|
|
|
then
|
|
|
|
echo "Invoke with SCHEME=[name of chez scheme executable]"
|
|
|
|
fi
|
2020-05-19 23:05:52 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Compile the bootstrap scheme
|
2020-05-24 07:44:35 +03:00
|
|
|
# TODO: Move boot-build to Makefile in bootstrap/Makefile
|
2020-05-18 16:43:12 +03:00
|
|
|
cd bootstrap
|
2020-05-24 07:44:35 +03:00
|
|
|
echo "Building idris2-boot from idris2-boot.ss"
|
2020-05-18 23:10:37 +03:00
|
|
|
${SCHEME} --script compile.ss
|
2020-05-18 18:02:30 +03:00
|
|
|
|
2020-05-19 23:05:52 +03:00
|
|
|
# Put the result in the usual place where the target goes
|
2020-05-18 18:02:30 +03:00
|
|
|
mkdir -p ../build/exec
|
2020-05-20 16:00:15 +03:00
|
|
|
mkdir -p ../build/exec/idris2_app
|
|
|
|
install idris2-boot ../build/exec/idris2
|
2020-05-20 16:33:34 +03:00
|
|
|
install idris2_app/* ../build/exec/idris2_app
|
2020-05-19 23:05:52 +03:00
|
|
|
|
2020-05-19 23:39:36 +03:00
|
|
|
cd ..
|
|
|
|
|
2020-05-24 07:44:35 +03:00
|
|
|
# TODO: Unify with bootstrap-rkt
|
|
|
|
PREFIX=${PWD}/bootstrap
|
2020-05-19 23:05:52 +03:00
|
|
|
|
2020-05-23 15:25:50 +03:00
|
|
|
if [ ${OS} = "windows" ]; then
|
2020-05-24 07:44:35 +03:00
|
|
|
# IDRIS_PREFIX is only used to build IDRIS2_BOOT_PATH
|
2020-05-23 15:25:50 +03:00
|
|
|
IDRIS_PREFIX=$(cygpath -m $PREFIX)
|
2020-05-24 17:17:12 +03:00
|
|
|
SEP=";"
|
2020-05-23 15:25:50 +03:00
|
|
|
else
|
2020-05-24 17:17:12 +03:00
|
|
|
IDRIS_PREFIX=${PREFIX}
|
|
|
|
SEP=":"
|
2020-05-23 15:25:50 +03:00
|
|
|
fi
|
|
|
|
|
2020-05-24 07:44:35 +03:00
|
|
|
BOOT_PATH_BASE=${IDRIS_PREFIX}/idris2-${IDRIS2_VERSION}
|
|
|
|
IDRIS2_BOOT_PATH="${BOOT_PATH_BASE}/prelude${SEP}${BOOT_PATH_BASE}/base${SEP}${BOOT_PATH_BASE}/contrib${SEP}${BOOT_PATH_BASE}/network"
|
2020-05-24 17:17:12 +03:00
|
|
|
|
2020-05-19 23:39:36 +03:00
|
|
|
# Now rebuild everything properly
|
2020-05-24 07:44:35 +03:00
|
|
|
# PREFIX must be the "clean" build root, without cygpath -m
|
|
|
|
# Otherwise, we get 'git: Bad address'
|
2020-05-19 23:39:36 +03:00
|
|
|
echo ${PREFIX}
|
2020-05-19 23:05:52 +03:00
|
|
|
make libs SCHEME=${SCHEME} PREFIX=${PREFIX}
|
|
|
|
make install SCHEME=${SCHEME} PREFIX=${PREFIX}
|
2020-05-20 16:00:15 +03:00
|
|
|
make clean IDRIS2_BOOT=${PREFIX}/bin/idris2
|
|
|
|
make all IDRIS2_BOOT=${PREFIX}/bin/idris2 SCHEME=${SCHEME} IDRIS2_PATH=${IDRIS2_BOOT_PATH}
|
2020-05-21 18:48:26 +03:00
|
|
|
|