summaryrefslogtreecommitdiffstats
path: root/pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin
diff options
context:
space:
mode:
authorMichael <mr.michael.racz@gmail.com>2011-05-15 18:31:34 +0200
committerMichael <mr.michael.racz@gmail.com>2011-05-15 18:31:34 +0200
commita1a9f4f1b9f837d71cbe871925437bd7fd2db7ec (patch)
treec608a09cf1b2e52f49eb0df62646779d15ada620 /pacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin
parentb0d63dc95ab5ed4496e0c4b888af06edace456d4 (diff)
downloadfoop-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')
-rwxr-xr-xpacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin/squeak95
-rwxr-xr-xpacman-smalltalk/Squeak 4.1 All-in-One.app/Contents/Linux-i686/bin/squeak.sh101
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
8PATH=/usr/bin:/bin
9
10realpath () {
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
28bindir=`realpath "${0}"`
29bindir=`dirname "${bindir}"`
30prefix=`dirname "${bindir}"`
31libdir="${prefix}/lib/squeak"
32plgdir="${libdir}/4.0.3-2202"
33useoss="true"
34vm="squeakvm"
35plugins=""
36wrapper=""
37
38for opt in $*; do
39 case ${opt} in
40 -vm-sound*) useoss="false";;
41 -vm) case "$2" in sound*) useoss="false"; esac;;
42 esac
43done
44
45# find the vm and set the plugin path
46
47if test -x "${plgdir}/${vm}"; then # bin/squeak -> lib/squeak/x.y-z/squeakvm
48 vm="${plgdir}/${vm}"
49 plugins="${plgdir}"
50elif test -x "${bindir}/${vm}"; then # bld/squeak -> bld/squeakvm
51 vm="${bindir}/${vm}"
52 plugins="${bindir}/%n"
53elif test -x `which ${vm}`; then
54 vm=`which ${vm}`
55 plugins=""
56else
57 echo "cannot find ${vm}" >&2
58 exit 1
59fi
60
61# command-line overrides environment, so communicate anything we decide here via the environment
62
63if test -z "${SQUEAK_PATHENC}"; then SQUEAK_PATHENC="UTF-8"; export SQUEAK_PATHENC; fi
64if test -z "${SQUEAK_ENCODING}"; then SQUEAK_ENCODING="UTF-8"; export SQUEAK_ENCODING; fi
65
66if test -z "${SQUEAK_PLUGINS}"; then
67 if test -n "${plugins}"; then
68 SQUEAK_PLUGINS="${plugins}"
69 export SQUEAK_PLUGINS
70 fi
71fi
72
73# deal with pulseaudio if it is running
74
75if 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
85fi
86
87# fix broken locales
88
89if test -z "$LC_ALL"; then
90 LC_ALL="$LANG"
91 export LC_ALL
92fi
93
94# run the vm
95exec ${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
7PATH=/usr/bin:/bin
8
9if pwd -P 2>/dev/null 1>&2; then pwd="pwd -P"; else pwd="pwd"; fi
10
11me=`basename $0`
12bindir=`dirname $0`
13bindir=`cd ${bindir}; ${pwd}`
14prefix=`dirname ${bindir}`
15libdir="${prefix}/lib/squeak"
16vm="squeak"
17
18# find a way to display dialogues
19
20if 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 .`; }
26elif [ -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`; }
32else
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"; }
38fi
39
40# succeed if there are two or more arguments
41
42plural () { test -n "$2"; }
43
44# find the VM
45
46if test -x "${bindir}/${vm}"; then
47 vm="${bindir}/${vm}"
48elif test -x "`which ${vm} 2>/dev/null`"; then
49 vm="`which ${vm} 2>/dev/null`"
50else
51 error "Cannot find ${vm}"
52fi
53
54# if we have arguments then assume an image name was given or we came
55# from a command line
56
57if test $# -gt 0; then
58 exec "${vm}" "$@"
59fi
60
61findFile "Choose a saved image to resume or cancel to install a new one"
62
63if 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}"
96else
97 image="${result}"
98fi
99
100cd "`dirname ${image}`"
101exec "${vm}" "`basename ${image}`"