3
# Launch squeakvm from the command line or a menu script, with a good
4
# plugin path, text encodings and pulseaudio kludge
6
# Last edited: 2010-05-13 14:15:38 by piumarta on emilia-2.local
12
while test -L "${path}"; do
13
dir=`dirname "${path}"`
14
dir=`cd "${dir}" && pwd -P`
15
path=`basename "${path}"`
16
path=`ls -l "${dir}/${path}" | sed 's,.* -> ,,'`
17
if test `expr "${path}" : "/"` -eq 0; then
21
if test -d "${path}"; then
22
(cd "${path}" && pwd -P)
24
dir=`dirname "${path}"`
25
base=`basename "${path}"`
26
(cd "${dir}" && echo "`pwd -P`/${base}")
30
bindir=`realpath "${0}"`
31
bindir=`dirname "${bindir}"`
32
prefix=`dirname "${bindir}"`
33
libdir="${prefix}/lib/squeak"
34
plgdir="${libdir}/[version]"
42
-vm-sound*) useoss="false";;
43
-vm) case "$2" in sound*) useoss="false"; esac;;
47
# find the vm and set the plugin path
49
if test -x "${plgdir}/${vm}"; then # bin/squeak -> lib/squeak/x.y-z/squeakvm
52
elif test -x "${bindir}/${vm}"; then # bld/squeak -> bld/squeakvm
54
plugins="${bindir}/%n"
55
elif test -x `which ${vm}`; then
59
echo "cannot find ${vm}" >&2
63
# command-line overrides environment, so communicate anything we decide here via the environment
65
if test -z "${SQUEAK_PATHENC}"; then SQUEAK_PATHENC="UTF-8"; export SQUEAK_PATHENC; fi
66
if test -z "${SQUEAK_ENCODING}"; then SQUEAK_ENCODING="UTF-8"; export SQUEAK_ENCODING; fi
68
if test -z "${SQUEAK_PLUGINS}"; then
69
if test -n "${plugins}"; then
70
SQUEAK_PLUGINS="${plugins}"
75
# deal with pulseaudio if it is running
77
if test -z "${SQUEAK_VM}"; then
79
if pulseaudio --check 2>/dev/null; then
80
if padsp true 2>/dev/null; then
91
if test -z "$LC_ALL"; then
98
if test "0$SQUEAK_DEBUG" -gt "0"; then
105
exec ${wrapper} "${vm}" "$@"