cosmetic fix to OSX packaging temp file
[ardour.git] / tools / osx_packaging / startup_script
1 #!/bin/sh
2
3 #
4 # NOTE: Leopard appears not to set PATH for this script, so be absolutely certain
5 # never to use any other program without fully specifying the path.
6 #
7 # this is used to detect a missing JACK install which
8 # is the most common thing causing startup crashes.
9
10
11 if test ! -x /usr/local/bin/jackd -a ! -x /usr/bin/jackd ; then
12    /usr/bin/osascript -e 'tell application "Finder"
13 display dialog "You do not have JACK installed. Ardour will not run without it. See http://jackaudio.org/ for info" buttons["OK"]
14 end tell'
15    exit 1
16 fi
17
18 #
19 # Some versions of Audacity leave /usr/local/lib unreadable/unsearchable. Ardour will not be able to start up if this is 
20 # the case, because we need access to /usr/local/lib/libjack.dylib
21 #
22
23 if test ! -x /usr/local/lib -o ! -r /usr/local/lib ; then
24    /usr/bin/osascript -e 'tell application "Finder"
25 display dialog "You appear to have previously installed Audacity which altered your filesystem incorrectly. Ardour cannot run until this is corrected. To correct the error, type the following command into a Terminal window: chmod 755 /usr/local/lib" buttons["OK"]
26 end tell'
27    exit 1
28 fi
29
30 # this needs to be set so that we can restore the environment when we want to find JACK (or similar)
31 export PREBUNDLE_ENV="$(env)"
32
33 # all clear, lets go
34 # this quoting is all needed to handle installation
35 # in folders likes /home/user/Frank's Wild Years
36
37 CWD="`/usr/bin/dirname \"$0\"`"
38 exec "$CWD/Ardour3.bin" "$@"