]> git.saurik.com Git - wxWidgets.git/blame_incremental - build/buildbot/config/include/testdrive-unix.xml
fix default values after types were changed
[wxWidgets.git] / build / buildbot / config / include / testdrive-unix.xml
... / ...
CommitLineData
1<?xml version="1.0" encoding="utf-8"?>
2
3<!--
4 Name: include/testdrive-unix.xml
5 Purpose: Declarations for the testdrive unix build slave
6 Author: Mike Wetherell
7 RCS-ID: $Id$
8 Copyright: (c) 2007 Mike Wetherell
9 Licence: wxWidgets licence
10-->
11
12<bot xmlns:xi="http://www.w3.org/2001/XInclude"
13 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
14 xsl:version="1.0">
15
16<xi:include href="testdrive.xml"/>
17
18<!--
19 post-checkout - post checkout <command> run by <checkout>
20
21 Usage: <post-checkout/>
22
23 The command is executed inside the shared checkout dir, and normally it
24 is used to make a private copy.
25-->
26<xsl:template name="post-checkout">
27<command>
28mkdir -p $TOPDIR
29chown $USER $TOPDIR
30rm -rf $BUILDDIR
31cp -pR . $BUILDDIR || { cd; rm -rf $BUILDDIR; exit 1; }
32</command>
33</xsl:template>
34
35<!--
36 unarchive - post fetch <command> run by <fetch>
37
38 Usage: <unarchive/>
39
40 The command is executed in the $HOME directory on the remote machine,
41 it is used to extract the fetched archive to the build directory.
42-->
43<xsl:template name="unarchive">
44<command>
45mkdir -p $TOPDIR
46chown $USER $TOPDIR
47rm -rf $BUILDDIR
48SOURCE=`echo $SOURCE | sed "s|^[^/]|$HOME/&amp;|"`
49cd $TOPDIR
50case $SOURCE in
51 *.tar.gz)
52 gunzip -c $SOURCE | tar xf -
53 ;;
54 *.tar.bz2)
55 bunzip2 -c $SOURCE | tar xf -
56 ;;
57 *.zip)
58 unzip $SOURCE
59 ;;
60esac
61mv wx* $BUILDDIR
62</command>
63</xsl:template>
64
65<!--
66 configure - make disable-precomp-headers a default configure option for
67 the testdrive, and post process the Makefiles to use ccache.
68
69 Usage: <configure options="-with-foobar"/>
70-->
71<xsl:template name="configure">
72 <xsl:param name="content"/>
73 <xsl:param name="options"/>
74 <configure>
75 <copy-with-defaults content="{$content}">
76 <command>./configure --disable-precomp-headers <xsl:value-of select="normalize-space($options)"/></command>
77 </copy-with-defaults>
78 <command>find . -name Makefile | xargs perl -pi -e 's/^(?:CC|CXX) = /$&amp;ccache /'</command>
79 </configure>
80</xsl:template>
81
82<!--
83 setup - a build step that makes sure any prerequisites are set up for
84 the current testdrive build.
85
86 Usage: <setup/>
87 <setup cppunit-options="-host=i686-apple-darwin8"/>
88
89 One of the things it sets up is cppunit. There is more than one compiler
90 available on some of the testdrive machines, and generally speaking
91 cppuint needs to be compiled by the same one that will be used for the
92 build.
93-->
94<xsl:template name="setup">
95<xsl:param name="content"/>
96<xsl:param name="options"/>
97<xsl:param name="ccache-configure" select="'./configure INSTALL=./install-sh\ -c --prefix=$HOME --bindir=$OPTDIR/bin'"/>
98<xsl:param name="ccache-options"/>
99<xsl:param name="cppunit-configure" select="'./configure INSTALL=config/install-sh\ -c --prefix=$HOME --bindir=$OPTDIR/bin --libdir=$OPTDIR/lib --disable-static'"/>
100<xsl:param name="cppunit-options"/>
101<shellcommand>
102<description>setting up</description>
103<descriptionDone>set up</descriptionDone>
104<haltOnFailure/>
105<command>
106MINSPACE=1000000
107DSPACE=`df -Pk $BUILDDIR | tail -1 | awk '{ print $4 }'`
108if [ $DSPACE -lt $MINSPACE ]; then
109 echo "Disk space low, skipping build"
110 exit 1
111fi
112if [ -z "$CCACHE_DIR" ]; then
113 gunzip -c $HOME/src/ccache-*.tar.gz | tar xf -
114 cd ccache-*
115 <xsl:value-of select="concat($ccache-configure, ' ', $ccache-options, ' ', $options)"/>
116 make
117 strip ccache
118 make install
119 cd $BUILDDIR
120 rm -r ccache-*
121fi
122if { cppunit-config --version || "$CPPUNIT_CONFIG" --version; } 2>/dev/null; then
123 HAVE_CPPUNIT=1
124fi
125if [ -z "$HAVE_CPPUNIT" ]; then
126 gunzip -c $HOME/src/cppunit-*.tar.gz | tar xf -
127 cd cppunit-*
128 <xsl:value-of select="concat($cppunit-configure, ' ', $cppunit-options, ' ', $options)"/>
129 make install-strip
130 chmod +x $OPTDIR/bin/cppunit-config
131 cd $BUILDDIR
132 rm -rf cppunit-*
133fi
134</command>
135</shellcommand>
136</xsl:template>
137
138<!--
139 profile - see <steps>.
140-->
141<xsl:template name="profile">
142<command>
143set -e
144uname -smnr
145umask 022
146LANG=C
147TOPDIR=<get-builddir/>
148BUILDDIR=$TOPDIR/build
149OPTDIR=$HOME/opt/<basename><get name="builddir"/></basename>
150</command>
151</xsl:template>
152
153<!--
154 prologue - see <steps>.
155-->
156<xsl:template name="prologue">
157<command>
158INSTALLDIR=$TOPDIR/install
159case `uname -sm` in
160 Linux*86*) PATH=$HOME/linux-x86/bin:$PATH ;;
161esac
162PATH=$OPTDIR/bin:$PATH
163LD_LIBRARY_PATH=$BUILDDIR/lib:$OPTDIR/lib:$LD_LIBRARY_PATH
164export LD_LIBRARY_PATH
165if { ccache -V; } >/dev/null 2>&amp;1; then
166 CCACHE_DIR=$TOPDIR/ccache
167 export CCACHE_DIR
168 ccache -M 90M
169fi
170cd $BUILDDIR
171<if-del-on-fail>trap 'cd; rm -rf $BUILDDIR' EXIT</if-del-on-fail>
172</command>
173</xsl:template>
174
175<!--
176 epilogue - see <steps>.
177-->
178<xsl:template name="epilogue">
179 <xsl:if test="position() != last()">
180 <if-del-on-fail>
181 <command>trap '' EXIT</command>
182 </if-del-on-fail>
183 </xsl:if>
184</xsl:template>
185
186<!--
187 builddir - override <builddir> to accept a full path
188
189 Usage: <builddir>/tmp/wx/foobar</builddir>
190
191 Normally builddir is a single directory name not a full path. Override
192 to allow a working directory to be selected on the remote testdrive
193 machine.
194
195 The actual builddir (i.e. last part 'foobar') as usual must be unique
196 across all the builds of all the slaves.
197-->
198<xsl:template name="builddir">
199 <xsl:param name="content"/>
200 <builddir>
201 <basename><xsl:copy-of select="$content"/></basename>
202 </builddir>
203</xsl:template>
204
205<!--
206 Put builds under /tmp/wx on the remote machines by default.
207
208 If the <builddir> element specifies a full path then returns that
209 as-is, otherwise prepends '/tmp/wx/'.
210-->
211<xsl:template name="get-builddir">
212 <xsl:variable name="builddir"><get name="builddir"/></xsl:variable>
213 <xsl:if test="substring($builddir, 1, 1) != '/'">
214 <xsl:text>/tmp/wx/</xsl:text>
215 </xsl:if>
216 <xsl:value-of select="$builddir"/>
217</xsl:template>
218
219<!--
220 basename - returns the final component of a path
221
222 Usage: <basename>/foo/bar</basename>
223
224 Evaluates to 'bar'.
225-->
226<xsl:template name="basename">
227 <xsl:param name="path"/>
228 <xsl:choose>
229 <xsl:when test="contains($path, '/')">
230 <xsl:call-template name="basename">
231 <xsl:with-param name="path" select="substring-after($path, '/')"/>
232 </xsl:call-template>
233 </xsl:when>
234 <xsl:otherwise>
235 <xsl:value-of select="$path"/>
236 </xsl:otherwise>
237 </xsl:choose>
238</xsl:template>
239
240</bot>