]> git.saurik.com Git - wxWidgets.git/blob - distrib/scripts/builddemos.sh
Use generic collapsible pane for wxUniv based builds.
[wxWidgets.git] / distrib / scripts / builddemos.sh
1 #!/bin/sh
2
3 # Build a range of Unix demos for uploading to the wxWidgets web site.
4 # Example:
5 # builddemos.sh --wxmsw --verbose &> log
6
7 PROGNAME=$0
8 WXSRCDIR=$WXWIN
9 WXDESTDIR=$WXSRCDIR/deliver
10 PLATFORM=linux
11
12 # Default binary subdirectory to copy sample executable from
13 WINBINDIR=vc_msw
14
15 # Suffix to append to each demo tarball, e.g. SuSE92 for widgets-SuSE92
16 SUFFIX=linux
17
18 # Determine if the binary name is .app or not
19 determine_binary()
20 {
21 if [ "$PLATFORM" = "mac" ]; then
22 BINARYNAME=$1.app
23 else
24 BINARYNAME=$1
25 fi
26 }
27
28 dobuilddemos_unix()
29 {
30 if [ ! -d "$WXSRCDIR" ] ; then
31 echo Cannot find wxWidgets source directory. Use --wxdir option.
32 exit
33 fi
34 if [ ! -d "$WXDESTDIR" ] ; then
35 echo Cannot find wxWidgets destination directory. Use --deliver option.
36 exit
37 fi
38 if [ ! -d samples ] ; then
39 echo Cannot find samples directory. Invoke this script from the root of the build folder.
40 exit
41 fi
42 if [ -d include ] ; then
43 echo Do not invoke this from the source directory - invoke from the build directory.
44 exit
45 fi
46
47 echo wxWidgets build directory is `pwd`
48 echo wxWidgets source directory is $WXSRCDIR
49 echo wxWidgets deliver directory is $WXDESTDIR
50 echo Suffix is $SUFFIX
51
52 rm -f $WXDESTDIR/*.tar.gz
53
54 # Dialogs
55
56 pushd samples/dialogs
57 make
58 if [ -f dialogs ] ; then
59 determine_binary dialogs
60 cp $WXSRCDIR/samples/dialogs/*.cpp $WXSRCDIR/samples/dialogs/*.h .
61 tar cfz $WXDESTDIR/wxWidgets-DialogsDemo-$SUFFIX.tar.gz $BINARYNAME *.cpp *.h
62 rm -f *.cpp *.h
63 else
64 echo "*** Warning: dialogs sample did not build"
65 fi
66 popd
67
68 # HTML
69
70 pushd samples/html/test
71 make
72 if [ -f test ] ; then
73 if [ "$PLATFORM" = "mac" ]; then
74 # Don't rename app on Mac in case it messes up the bundle
75 determine_binary test
76 else
77 mv test htmldemo
78 determine_binary htmldemo
79 fi
80 cp $WXSRCDIR/samples/html/test/*.cpp $WXSRCDIR/samples/html/test/*.htm* $WXSRCDIR/samples/html/test/*.png $WXSRCDIR/samples/html/test/*.gif .
81 tar cfz $WXDESTDIR/wxWidgets-HtmlDemo-$SUFFIX.tar.gz $BINARYNAME *.cpp *.png *.gif *.htm*
82 rm -f *.cpp *.gif *.png *.htm*
83 else
84 echo "*** Warning: HTML sample did not build"
85 fi
86 popd
87
88 # Widgets
89
90 pushd samples/widgets
91 make
92 if [ -f widgets ] ; then
93 determine_binary widgets
94 cp $WXSRCDIR/samples/widgets/*.cpp $WXSRCDIR/samples/widgets/*.h .
95 tar cfz $WXDESTDIR/wxWidgets-WidgetsDemo-$SUFFIX.tar.gz $BINARYNAME *.cpp *.h
96 rm -f *.cpp *.h
97 else
98 echo "*** Warning: widgets sample did not build"
99 fi
100 popd
101
102 # Life
103
104 pushd demos/life
105 make
106 if [ -f life ] ; then
107 determine_binary life
108 cp $WXSRCDIR/demos/life/*.cpp $WXSRCDIR/demos/life/*.h $WXSRCDIR/demos/life/*.xpm $WXSRCDIR/demos/life/*.inc $WXSRCDIR/demos/life/*.lif .
109 mkdir bitmaps
110 cp $WXSRCDIR/demos/life/bitmaps/*.* bitmaps
111 tar cfz $WXDESTDIR/wxWidgets-LifeDemo-$SUFFIX.tar.gz $BINARYNAME *.cpp *.h *.xpm *.inc *.lif bitmaps/*.*
112 rm -f *.cpp *.h *.xpm *.inc *.lif
113 rm -f -r bitmaps
114 else
115 echo "*** Warning: life demo did not build"
116 fi
117 popd
118 }
119
120 dobuilddemos_windows()
121 {
122 if [ ! -d "$WXSRCDIR" ] ; then
123 echo Cannot find wxWidgets source directory. Use --wxdir option.
124 exit
125 fi
126 if [ ! -d "$WXDESTDIR" ] ; then
127 echo Cannot find wxWidgets destination directory. Use --deliver option.
128 exit
129 fi
130 if [ ! -d samples ] ; then
131 echo Cannot find samples directory. Invoke this script from the root of the build folder.
132 exit
133 fi
134
135 echo wxWidgets build directory is `pwd`
136 echo wxWidgets source directory is $WXSRCDIR
137 echo wxWidgets deliver directory is $WXDESTDIR
138 echo Suffix is $SUFFIX
139
140 rm -f $WXDESTDIR/*.zip
141
142 # Dialogs
143
144 pushd samples/dialogs
145 if [ -f $WINBINDIR/dialogs.exe ] ; then
146 cp $WINBINDIR/dialogs.exe .
147 zip $WXDESTDIR/wxWidgets-DialogsDemo-$SUFFIX.zip dialogs.exe *.cpp *.h
148 rm -f dialogs.exe
149 else
150 echo "*** Warning: dialogs sample did not build"
151 fi
152 popd
153
154 # HTML
155
156 pushd samples/html/test
157 if [ -f $WINBINDIR/test.exe ] ; then
158 cp $WINBINDIR/test.exe htmldemo.exe
159 zip $WXDESTDIR/wxWidgets-HtmlDemo-$SUFFIX.zip htmldemo.exe *.cpp *.png *.gif *.htm*
160 rm -f htmldemo.exe
161 else
162 echo "*** Warning: HTML sample did not build"
163 fi
164 popd
165
166 # Widgets
167
168 pushd samples/widgets
169 if [ -f $WINBINDIR/widgets.exe ] ; then
170 cp $WINBINDIR/widgets.exe .
171 zip $WXDESTDIR/wxWidgets-WidgetsDemo-$SUFFIX.zip widgets.exe *.cpp *.h
172 else
173 echo "*** Warning: widgets sample did not build"
174 fi
175 popd
176
177 # Life
178
179 pushd demos/life
180 if [ -f $WINBINDIR/life.exe ] ; then
181 cp $WINBINDIR/life.exe .
182 zip $WXDESTDIR/wxWidgets-LifeDemo-$SUFFIX.zip life.exe *.cpp *.h *.xpm *.inc *.lif bitmaps/*.*
183 else
184 echo "*** Warning: life demo did not build"
185 fi
186 popd
187 }
188
189 usage()
190 {
191 echo "Usage: $PROGNAME [ options ]" 1>&2
192 echo Options:
193 echo " --help Display this help message"
194 echo " --suffix Append suffix to each tarball"
195 echo " --wxdir wxWidgets source dir"
196 echo " --deliver Tarball destination dir"
197 echo " --mac Whether we're building on Mac"
198 echo.
199 echo Note that options only override settings in $SCRIPTDIR/setup.var.
200 exit 1
201 }
202
203 # Process command line options.
204
205 while [ $# -gt 0 ]
206 do
207 case "$1" in
208 --suffix) SUFFIX=$2; shift;;
209 --wxdir) WXSRCDIR=$2; WXDESTDIR=$WXSRCDIR/deliver; shift;;
210 --deliver) WXDESTDIR=$2; shift;;
211 --mac) PLATFORM=mac;;
212 *)
213 usage
214 exit
215 ;;
216 esac
217 shift
218 done
219
220 if [ "$OS" = "Windows_NT" ]; then
221 dobuilddemos_windows
222 else
223 dobuilddemos_unix
224 fi
225
226
227