summaryrefslogtreecommitdiff
path: root/tools/osx_packaging/script
diff options
context:
space:
mode:
Diffstat (limited to 'tools/osx_packaging/script')
-rwxr-xr-xtools/osx_packaging/script27
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/osx_packaging/script b/tools/osx_packaging/script
new file mode 100755
index 0000000000..d689320d20
--- /dev/null
+++ b/tools/osx_packaging/script
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Author: Aaron Voisine <aaron@voisine.org>
+
+CWD="`dirname \"$0\"`"
+TMP=/tmp/$UID/TemporaryItems
+
+ps -wx -ocommand | grep -e '[X]11' > /dev/null
+if [ "$?" != "0" -a ! -f ~/.xinitrc ]; then
+ echo "rm -f ~/.xinitrc" > ~/.xinitrc
+ sed 's/xterm/# xterm/' /usr/X11R6/lib/X11/xinit/xinitrc >> ~/.xinitrc
+fi
+
+mkdir -p $TMP
+cp -f "$CWD/bin/getdisplay.sh" $TMP
+rm -f $TMP/display
+open-x11 $TMP/getdisplay.sh || \
+open -a XDarwin $TMP/getdisplay.sh || \
+echo ":0" > $TMP/display
+
+while [ "$?" == "0" -a ! -f $TMP/display ]; do sleep 1; done
+export "DISPLAY=`cat $TMP/display`"
+
+ps -wx -ocommand | grep -e '[X]11' > /dev/null || exit 11
+
+cd ~/
+exec "$CWD/bin/exporter" "$@"