[squeak-dev] International text input on X11
Yoshiki Ohshima
Yoshiki.Ohshima at acm.org
Wed May 25 22:58:04 UTC 2016
On Wed, May 25, 2016 at 11:52 AM, Yoshiki Ohshima
<Yoshiki.Ohshima at acm.org> wrote:
> On Wed, May 25, 2016 at 10:02 AM, tim Rowledge <tim at rowledge.org> wrote:
>> It may have already been mentioned but just in case - on the unix builds (at least for Cog) the built vm is moved to the ‘products’ directory. For example on a Pi you build in ………./Cog/build.linux32ARM/squeak.cog.spur and find the completed (hopefully!) vm in ………../Cog/products/cogspurlinuxhtARM which you then copy to your Pi working directory (say, /home/pi/Scratch) and run with ./cogspurlinuxhtARM/squeak -vm-sound-demented my.image or similar.
>
> Right. The modified version of scratch script I made can take the
> --vm option that works so I can run the one in the products directory.
In any case, this is the current scratch script that works with the
new scheme of passing -compositioninput flag without needing the
display module spec.
--
-- Yoshiki
-------------- next part --------------
*** /usr/bin/scratch 2016-05-02 18:38:55.000000000 +0000
--- scratch 2016-05-25 22:50:37.614585930 +0000
***************
*** 5,11 ****
# Adapted by: Miriam Ruiz, Alex Bradbury, tim at Rowledge.org
# tim - trying to simplify a bit but good grief, shell script is incomprehensible
! VM="/usr/bin/squeak"
IMAGE="/usr/share/scratch/NuScratch02052016.image"
IMOPTIONS=""
DOCUMENT=""
--- 5,11 ----
# Adapted by: Miriam Ruiz, Alex Bradbury, tim at Rowledge.org
# tim - trying to simplify a bit but good grief, shell script is incomprehensible
! VM=`echo /usr/lib/squeak/5.0-*/squeak|sort -r | head -1`
IMAGE="/usr/share/scratch/NuScratch02052016.image"
IMOPTIONS=""
DOCUMENT=""
***************
*** 26,32 ****
{
echo "Usage: scratch [--param value] [-vmopt value] [arg value]"
echo " where --param is --vm, --image, or --document;"
- echo " -vmopt is an option passed to the Squeak VM;"
echo " and args are passed to the Squeak image."
}
--- 26,31 ----
***************
*** 56,62 ****
*) DOCUMENT="$PWD/$2"
;;
esac
! shift
;;
--image)
case "$2" in
--- 55,61 ----
*) DOCUMENT="$PWD/$2"
;;
esac
! shift
;;
--image)
case "$2" in
***************
*** 65,71 ****
*) IMAGE="$PWD/$2"
;;
esac
! shift
;;
--vm)
case "$2" in
--- 64,74 ----
*) IMAGE="$PWD/$2"
;;
esac
! shift
! ;;
! -vmopt)
! VMOPTIONS="$VMOPTIONS $2"
! shift
;;
--vm)
case "$2" in
***************
*** 76,84 ****
esac
shift
;;
- -*) VMOPTIONS="$VMOPTIONS $1 $2"
- shift
- ;;
*) IMOPTIONS="$IMOPTIONS $1 $2"
shift
;;
--- 79,84 ----
***************
*** 101,112 ****
PIGPIOD_ACTIVE=$?
sudo systemctl start pigpiod
# VM, Image, and Document are non-optional
# Document has to be present even if empty for IMOPTIONS to work
! echo Executing: $WRAPPER "$VM" "$IMAGE" "$DOCUMENT" $IMOPTIONS
! $WRAPPER "$VM" "$IMAGE" "$DOCUMENT" $IMOPTIONS
if [ $PIGPIOD_ACTIVE -ne 0 ]; then
sudo systemctl stop pigpiod
fi
-
--- 101,139 ----
PIGPIOD_ACTIVE=$?
sudo systemctl start pigpiod
+
+ BIN=`/usr/bin/dirname $VM`
+ # At least on linux LD_LIBRARY_PATH's components must be absolute path names
+ case "$BIN" in
+ /*) PLUGINS="$BIN";;
+ *) PLUGINS="`pwd`/$BIN"
+ esac
+
+ # On some linuxes there multiple versions of the C library. If the image uses
+ # libc (e.g. through the FFI) then it must use the same version that the VM uses
+ # and so it should take precedence over /lib libc. This is done by setting
+ # LD_LIBRARY_PATH appropriately, based on ldd's idea of the libc use by the VM.
+ LIBC_SO="`/usr/bin/ldd "$BIN/squeak" | /bin/fgrep /libc. | sed 's/^.*=> \([^ ]*\).*/\1/'`"
+ case "$LIBC_SO" in
+ /lib/arm-linux-gnueabihf/libc*) \
+ SVMLLP="/lib/arm-linux-gnueabihf:/lib:/usr/lib/arm-linux-gnueabihf:/usr/lib";;
+ "") case `/bin/uname -m || /usr/bin/uname -m` in
+ *) echo "/usr/bin/ldd didn't produce any output. Can't infer base LD_LIBRARY_PATH. Aborting." 1>&2
+ esac
+ exit 1;;
+ *) echo "Can't infer base LD_LIBRARY_PATH. Aborting. Try adding a line for $LIBC_SO to $0. Please report your edit to squeak vm-dev." 1>&2
+ exit 1
+ esac
+
+ if echo $XMODIFIERS | grep '@im=' > /dev/null; then
+ VMOPTIONS="$VMOPTIONS -compositioninput"
+ fi
+
# VM, Image, and Document are non-optional
# Document has to be present even if empty for IMOPTIONS to work
! echo Executing: env LD_LIBRARY_PATH="$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH}" $WRAPPER $VM $VMOPTIONS $IMAGE $DOCUMENT $IMOPTIONS
! env LD_LIBRARY_PATH="$PLUGINS:$SVMLLP:${LD_LIBRARY_PATH}" $WRAPPER "$VM" $VMOPTIONS "$IMAGE" "$DOCUMENT" $IMOPTIONS
if [ $PIGPIOD_ACTIVE -ne 0 ]; then
sudo systemctl stop pigpiod
fi
More information about the Squeak-dev
mailing list
|