diff options
| author | Michael <mr.michael.racz@gmail.com> | 2011-05-15 18:31:34 +0200 |
|---|---|---|
| committer | Michael <mr.michael.racz@gmail.com> | 2011-05-15 18:31:34 +0200 |
| commit | a1a9f4f1b9f837d71cbe871925437bd7fd2db7ec (patch) | |
| tree | c608a09cf1b2e52f49eb0df62646779d15ada620 /pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin/squeak | |
| parent | b0d63dc95ab5ed4496e0c4b888af06edace456d4 (diff) | |
| download | foop-a1a9f4f1b9f837d71cbe871925437bd7fd2db7ec.tar.gz foop-a1a9f4f1b9f837d71cbe871925437bd7fd2db7ec.tar.bz2 foop-a1a9f4f1b9f837d71cbe871925437bd7fd2db7ec.zip | |
smalltalk pacman added
Diffstat (limited to 'pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin/squeak')
| -rwxr-xr-x | pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin/squeak | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin/squeak b/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin/squeak new file mode 100755 index 0000000..aa67545 --- /dev/null +++ b/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin/squeak | |||
| @@ -0,0 +1,95 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # Launch squeakvm from the command line or a menu script, with a good | ||
| 4 | # plugin path, text encodings and pulseaudio kludge | ||
| 5 | # | ||
| 6 | # Last edited: 2010-04-10 20:04:32 by piumarta on ubuntu | ||
| 7 | |||
| 8 | PATH=/usr/bin:/bin | ||
| 9 | |||
| 10 | realpath () { | ||
| 11 | path="$1" | ||
| 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 | path="${dir}/${path}" | ||
| 18 | done | ||
| 19 | if test -d "${path}"; then | ||
| 20 | (cd "${path}" && pwd -P) | ||
| 21 | else | ||
| 22 | dir=`dirname "${path}"` | ||
| 23 | file=`basename "${path}"` | ||
| 24 | (cd "${dir}" && echo "`pwd -P`/${file}") | ||
| 25 | fi | ||
| 26 | } | ||
| 27 | |||
| 28 | bindir=`realpath "${0}"` | ||
| 29 | bindir=`dirname "${bindir}"` | ||
| 30 | prefix=`dirname "${bindir}"` | ||
| 31 | libdir="${prefix}/lib/squeak" | ||
| 32 | plgdir="${libdir}/4.0.3-2202" | ||
| 33 | useoss="true" | ||
| 34 | vm="squeakvm" | ||
| 35 | plugins="" | ||
| 36 | wrapper="" | ||
| 37 | |||
| 38 | for opt in $*; do | ||
| 39 | case ${opt} in | ||
| 40 | -vm-sound*) useoss="false";; | ||
| 41 | -vm) case "$2" in sound*) useoss="false"; esac;; | ||
| 42 | esac | ||
| 43 | done | ||
| 44 | |||
| 45 | # find the vm and set the plugin path | ||
| 46 | |||
| 47 | if test -x "${plgdir}/${vm}"; then # bin/squeak -> lib/squeak/x.y-z/squeakvm | ||
| 48 | vm="${plgdir}/${vm}" | ||
| 49 | plugins="${plgdir}" | ||
| 50 | elif test -x "${bindir}/${vm}"; then # bld/squeak -> bld/squeakvm | ||
| 51 | vm="${bindir}/${vm}" | ||
| 52 | plugins="${bindir}/%n" | ||
| 53 | elif test -x `which ${vm}`; then | ||
| 54 | vm=`which ${vm}` | ||
| 55 | plugins="" | ||
| 56 | else | ||
| 57 | echo "cannot find ${vm}" >&2 | ||
| 58 | exit 1 | ||
| 59 | fi | ||
| 60 | |||
| 61 | # command-line overrides environment, so communicate anything we decide here via the environment | ||
| 62 | |||
| 63 | if test -z "${SQUEAK_PATHENC}"; then SQUEAK_PATHENC="UTF-8"; export SQUEAK_PATHENC; fi | ||
| 64 | if test -z "${SQUEAK_ENCODING}"; then SQUEAK_ENCODING="UTF-8"; export SQUEAK_ENCODING; fi | ||
| 65 | |||
| 66 | if test -z "${SQUEAK_PLUGINS}"; then | ||
| 67 | if test -n "${plugins}"; then | ||
| 68 | SQUEAK_PLUGINS="${plugins}" | ||
| 69 | export SQUEAK_PLUGINS | ||
| 70 | fi | ||
| 71 | fi | ||
| 72 | |||
| 73 | # deal with pulseaudio if it is running | ||
| 74 | |||
| 75 | if test -z "${SQUEAK_VM}"; then | ||
| 76 | if ${useoss}; then | ||
| 77 | if pulseaudio --check 2>/dev/null; then | ||
| 78 | if padsp true 2>/dev/null; then | ||
| 79 | wrapper="padsp" | ||
| 80 | SQUEAK_VM="sound-OSS" | ||
| 81 | export SQUEAK_VM | ||
| 82 | fi | ||
| 83 | fi | ||
| 84 | fi | ||
| 85 | fi | ||
| 86 | |||
| 87 | # fix broken locales | ||
| 88 | |||
| 89 | if test -z "$LC_ALL"; then | ||
| 90 | LC_ALL="$LANG" | ||
| 91 | export LC_ALL | ||
| 92 | fi | ||
| 93 | |||
| 94 | # run the vm | ||
| 95 | exec ${wrapper} "${vm}" "$@" | ||
