2020-05-20 00:56:27 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-05-24 07:44:35 +03:00
|
|
|
set -e # Exit on any error
|
|
|
|
|
|
|
|
echo "bootstrapping IDRIS2_VERSION=$IDRIS2_VERSION"
|
|
|
|
if [ -z "$IDRIS2_VERSION" ]
|
|
|
|
then
|
|
|
|
echo "Required ENV not set."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2020-05-20 00:56:27 +03:00
|
|
|
# Compile the bootstrap scheme
|
|
|
|
cd bootstrap
|
2020-05-24 07:44:35 +03:00
|
|
|
echo "Building idris2-boot from idris2-boot.rkt"
|
2020-05-23 17:52:33 +03:00
|
|
|
raco exe idris2_app/idris2-boot.rkt
|
2020-05-20 00:56:27 +03:00
|
|
|
|
|
|
|
# Put the result in the usual place where the target goes
|
|
|
|
mkdir -p ../build/exec
|
2020-05-23 17:52:33 +03:00
|
|
|
mkdir -p ../build/exec/idris2_app
|
|
|
|
install idris2-rktboot ../build/exec/idris2
|
|
|
|
install idris2_app/* ../build/exec/idris2_app
|
2020-05-20 00:56:27 +03:00
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
2020-05-24 07:44:35 +03:00
|
|
|
PREFIX=${PWD}/bootstrap
|
|
|
|
|
|
|
|
if [ ${OS} = "windows" ]; then
|
|
|
|
# IDRIS_PREFIX is only used to build IDRIS2_BOOT_PATH
|
|
|
|
IDRIS_PREFIX=$(cygpath -m $PREFIX)
|
|
|
|
SEP=";"
|
|
|
|
else
|
|
|
|
IDRIS_PREFIX=${PREFIX}
|
|
|
|
SEP=":"
|
|
|
|
fi
|
|
|
|
|
|
|
|
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-20 00:56:27 +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-20 00:56:27 +03:00
|
|
|
echo ${PREFIX}
|
|
|
|
|
2020-05-24 07:44:35 +03:00
|
|
|
DYLIB_PATH="${PREFIX}/lib"
|
2020-05-23 20:40:57 +03:00
|
|
|
make libs IDRIS2_CG=racket PREFIX=${PREFIX} LD_LIBRARY_PATH=${DYLIB_PATH}
|
|
|
|
make install IDRIS2_CG=racket PREFIX=${PREFIX} LD_LIBRARY_PATH=${DYLIB_PATH}
|
2020-05-20 16:00:15 +03:00
|
|
|
make clean IDRIS2_BOOT=${PREFIX}/bin/idris2 LD_LIBRARY_PATH=${DYLIB_PATH}
|
2020-05-23 20:40:57 +03:00
|
|
|
make all IDRIS2_BOOT=${PREFIX}/bin/idris2 IDRIS2_CG=racket IDRIS2_PATH=${IDRIS2_BOOT_PATH} LD_LIBRARY_PATH=${DYLIB_PATH}
|