3 # Modified from: Aaron Voisine <aaron@voisine.org>
6 TMP
=/tmp
/$UID/TemporaryItems
8 version
=`sw_vers -productVersion`
9 if [ "$?" = "0" ]; then
26 # if 10.5 or greater, then all the open-x11 stuff need not occur
27 if ((( $major < 10 )) ||
((( $major == 10)) && (( $minor < 5 )))); then
28 ps
-wx -ocommand |
grep -e '[X]11.app' > /dev
/null
29 if [ "$?" != "0" -a ! -f ~
/.xinitrc
]; then
30 echo "rm -f ~/.xinitrc" > ~
/.xinitrc
31 sed 's/xterm/# xterm/' /usr
/X11R
6/lib
/X11
/xinit
/xinitrc
>> ~
/.xinitrc
35 cat << __END_OF_GETDISPLAY_SCRIPT__ > "$TMP/getdisplay.sh"
39 if [ "\$DISPLAY"x = "x" ]; then
40 echo :0 > "$TMP/display"
42 echo \$DISPLAY > "$TMP/display"
44 __END_OF_GETDISPLAY_SCRIPT__
45 chmod +x
"$TMP/getdisplay.sh"
47 open-x11
$TMP/getdisplay.sh || \
48 open
-a XDarwin
$TMP/getdisplay.sh || \
49 echo ":0" > $TMP/display
51 while [ "$?" = "0" -a ! -f $TMP/display
];
53 #echo "Waiting for display $TMP/display"
56 export "DISPLAY=`cat $TMP/display`"
58 ps
-wx -ocommand |
grep -e '[X]11' > /dev
/null ||
exit 11
61 echo "$@" > /tmp
/arguments.log
62 if echo $1 |
grep -- "^-psn_"; then
66 exec "$CWD/bin/@CPACK_EXECUTABLE_NAME@" "$@" > /tmp
/slicer.output
2>&1