taro/build.sh

43 lines
No EOL
1,016 B
Bash
Executable file

#!/bin/sh
# build config into crystal constants
echo "Generating config.cr"
. ./config
cat << END > config.cr
MBOX_ROOT = "${MBOX_ROOT}"
TARO_LIB = "${TARO_LIB}"
TARO_DOWNLOADS = "${TARO_DOWNLOADS}"
UXN_EMU = "${UXN_EMU}"
TARO_ENV = "${TARO_ENV}"
READER_PROG = "${READER_PROG}"
COMPOSE_PROG = "${COMPOSE_PROG}"
END
if ! which ${UXN_EMU}; then
echo "${UXN_EMU} is not in PATH! Beware..."
sleep 1
fi
# build
echo "Building taro-ls"
uxnasm taro-ls.tal taro-ls
echo "Building taro-ctl"
crystal build --release --no-debug -s taro-ctl.cr
# setup TARO_LIB
if [ ${TARO_LIB} != ${PWD} ]; then
mkdir -p ${TARO_LIB}
for x in "taro-ls taro-reader lesskey .theme font.icn taro-ctl taro.svg"; do
if [ -e ${x} ]; then
cp ${x} ${TARO_LIB}
fi
done
echo "TARO_LIB is in ${TARO_LIB}; add it to your PATH or you can just copy taro-ctl there."
fi
if [ "$1" = "desktopfile" ]; then
sed -e "s#TARO_LIB#${TARO_LIB}#g" -e "s#UXN_EMU#${UXN_EMU}#g" taro.desktop > ~/.local/share/applications/taro.desktop
fi