Bindings save release bindings as well as press bindings
[ardour.git] / tools / osx_packaging / script
1 #!/bin/sh
2 #
3 # Author: Aaron Voisine <aaron@voisine.org>
4
5 if [ ! -x /Applications/Utilities/X11.app ] ; then
6     if [ -f /usr/include/X11/X.h ] ; then
7         osascript -e 'tell application "Ardour3"
8 display dialog "You have installed the X11 SDK, but not X11 itself.\
9 Please install X11 before running Ardour" buttons["OK"]
10 end tell'
11     else
12         osascript -e 'tell application "Ardour3"
13 display dialog "Please install X11 before running Ardour" buttons["OK"]
14 end tell'
15     fi
16     exit 1
17 fi
18
19 if [ ! -x /usr/local/bin/jackd -a ! -x /usr/bin/jackd ] ; then
20     osascript -e 'tell application "Ardour3"
21 display dialog "You do not appear to have JACK installed.\nPlease install it before running Ardour" buttons["OK"]
22 end tell'
23     exit 1
24 fi
25
26 CWD="`dirname \"$0\"`"
27 TMP=/tmp/$UID/TemporaryItems
28
29 ps -wx -ocommand | grep -e '[X]11' > /dev/null
30 if [ "$?" != "0" -a ! -f ~/.xinitrc ]; then
31     echo "rm -f ~/.xinitrc" > ~/.xinitrc
32     sed 's/xterm/# xterm/' /usr/X11R6/lib/X11/xinit/xinitrc >> ~/.xinitrc
33 fi
34
35 if uname -r | grep -sq '^9' ; then
36     # leopard will auto-start X11 for us
37     :
38 else 
39     mkdir -p $TMP
40     cp -f "$CWD/bin/getdisplay.sh" $TMP
41     rm -f $TMP/display
42     open-x11 $TMP/getdisplay.sh || \
43         open -a XDarwin $TMP/getdisplay.sh || \
44         echo ":0" > $TMP/display
45
46     while [ "$?" == "0" -a ! -f $TMP/display ]; do sleep 1; done
47     export "DISPLAY=`cat $TMP/display`"
48
49     ps -wx -ocommand | grep -e '[X]11' > /dev/null || exit 11
50 fi
51
52 cd ~/
53 shift
54 exec "$CWD/bin/exporter" "$*"