/[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 2708 - (show annotations) (download) (as text)
Sun Jan 18 02:53:25 2015 UTC (5 years, 2 months ago) by schoenebeck
File MIME type: application/x-sh
File size: 6868 byte(s)
* WIP: Implemented Mac .pkg installer build script.

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

Properties

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

  ViewVC Help
Powered by ViewVC