From a1a9f4f1b9f837d71cbe871925437bd7fd2db7ec Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 15 May 2011 18:31:34 +0200 Subject: smalltalk pacman added --- .../Contents/Linux-i686/bin/squeak | 95 +++++++++++++++++++ .../Contents/Linux-i686/bin/squeak.sh | 101 +++++++++++++++++++++ 2 files changed, 196 insertions(+) create mode 100755 pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin/squeak create mode 100755 pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin/squeak.sh (limited to 'pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin') 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 @@ +#!/bin/sh +# +# Launch squeakvm from the command line or a menu script, with a good +# plugin path, text encodings and pulseaudio kludge +# +# Last edited: 2010-04-10 20:04:32 by piumarta on ubuntu + +PATH=/usr/bin:/bin + +realpath () { + path="$1" + while test -L "${path}"; do + dir=`dirname "${path}"` + dir=`cd "${dir}" && pwd -P` + path=`basename "${path}"` + path=`ls -l "${dir}/${path}" | sed 's,.* -> ,,'` + path="${dir}/${path}" + done + if test -d "${path}"; then + (cd "${path}" && pwd -P) + else + dir=`dirname "${path}"` + file=`basename "${path}"` + (cd "${dir}" && echo "`pwd -P`/${file}") + fi +} + +bindir=`realpath "${0}"` +bindir=`dirname "${bindir}"` +prefix=`dirname "${bindir}"` +libdir="${prefix}/lib/squeak" +plgdir="${libdir}/4.0.3-2202" +useoss="true" +vm="squeakvm" +plugins="" +wrapper="" + +for opt in $*; do + case ${opt} in + -vm-sound*) useoss="false";; + -vm) case "$2" in sound*) useoss="false"; esac;; + esac +done + +# find the vm and set the plugin path + +if test -x "${plgdir}/${vm}"; then # bin/squeak -> lib/squeak/x.y-z/squeakvm + vm="${plgdir}/${vm}" + plugins="${plgdir}" +elif test -x "${bindir}/${vm}"; then # bld/squeak -> bld/squeakvm + vm="${bindir}/${vm}" + plugins="${bindir}/%n" +elif test -x `which ${vm}`; then + vm=`which ${vm}` + plugins="" +else + echo "cannot find ${vm}" >&2 + exit 1 +fi + +# command-line overrides environment, so communicate anything we decide here via the environment + +if test -z "${SQUEAK_PATHENC}"; then SQUEAK_PATHENC="UTF-8"; export SQUEAK_PATHENC; fi +if test -z "${SQUEAK_ENCODING}"; then SQUEAK_ENCODING="UTF-8"; export SQUEAK_ENCODING; fi + +if test -z "${SQUEAK_PLUGINS}"; then + if test -n "${plugins}"; then + SQUEAK_PLUGINS="${plugins}" + export SQUEAK_PLUGINS + fi +fi + +# deal with pulseaudio if it is running + +if test -z "${SQUEAK_VM}"; then + if ${useoss}; then + if pulseaudio --check 2>/dev/null; then + if padsp true 2>/dev/null; then + wrapper="padsp" + SQUEAK_VM="sound-OSS" + export SQUEAK_VM + fi + fi + fi +fi + +# fix broken locales + +if test -z "$LC_ALL"; then + LC_ALL="$LANG" + export LC_ALL +fi + +# run the vm +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 @@ +#!/bin/sh +# +# Launch squeak from a menu, prompting for and/or installing an image +# +# Last edited: 2010-04-09 04:35:35 by piumarta on ubuntu + +PATH=/usr/bin:/bin + +if pwd -P 2>/dev/null 1>&2; then pwd="pwd -P"; else pwd="pwd"; fi + +me=`basename $0` +bindir=`dirname $0` +bindir=`cd ${bindir}; ${pwd}` +prefix=`dirname ${bindir}` +libdir="${prefix}/lib/squeak" +vm="squeak" + +# find a way to display dialogues + +if test -n "$DISPLAY" -a -x "`which kdialog 2>/dev/null`"; then + error () { kdialog --error "${me}: $*"; exit 1; } + confirm () { if kdialog --yesno "${1} ${2}?"; then result="${2}"; else result=""; fi; } + chooseItem () { title="$1"; shift; result=`kdialog --combobox "${title}" $*`; } + findFile () { result=`kdialog --title "$1" --getopenfilename . '*.image'`; } + findDirectory () { result=`kdialog --title "$1" --getexistingdirectory .`; } +elif [ -n "$DISPLAY" -a -x "`which zenity 2>/dev/null`" ]; then + error () { zenity --error --text "${me}: $*"; exit 1; } + confirm () { if zenity --question --text="${1} ${2}?"; then result="${2}"; else result=""; fi; } + chooseItem () { title="$1"; shift; result=`zenity --title "${title}" --list --column Images $*`; } + findFile () { result=`zenity --title "$1" --file-selection --file-filter='*.image'`; } + findDirectory () { result=`zenity --title "$1" --file-selection --directory`; } +else + error () { echo "${me}: $*" >&2; exit 1; } + confirm () { error "this cannot happen"; } + chooseItem () { error "this cannot happen"; } + findFile () { error "no image name specified"; } + findDirectory () { error "this cannot happen"; } +fi + +# succeed if there are two or more arguments + +plural () { test -n "$2"; } + +# find the VM + +if test -x "${bindir}/${vm}"; then + vm="${bindir}/${vm}" +elif test -x "`which ${vm} 2>/dev/null`"; then + vm="`which ${vm} 2>/dev/null`" +else + error "Cannot find ${vm}" +fi + +# if we have arguments then assume an image name was given or we came +# from a command line + +if test $# -gt 0; then + exec "${vm}" "$@" +fi + +findFile "Choose a saved image to resume or cancel to install a new one" + +if test -z "${result}"; then + images="" + if test -d "${libdir}"; then + images=`cd "${libdir}"; ls *.image 2>/dev/null` + fi + if test -z "${images}"; then + error "no image name specified and no images found in ${libdir}" + exit 1 + fi + if plural ${images}; then + chooseItem "Choose an image to install" ${images} + else + confirm "Install image" ${images} + fi + if test -z "${result}"; then + exit 0 + fi + image=${result} + changes=`basename ${image} .image`.changes + findDirectory "Choose a destination directory for the image" + if test -z "${result}"; then + exit 0 + fi + if test -e "${result}/${image}"; then + confirm "Overwrite existing ${image} in" "${result}" + if test -z "${result}"; then + exit 0; + fi + fi + cp -p "${libdir}/${image}" "${result}/." + cp -p "${libdir}/${changes}" "${result}/." + ln -s "${libdir}"/*.sources "${result}/." + image="${result}/${image}" +else + image="${result}" +fi + +cd "`dirname ${image}`" +exec "${vm}" "`basename ${image}`" -- cgit v1.2.3