/[svn]/misc/trunk/mac_package_builder/make-tar-file.sh
ViewVC logotype

Contents of /misc/trunk/mac_package_builder/make-tar-file.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3490 - (show annotations) (download) (as text)
Sun Mar 3 09:08:44 2019 UTC (15 months ago) by persson
File MIME type: application/x-sh
File size: 7661 byte(s)
* Use standard name for gdk pixbuf module file on Mac
* Put locale files under share on Mac
* Fix "numberOfFiles" in Mac installer PackageInfo files

1 #!/bin/sh -xe
2
3 # This script is primarily made for the linuxsampler build server. It
4 # copies the files created by the previous Max OS X build steps, and
5 # creates universal binaries from the i686, x86_64 and powerpc
6 # files. Then it packs all components as a .pkg Mac installer package and
7 # finally it wraps everything in a tar.bz2 archive.
8
9 LIPO=x86_64-apple-darwin9-lipo
10 P=/home/persson/mac
11 D=linuxsampler_`date +%Y%m%d`
12
13 # command line tools shipped with libgig
14 gigtools_bins="akaidump akaiextract dlsdump gig2mono gig2stereo gigdump gigextract gigmerge korg2gig korgdump rifftree sf2dump sf2extract"
15
16 createuniv ()
17 {
18 $LIPO -create "$P/x86_64/$1" "$P/i686/$1" "$P/powerpc/$1" \
19 -output "$D/${2-$1}"
20 }
21
22
23 rm -rf linuxsampler_*
24 rm -rf components
25 rm -rf linuxsampler.prepkg
26 rm -rf LinuxSampler.pkg
27 mkdir -p "$D/LinuxSampler" "$D/lib"
28
29
30 # linuxsampler, libgig and dependencies
31
32 createuniv lib/libogg.0.dylib
33 createuniv lib/libvorbis.0.dylib
34 createuniv lib/libvorbisenc.2.dylib
35 createuniv lib/libFLAC.8.2.0.dylib
36 ln -s libFLAC.8.2.0.dylib "$D/lib/libFLAC.8.dylib"
37 createuniv lib/libsndfile.1.dylib
38 createuniv lib/libgig/libgig.8.dylib lib/libgig.8.dylib
39 createuniv lib/linuxsampler/liblinuxsampler.5.dylib lib/liblinuxsampler.5.dylib
40 createuniv bin/linuxsampler LinuxSampler/linuxsampler
41 createuniv bin/lscp LinuxSampler/lscp
42 cp README "$D"
43 cp licenses.txt "$D/LinuxSampler"
44
45 # AU plugin
46
47 cp -r "$P/i686/Components/LinuxSamplerAU.component" "$D"
48 createuniv Components/LinuxSamplerAU.component/Contents/MacOS/LinuxSamplerAU LinuxSamplerAU.component/Contents/MacOS/LinuxSamplerAU
49
50
51 # VST plugin
52
53 cp -r "$P/i686/VST/LinuxSampler.vst" "$D"
54 createuniv VST/LinuxSampler.vst/Contents/MacOS/LinuxSampler LinuxSampler.vst/Contents/MacOS/LinuxSampler
55
56
57 # gigtools
58
59 for x in $gigtools_bins
60 do
61 createuniv "bin/$x" "LinuxSampler/$x"
62 done
63
64
65 # Fantasia
66
67 cp -r "$P/Fantasia.app" "$D/LinuxSampler"
68
69
70 # QSampler
71
72 ./make-qsampler-app.sh
73 mv qsampler.app "$D/LinuxSampler"
74
75
76 # Gigedit
77
78 # no powerpc build of gigedit
79 createuniv ()
80 {
81 $LIPO -create "$P/x86_64/$1" "$P/i686/$1" \
82 -output "$D/${2-$1}"
83 }
84
85 mkdir -p "$D/LinuxSampler/gigedit.app/Contents/MacOS" \
86 "$D/lib/gdk-pixbuf-2.0/2.10.0/loaders" \
87 "$D/lib/pango/1.8.0/modules" \
88 "$D/share/locale/sv/LC_MESSAGES" \
89 "$D/share/locale/de/LC_MESSAGES" \
90 "$D/lib/linuxsampler/plugins"
91
92 createuniv lib/gigedit/libgigedit.4.dylib lib/libgigedit.4.dylib
93 createuniv bin/gigedit LinuxSampler/gigedit.app/Contents/MacOS/gigedit
94 createuniv lib/linuxsampler/plugins/libgigeditlinuxsamplerplugin.so
95
96 for x in libatk-1.0.0.dylib libatkmm-1.6.1.dylib libcairo.2.dylib \
97 libcairomm-1.0.1.dylib libffi.6.dylib libfontconfig.1.dylib \
98 libfreetype.6.dylib libgailutil.18.dylib libgdkmm-2.4.1.dylib \
99 libgdk_pixbuf-2.0.0.dylib libgdk-quartz-2.0.0.dylib libgio-2.0.0.dylib \
100 libgiomm-2.4.1.dylib libglib-2.0.0.dylib libglibmm-2.4.1.dylib \
101 libgmodule-2.0.0.dylib libgobject-2.0.0.dylib libgthread-2.0.0.dylib \
102 libgtkmm-2.4.1.dylib libgtk-quartz-2.0.0.dylib libintl.8.dylib \
103 libjpeg.8.dylib libpango-1.0.0.dylib libpangocairo-1.0.0.dylib \
104 libpangomm-1.4.1.dylib libpixman-1.0.dylib libpng15.15.dylib \
105 libsigc-2.0.0.dylib libtiff.3.dylib \
106 gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-xpm.so \
107 pango/1.8.0/modules/pango-basic-coretext.so
108 do
109 $LIPO -create "/home/persson/macgtk64/lib/$x" \
110 "/home/persson/macgtk32/lib/$x" \
111 -output "$D/lib/$x"
112 done
113
114 cp PkgInfo Info.plist "$D/LinuxSampler/gigedit.app/Contents"
115 cp pango.modules "$D/lib/pango/pango.modules"
116 cp loaders.cache "$D/lib/gdk-pixbuf-2.0/2.10.0"
117 cp $P/x86_64/share/locale/de/LC_MESSAGES/gigedit.mo "$D/share/locale/de/LC_MESSAGES"
118 cp $P/x86_64/share/locale/sv/LC_MESSAGES/gigedit.mo "$D/share/locale/sv/LC_MESSAGES"
119 cp /home/persson/macgtk64/share/locale/de/LC_MESSAGES/gtk20.mo "$D/share/locale/de/LC_MESSAGES"
120 cp /home/persson/macgtk64/share/locale/sv/LC_MESSAGES/gtk20.mo "$D/share/locale/sv/LC_MESSAGES"
121
122
123 # generate OS X .pkg package / installer ...
124
125 component="codecs"
126 dlib="components/$component.pkg/lib"
127 mkdir -p $dlib
128 for f in `ls $D/lib/libFLAC* $D/lib/libogg* $D/lib/libsndfile* $D/lib/libvorbis*`; do
129 cp $f $dlib
130 done
131
132 component="fantasia"
133 dlib="components/$component.pkg/LinuxSampler"
134 mkdir -p $dlib
135 cp -r $D/LinuxSampler/Fantasia.app $dlib
136
137 component="gigedit"
138 dlib="components/$component.pkg/LinuxSampler"
139 mkdir -p $dlib
140 cp -r $D/LinuxSampler/$component.app $dlib
141
142 component="libgig"
143 dlib="components/$component.pkg/lib"
144 mkdir -p $dlib
145 for f in `ls $D/lib/libgig.*`; do
146 cp $f $dlib
147 done
148
149 component="gigtools"
150 dlib="components/$component.pkg/bin"
151 mkdir -p $dlib
152 for f in $gigtools_bins; do
153 cp $D/LinuxSampler/$f $dlib
154 done
155 dlib="components/$component.pkg/share/man/man1"
156 mkdir -p $dlib
157 for f in $gigtools_bins; do
158 cp $P/i686/share/man/man1/$f.1 $dlib
159 done
160
161 component="libgigedit"
162 dlib="$PWD/components/$component.pkg/lib"
163 mkdir -p $dlib
164 (
165 cd $D/lib/
166 for f in `ls -d linuxsampler libgigedit*`; do
167 cp -r --parents $f $dlib
168 done
169 )
170 dlib="$PWD/components/$component.pkg"
171 (
172 cd $D
173 cp --parents share/locale/*/LC_MESSAGES/gigedit.mo $dlib
174 )
175
176 component="libgtk"
177 dlib="$PWD/components/$component.pkg/lib"
178 mkdir -p $dlib
179 (
180 cd $D/lib/
181 for f in `ls -d gdk* gtk* pango libatk* libcairo* libffi* libfont* libfreetype* libgailutil* libgdk* libgio* libglib* libgmodule* libgobject* libgthread* libgtk* libintl* libjpeg* libpango* libpixman* libpng* libsigc* libtiff*`; do
182 cp -r --parents $f $dlib
183 done
184 )
185 dlib="$PWD/components/$component.pkg"
186 (
187 cd $D
188 cp --parents share/locale/*/LC_MESSAGES/gtk20.mo $dlib
189 )
190
191 component="liblinuxsampler"
192 dlib="components/$component.pkg/lib"
193 mkdir -p $dlib
194 for f in `ls $D/lib/liblinuxsampler*`; do
195 cp $f $dlib
196 done
197 mkdir -p "$dlib/linuxsampler/plugins"
198
199 component="linuxsampler"
200 dlib="components/$component.pkg/bin"
201 mkdir -p $dlib
202 for f in `ls $D/LinuxSampler/linuxsampler $D/LinuxSampler/lscp`; do
203 cp $f $dlib
204 done
205
206 component="linuxsampler_au"
207 dlib="components/$component.pkg"
208 mkdir -p $dlib
209 cp -r $D/LinuxSamplerAU.component $dlib
210
211 component="linuxsampler_vst"
212 dlib="components/$component.pkg"
213 mkdir -p $dlib
214 cp -r $D/LinuxSampler.vst $dlib
215
216 component="qsampler"
217 dlib="components/$component.pkg/LinuxSampler"
218 mkdir -p $dlib
219 cp -r $D/LinuxSampler/$component.app $dlib
220
221
222 mkdir linuxsampler.prepkg
223 cp linuxsampler.unpkg/Distribution linuxsampler.prepkg
224 rsync -r --exclude='.svn' linuxsampler.unpkg/Resources linuxsampler.prepkg
225 (
226 cd components
227 for d in `ls -d *.pkg`; do
228 mkdir -p ../linuxsampler.prepkg/$d
229 (
230 cd $d
231 find . | cpio -o --format odc --owner 0:80 | gzip -c
232 ) > ../linuxsampler.prepkg/$d/Payload
233 mkbom -u 0 -g 80 $d ../linuxsampler.prepkg/$d/Bom
234 size_kb=`du -sk $d | cut -f 1`
235 entries_count=`find $d | wc -l`
236 cp ../linuxsampler.unpkg/$d/PackageInfo ../linuxsampler.prepkg/$d
237 xmltxt=`xmlstarlet ed -u '/pkg-info/payload/@numberOfFiles' -v $entries_count ../linuxsampler.prepkg/$d/PackageInfo | xmlstarlet ed -u '/pkg-info/payload/@installKBytes' -v $size_kb`
238 echo $xmltxt > ../linuxsampler.prepkg/$d/PackageInfo
239 identifier=`xmlstarlet sel -t -v '/pkg-info/@identifier' ../linuxsampler.prepkg/$d/PackageInfo`
240 xmltxt=`xmlstarlet ed -u "/installer-gui-script/pkg-ref[@id='$identifier']/@installKBytes" -v $size_kb ../linuxsampler.prepkg/Distribution`
241 echo $xmltxt > ../linuxsampler.prepkg/Distribution
242 done
243 )
244 (
245 cd linuxsampler.prepkg
246 xar --compression none -cf ../LinuxSampler.pkg .
247 )
248
249 tar cjf "$D.tar.bz2" README LinuxSampler.pkg

Properties

Name Value
svn:eol-style native
svn:executable *

  ViewVC Help
Powered by ViewVC