blob: 0b9ad8891cc894710526397608ed8b2d4d7fd019 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
#!/bin/sh
# script for pulling together a MacOSX app bundle.
GTKQUARTZ_ROOT=/opt/gtk
SAE=
WITH_JACK=1
while [ $# -gt 0 ] ; do
echo "arg = $1"
case $1 in
--sae) SAE=1 ; shift ;;
--nojack) WITH_JACK= ; shift ;;
esac
done
version=`grep -m 1 '^ardour_version' ../../SConstruct | cut -d' ' -f 3 | sed "s/'//g"`
echo "Version is $version"
# setup directory structure
APPROOT=Ardour2.app/Contents
Frameworks=$APPROOT/Frameworks
Resources=$APPROOT/Resources
Shared=$Resources/share
Etc=$Resources/etc
echo "Removing old Ardour2.app tree ..."
rm -rf Ardour2.app
echo "Building new app directory structure ..."
# only bother to make the longest paths
mkdir -p $APPROOT/MacOS
mkdir -p $APPROOT/Resources
mkdir -p $Frameworks/modules
mkdir -p $Shared/templates
mkdir -p $Etc
# maybe set variables
env=""
if test x$SAE != x ; then
env="$env<key>ARDOUR_SAE</key><string>true</string>"
fi
if test x$WITH_JACK != x ; then
env="$env<key>ARDOUR_WITH_JACK</key><string>true</string>"
fi
if test "x$env" != x ; then
env="<key>LSEnvironment</key><dict><key>ARDOUR_BUNDLED</key><string>true</string>$env</dict>"
fi
# edit plist
sed -e "s?@ENV@?$env?g" -e "s?@VERSION@?$version?g" < Info.plist.in > Info.plist
# copy static files
cp Info.plist $APPROOT
cp -R Resources $APPROOT
# copy executable
echo "Copying Ardour executable ..."
cp ../../gtk2_ardour/ardour-$version $APPROOT/MacOS/Ardour2
strip $APPROOT/MacOS/Ardour2
# copy everything related to gtk-quartz
echo "Copying GTK-Quartz tree ..."
cp -R $GTKQUARTZ_ROOT/lib/*.dylib $Frameworks/
cp -R $GTKQUARTZ_ROOT/etc/* $Etc
echo "Copying all Pango modules ..."
cp -R $GTKQUARTZ_ROOT/lib/pango/1.6.0/modules/*.so $Frameworks/modules
echo "Copying all GDK Pixbuf loaders ..."
cp -R $GTKQUARTZ_ROOT/lib/gtk-2.0/2.10.0/loaders/*.so $Frameworks/modules
# charset alias file
cp -R $GTKQUARTZ_ROOT/lib/charset.alias $Resources
# generate new Pango module file
cat > pangorc <<EOF
[Pango]
ModulesPath=$GTKQUARTZ_ROOT/lib/pango/1.6.0/modules
EOF
env PANGO_RC_FILE=pangorc $GTKQUARTZ_ROOT/bin/pango-querymodules | sed "s?$GTKQUARTZ_ROOT/lib/pango/1.6.0/modules/?@executable_path/../Frameworks/modules/?" > $Resources/pango.modules
rm pangorc
# generate a new GDK pixbufs loaders file
sed "s?$GTKQUARTZ_ROOT/lib/gtk-2.0/2.10.0/loaders/?@executable_path/../Frameworks/modules/?" < $GTKQUARTZ_ROOT/etc/gtk-2.0/gdk-pixbuf.loaders > $Resources/gdk-pixbuf.loaders
echo "Copying Ardour libraries into .app ..."
cp ../../libs/pbd/libpbd.dylib $Frameworks
cp ../../libs/midi++2/libmidi++.dylib $Frameworks
cp ../../libs/sigc++2/libsigc++2.dylib $Frameworks
cp ../../libs/soundtouch/libsoundtouch.dylib $Frameworks
cp ../../libs/libsndfile/libsndfile-ardour.dylib $Frameworks
cp ../../libs/libgnomecanvasmm/libgnomecanvasmm.dylib $Frameworks
cp ../../libs/gtkmm2ext/libgtkmm2ext.dylib $Frameworks
cp ../../libs/glibmm2/libglibmm2.dylib $Frameworks
cp ../../libs/gtkmm2/atk/libatkmm.dylib $Frameworks
cp ../../libs/gtkmm2/gdk/libgdkmm2.dylib $Frameworks
cp ../../libs/gtkmm2/gtk/libgtkmm2.dylib $Frameworks
cp ../../libs/gtkmm2/pango/libpangomm.dylib $Frameworks
cp ../../libs/ardour/libardour.dylib $Frameworks
# this one is special - we will set GTK_PATH to $Frameworks/clearlooks
cp ../../libs/clearlooks/libclearlooks.dylib $Frameworks
mkdir -p $Frameworks/clearlooks/engines
(cd $Frameworks/clearlooks/engines && ln -s ../../libclearlooks.dylib libclearlooks.dylib && ln -s ../../libclearlooks.dylib libclearlooks.so)
# push in ardour-required 3rd party libraries
cp /opt/local/lib/libsamplerate.0.dylib $Frameworks
cp /opt/local/lib/liblrdf.2.dylib $Frameworks
cp /opt/local/lib/libraptor.1.dylib $Frameworks
cp /opt/local/lib/liblo.0.dylib $Frameworks
# JACK
if test x$WITH_JACK != x ; then
cp /usr/local/lib/libjack.0.dylib $Frameworks
cp /usr/local/lib/jack/jack_coreaudio.so $Frameworks
cp /usr/local/bin/jackd $APPROOT/MacOS/jackd
fi
# XXX STILL NEED TO DO SURFACES AND PANNERS
cp ../../libs/surfaces/control_protocol/libardour_cp.dylib $Frameworks
echo "Copying other stuff to Ardour2.app ..."
cp ../../gtk2_ardour/ardour.bindings $Resources
cp ../../gtk2_ardour/ardour.menus $Resources
cp ../../gtk2_ardour/ardour-sae.menus $Resources
cp ../../ardour_system.rc $Resources
cp ../../gtk2_ardour/ardour2_ui_default.conf $Resources
cp ../../gtk2_ardour/ardour2_ui_light.rc $Resources
cp ../../gtk2_ardour/ardour2_ui_dark.rc $Resources
cp -r ../../gtk2_ardour/icons $Resources
cp -r ../../gtk2_ardour/pixmaps $Resources
# share stuff
cp -R ../../gtk2_ardour/splash.png $Shared
cp ../../templates/*.template $Shared/templates/
# go through and recursively remove any .svn dirs in the bundle
for svndir in `find Ardour2.app -name .svn -type dir`; do
rm -rf $svndir
done
# now fix up the executables
echo "Fixing up executable dependency names ..."
for exe in Ardour2 jackd ; do
EXE=$APPROOT/MacOS/$exe
changes=""
for lib in `otool -L $EXE | egrep "($GTKQUARTZ_ROOT|/local/|libs/)" | awk '{print $1}'` ; do
base=`basename $lib`
changes="$changes -change $lib @executable_path/../Frameworks/$base"
done
if test "x$changes" != "x" ; then
install_name_tool $changes $EXE
fi
done
echo "Fixing up library names ..."
# now do the same for all the libraries we include
for dylib in $Frameworks/*.dylib $Frameworks/modules/*.so ; do
# skip symlinks
if test ! -L $dylib ; then
# change all the dependencies
changes=""
for lib in `otool -L $dylib | egrep "($GTKQUARTZ_ROOT|/local/|libs/)" | awk '{print $1}'` ; do
base=`basename $lib`
changes="$changes -change $lib @executable_path/../Frameworks/$base"
done
if test "x$changes" != x ; then
if install_name_tool $changes $dylib ; then
:
else
exit 1
fi
fi
# now the change what the library thinks its own name is
base=`basename $dylib`
install_name_tool -id @executable_path/../Frameworks/$base $dylib
fi
done
echo "Done."
|