diff options
Diffstat (limited to 'pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin')
| -rwxr-xr-x | pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin/squeak | 95 | ||||
| -rwxr-xr-x | pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin/squeak.sh | 101 |
2 files changed, 196 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}" "$@" | ||
diff --git a/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin/squeak.sh b/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin/squeak.sh new file mode 100755 index 0000000..64a8114 --- /dev/null +++ b/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin/squeak.sh | |||
| @@ -0,0 +1,101 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # Launch squeak from a menu, prompting for and/or installing an image | ||
| 4 | # | ||
| 5 | # Last edited: 2010-04-09 04:35:35 by piumarta on ubuntu | ||
| 6 | |||
| 7 | PATH=/usr/bin:/bin | ||
| 8 | |||
| 9 | if pwd -P 2>/dev/null 1>&2; then pwd="pwd -P"; else pwd="pwd"; fi | ||
| 10 | |||
| 11 | me=`basename $0` | ||
| 12 | bindir=`dirname $0` | ||
| 13 | bindir=`cd ${bindir}; ${pwd}` | ||
| 14 | prefix=`dirname ${bindir}` | ||
| 15 | libdir="${prefix}/lib/squeak" | ||
| 16 | vm="squeak" | ||
| 17 | |||
| 18 | # find a way to display dialogues | ||
| 19 | |||
| 20 | if test -n "$DISPLAY" -a -x "`which kdialog 2>/dev/null`"; then | ||
| 21 | error () { kdialog --error "${me}: $*"; exit 1; } | ||
| 22 | confirm () { if kdialog --yesno "${1} ${2}?"; then result="${2}"; else result=""; fi; } | ||
| 23 | chooseItem () { title="$1"; shift; result=`kdialog --combobox "${title}" $*`; } | ||
| 24 | findFile () { result=`kdialog --title "$1" --getopenfilename . '*.image'`; } | ||
| 25 | findDirectory () { result=`kdialog --title "$1" --getexistingdirectory .`; } | ||
| 26 | elif [ -n "$DISPLAY" -a -x "`which zenity 2>/dev/null`" ]; then | ||
| 27 | error () { zenity --error --text "${me}: $*"; exit 1; } | ||
| 28 | confirm () { if zenity --question --text="${1} ${2}?"; then result="${2}"; else result=""; fi; } | ||
| 29 | chooseItem () { title="$1"; shift; result=`zenity --title "${title}" --list --column Images $*`; } | ||
| 30 | findFile () { result=`zenity --title "$1" --file-selection --file-filter='*.image'`; } | ||
| 31 | findDirectory () { result=`zenity --title "$1" --file-selection --directory`; } | ||
| 32 | else | ||
| 33 | error () { echo "${me}: $*" >&2; exit 1; } | ||
| 34 | confirm () { error "this cannot happen"; } | ||
| 35 | chooseItem () { error "this cannot happen"; } | ||
| 36 | findFile () { error "no image name specified"; } | ||
| 37 | findDirectory () { error "this cannot happen"; } | ||
| 38 | fi | ||
| 39 | |||
| 40 | # succeed if there are two or more arguments | ||
| 41 | |||
| 42 | plural () { test -n "$2"; } | ||
| 43 | |||
| 44 | # find the VM | ||
| 45 | |||
| 46 | if test -x "${bindir}/${vm}"; then | ||
| 47 | vm="${bindir}/${vm}" | ||
| 48 | elif test -x "`which ${vm} 2>/dev/null`"; then | ||
| 49 | vm="`which ${vm} 2>/dev/null`" | ||
| 50 | else | ||
| 51 | error "Cannot find ${vm}" | ||
| 52 | fi | ||
| 53 | |||
| 54 | # if we have arguments then assume an image name was given or we came | ||
| 55 | # from a command line | ||
| 56 | |||
| 57 | if test $# -gt 0; then | ||
| 58 | exec "${vm}" "$@" | ||
| 59 | fi | ||
| 60 | |||
| 61 | findFile "Choose a saved image to resume or cancel to install a new one" | ||
| 62 | |||
| 63 | if test -z "${result}"; then | ||
| 64 | images="" | ||
| 65 | if test -d "${libdir}"; then | ||
| 66 | images=`cd "${libdir}"; ls *.image 2>/dev/null` | ||
| 67 | fi | ||
| 68 | if test -z "${images}"; then | ||
| 69 | error "no image name specified and no images found in ${libdir}" | ||
| 70 | exit 1 | ||
| 71 | fi | ||
| 72 | if plural ${images}; then | ||
| 73 | chooseItem "Choose an image to install" ${images} | ||
| 74 | else | ||
| 75 | confirm "Install image" ${images} | ||
| 76 | fi | ||
| 77 | if test -z "${result}"; then | ||
| 78 | exit 0 | ||
| 79 | fi | ||
| 80 | image=${result} | ||
| 81 | changes=`basename ${image} .image`.changes | ||
| 82 | findDirectory "Choose a destination directory for the image" | ||
| 83 | if test -z "${result}"; then | ||
| 84 | exit 0 | ||
| 85 | fi | ||
| 86 | if test -e "${result}/${image}"; then | ||
| 87 | confirm "Overwrite existing ${image} in" "${result}" | ||
| 88 | if test -z "${result}"; then | ||
| 89 | exit 0; | ||
| 90 | fi | ||
| 91 | fi | ||
| 92 | cp -p "${libdir}/${image}" "${result}/." | ||
| 93 | cp -p "${libdir}/${changes}" "${result}/." | ||
| 94 | ln -s "${libdir}"/*.sources "${result}/." | ||
| 95 | image="${result}/${image}" | ||
| 96 | else | ||
| 97 | image="${result}" | ||
| 98 | fi | ||
| 99 | |||
| 100 | cd "`dirname ${image}`" | ||
| 101 | exec "${vm}" "`basename ${image}`" | ||
