#!/usr/bin/sh
# Installed launcher. Resolve data from the configured installation prefix.
set -eu
plasm_root='/usr/share/plasm'
plasm_native='/usr/lib64/plasm'
export PLASM_GEOMETRY_LIBRARY=${PLASM_GEOMETRY_LIBRARY:-"$plasm_native/libplasm_geometry.so"}
export PLASM_PARSER_LIBRARY=${PLASM_PARSER_LIBRARY:-"$plasm_native/libplasm_parser.so"}
export PLASM_VIEWER_PROGRAM=${PLASM_VIEWER_PROGRAM:-"$plasm_native/plasm_viewer"}
if [ "$#" -eq 0 ]; then
    exec "${RACKET:-racket}" -i -t "$plasm_root/racket/repl.rkt"
fi
case $1 in
    --gui) shift; exec "${RACKET:-racket}" "$plasm_root/gui/main.rkt" "$@" ;;
    --racket) shift; exec "${RACKET:-racket}" -i -t "$plasm_root/racket/repl.rkt" "$@" ;;
    --fl) shift ;;
esac
exec "${RACKET:-racket}" "$plasm_root/racket/main.rkt" "$@"
