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: 2009-09-18 13:14:40 by piumarta on ubuntu.piumarta.com
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,.* -> ,,'`
19
if test -d "${path}"; then
20
(cd "${path}" && pwd -P)
22
(cd `dirname "${path}"` && echo "`pwd -P`/`basename "${path}"`")
26
bindir=`realpath "${0}"`
27
bindir=`dirname "${bindir}"`
28
prefix=`dirname "${bindir}"`
29
libdir="${prefix}/lib/squeak"
30
plgdir="${libdir}/3.11.13-"
38
-vm-sound*) useoss="false";;
39
-vm) case "$2" in sound*) useoss="false"; esac;;
43
# find the vm and set the plugin path
45
if test -x "${plgdir}/${vm}"; then # bin/squeak -> lib/squeak/x.y-z/squeakvm
48
elif test -x "${bindir}/${vm}"; then # bld/squeak -> bld/squeakvm
50
plugins="${bindir}/%n"
51
elif test -x `which ${vm}`; then
55
echo "cannot find ${vm}" >&2
59
# command-line overrides environment, so communicate anything we decide here via the environment
61
if test -z "${SQUEAK_PATHENC}"; then SQUEAK_PATHENC="UTF-8"; export SQUEAK_PATHENC; fi
62
if test -z "${SQUEAK_ENCODING}"; then SQUEAK_ENCODING="UTF-8"; export SQUEAK_ENCODING; fi
64
if test -z "${SQUEAK_PLUGINS}"; then
65
if test -n "${plugins}"; then
66
SQUEAK_PLUGINS="${plugins}"
71
# deal with pulseaudio if it is running
73
if test -z "${SQUEAK_VM}"; then
75
if pulseaudio --check 2>/dev/null; then
76
if padsp true 2>/dev/null; then
89
exec ${wrapper} "${vm}" "$@"