2023-03-15 05:39:19 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2023-03-28 04:54:20 +00:00
|
|
|
# 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"
|
2023-03-24 05:36:20 +00:00
|
|
|
uxnasm taro-ls.tal taro-ls
|
2023-03-28 04:54:20 +00:00
|
|
|
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
|
2023-03-15 05:39:19 +00:00
|
|
|
|
2023-03-28 04:54:20 +00:00
|
|
|
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
|