build.sh (raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
#!/bin/sh # check we have all dependencies echo "Checking dependencies..." if ! which uxnasm || ! which uxnemu || ! which crystal || ! which mseq ; then echo "dependencies are not met - we need:" echo "- uxnasm" echo "- uxnemu" echo "- crystal" echo "- mblaze" exit 1 fi # 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 # 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}; you can either" echo "- add it to your PATH" echo "- or copy taro-ctl into your PATH" fi cp "$(which uxnemu)" "${TARO_LIB}/${UXN_EMU}" # optionally, fill out desktopfile with proper variables and install it 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 |