source: main/trunk/release-kits/kits/rk3/ant-scripts/compile.xml@ 37606

Last change on this file since 37606 was 37606, checked in by anupama, 13 months ago
  1. Fixed my bug in merged compile.xml for rk3, where the Mojave suffix was necessary to grab the correctly named gnome-lib-minimal also used up to (at least) Mac Monterey. 2. The -Wno-error=implicit-function-declaration can be commented out in compile.xml as it's been added to GS3's gs3-devel.sh and works fine there.
File size: 16.8 KB
Line 
1<?xml version="1.0" encoding="utf-8" ?>
2<project name="rk3-compile">
3
4
5 <target name="compile">
6
7 <!-- checkout greenstone3 -->
8 <exec executable="svn">
9 <arg line="${global-svn-args}"/>
10 <arg value="checkout"/>
11 <arg value="${svn.root}/main/${branch.path}/greenstone3"/>
12 <arg value="compiled"/>
13 <arg value="-r"/><arg value="${branch.revision}"/>
14 </exec>
15
16 <!-- Comment out any active checkout.gnomelib.ext=true line in build.properties.svn
17 So that the release-kits go back to behaving how they did when the line
18 used to be commented out by default in build properties.
19 For alternative ways to achieve this, see
20 https://jeeva-paramasamy.blogspot.com/2012/07/removeunset-property-in-property-file.html
21 Further options in the propertyfile task https://ant.apache.org/manual/Tasks/propertyfile.html
22 -->
23 <!--<if><bool><equals arg1="${checkout.gnomelib.ext}" arg2="true"/></bool>-->
24 <echo>Release-kit is running, which turns on use.gnomelib.ext, so commenting out checkout.gnomelib.ext=true to deactivate it.</echo>
25 <rsr file="${basedir}/compiled/build.properties.svn" pattern="checkout.gnomelib.ext=true" replacement="#checkout.gnomelib.ext=true"/>
26 <!--</if>-->
27
28 <if><bool><equals arg1="${with.jni}" arg2="false"/></bool>
29 <rsr file="${basedir}/compiled/build.properties.svn" pattern="with.jni=true" replacement="#with.jni=true"/>
30 </if>
31
32 <if><bool><equals arg1="${with.gli.and.gems}" arg2="false"/></bool>
33 <rsr file="${basedir}/compiled/build.properties.svn" pattern="with.gli.and.gems=true" replacement="#with.gli.and.gems=true"/>
34 </if>
35
36 <!-- make sure all c++ compilation is done statically on linux -->
37 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
38 <property name="forward.compile.static" value="true"/>
39 </if>
40
41 <!-- make sure the c++ compilation can see the support library in the extension folder -->
42 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
43 <property name="forward.use.gnomelib.ext" value="true"/>
44 </if>
45
46 <antcall target="persist-forwarded-properties">
47 <param name="greenstone3basedir" value="compiled"/>
48 </antcall>
49
50 <!-- run greenstone3's ant prepare -->
51 <ant dir="compiled" inheritAll="false">
52 <target name="prepare"/>
53 <propertyset refid="forward.properties"/>
54 <property name="properties.accepted" value="true"/>
55 <property name="global-svn-args" value="${global-svn-args}"/>
56 </ant>
57
58 <!-- set all version numbers -->
59 <antcall target="greenstone3-set-version-numbers"><param name="greenstone3basedir" value="compiled"/></antcall>
60 <antcall target="gli-set-version-numbers"><param name="glibasedir" value="compiled/gli"/></antcall>
61 <antcall target="gsdl-set-version-numbers"><param name="gsdl.basedir" value="compiled/gs2build"/></antcall>
62
63 <!-- mac or linux: compile the support library -->
64 <if><bool><or><equals arg1="${rk.os}" arg2="mac"/><equals arg1="${rk.os}" arg2="linux"/></or></bool>
65 <!-- checkout the gnome support library extension-->
66
67 <!-- For Lions, need a specific gnome-lib-minimal tar file. The file name contains darwin12 for Lion, it contains the os.shell name (darwin/linux) for other cases.
68 Mac OS X v10.7.4 onwards is Lion/Mountain Lion, different from Leopard/Snow Leopard. See http://en.wikipedia.org/wiki/Darwin_(operating_system) -->
69 <condition property="specific.os.type" value="${os.shell}-Lion" else="${os.shell}-Mojave">
70 <and>
71 <contains string="${os.shell}" substring="darwin" casesensitive="false"/>
72 <matches pattern="^(10\.7\.[4-9]|10\.[8-9]|1[1-9]|[2-9])" string="${os.version}"/>
73 </and>
74 </condition>
75
76 <if><bool><or>
77 <equals arg1="${post.2.83.version}" arg2="true"/>
78 </or></bool>
79 <echo>EXPORTING GNOME LIB EXTENSION</echo>
80 <exec executable="svn">
81 <arg line="${global-svn-args}"/>
82 <arg value="export"/>
83 <arg value="${svn.root}/gs2-extensions/gnome-lib/trunk/gnome-lib-minimal-${specific.os.type}${arch}${extension-x64}.tar.gz"/>
84 <arg value="${basedir}/compiled/ext/gnome-lib-${specific.os.type}.tar.gz"/>
85 </exec>
86
87 <exec executable="tar" dir="${basedir}/compiled/ext">
88 <arg value="xvzf"/>
89 <arg value="gnome-lib-${specific.os.type}.tar.gz"/>
90 </exec>
91
92 <exec executable="/bin/bash" dir="${basedir}/compiled/ext/gnome-lib-minimal">
93 <arg value="-c"/>
94 <arg value="source setup.bash_old &amp;&amp; source devel.bash"/>
95 </exec>
96 <echo>DONE COMPILING GNOME LIB EXTENSION</echo>
97 </if>
98 </if>
99
100 <!-- <rsr file="${basedir}/compiled/build.xml" pattern="CFLAGS=&amp;quot;" replacement="CFLAGS=&amp;quot;-fPIC "/> -->
101 <!-- mac only: make errors about missing extern declarations back into warnings as in old (Mojave and before) macs -->
102 <!--
103 <if>
104 <bool><equals arg1="${rk.os}" arg2="mac"/></bool>
105 <rsr file="${basedir}/compiled/build.xml" pattern="CFLAGS=&amp;quot;" replacement="CFLAGS=&amp;quot;-Wno-error=implicit-function-declaration "/>
106 </if>
107 -->
108
109 <!-- run greenstone3's ant install and ant dist-tidy -->
110 <ant dir="compiled" inheritAll="false">
111 <target name="install"/>
112 <target name="dist-tidy"/>
113 <propertyset refid="forward.properties"/>
114 <property name="properties.accepted" value="true"/>
115 <property name="properties.keep.src" value="${keep.src}"/>
116 <property name="global-svn-args" value="${global-svn-args}"/>
117 </ant>
118
119 <!-- Delete all collections apart from the Lucene demo collection -->
120 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gberg"/>
121 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgdemo"/>
122 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgppdemo"/>
123 <delete dir="${basedir}/compiled/web/sites/localsite/collect/infomine"/>
124
125 <!-- Delete the entire gnome support library on Linux -->
126 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
127 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal"/>
128 <delete file="${basedir}/compiled/ext/gnome-lib-linux.tar.gz"/>
129 </if>
130
131 <!-- Delete all but the lib folder of the gnome support library on Mac,
132 then move this smaller gnome-lib-minimal dir from the top-level ext folder
133 to gs2build/ext, since wvware on mac needs gnome-lib-minimal -->
134 <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
135 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/cascade-make"/>
136 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/packages"/>
137 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/bin"/>
138 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/etc"/>
139 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/include"/>
140 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/share"/>
141 <delete file="${basedir}/compiled/ext/gnome-lib-minimal/setup.bat"/>
142 <delete file="${basedir}/compiled/ext/gnome-lib-minimal/CASCADE-MAKE.sh"/>
143 <delete file="${basedir}/compiled/ext/gnome-lib-darwin.tar.gz"/>
144 <move file="${basedir}/compiled/ext/gnome-lib-minimal" todir="compiled/gs2build/ext"/>
145 </if>
146
147 <!-- Delete Lucene 3.3 specific ext/solr folders, since we've switched over to Lucene 4.7.2 -->
148 <delete dir="${basedir}/compiled/ext/solr/lib3" />
149 <delete dir="${basedir}/compiled/ext/solr/conf3" />
150 <delete dir="${basedir}/compiled/ext/solr/etc3" />
151
152
153 <if><bool><and>
154 <equals arg1="${rk.os}" arg2="linux"/>
155 <equals arg1="${extension-x64}" arg2="-x64"/>
156 </and></bool>
157 <property name="bitness" value="64"/>
158 <else>
159 <property name="bitness" value="32"/>
160 </else>
161 </if>
162
163 <!-- insert an xml parser (matched to the version of Perl being used by the release kit).
164 For Linux 64 bit, use the 64 bit versions.
165 For other *nix cases, including Macs, we stick to the 32 bit
166 versions since there have been no problems yet, probably
167 because our Mac has 5.12 which is not included in
168 XML-Parser so that our mac then tries to find the xml
169 parser on the system.-->
170 <if><bool><not><equals arg1="${rk.os}" arg2="windows"/></not></bool>
171 <copy todir="compiled/gs2build/perllib/cpan">
172 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="${bitness}-bit/**/*"/>
173 </copy>
174 <move file="compiled/gs2build/perllib/cpan/${bitness}-bit" tofile="compiled/gs2build/perllib/cpan/XML-Parser"/>
175 </if>
176
177 <!-- insert ant -->
178 <property name="insert.ant.version" value="1.9.13"/> <!-- value="1.8.2" -->
179 <mkdir dir="compiled/packages"/>
180 <!--<get src="http://www.greenstone.org/gs3files/apache-ant-${insert.ant.version}-bin.tar.gz" dest="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz"/>-->
181 <exec executable="wget" failonerror="true">
182 <arg value="-P"/>
183 <arg value="compiled/packages"/>
184 <arg value="--no-check-certificate"/>
185 <arg value="https://www.greenstone.org/gs3files/apache-ant-${insert.ant.version}-bin.tar.gz"/>
186 </exec>
187 <untar src="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz" dest="compiled/packages/" compression="gzip"/>
188 <move file="compiled/packages/apache-ant-${insert.ant.version}" tofile="compiled/packages/ant"/>
189 <delete file="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz"/>
190
191 <!-- put the uninstaller in place -->
192 <antcall target="insert-and-compile-uninstaller"/>
193
194 <!-- (windows only) -->
195 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
196 <!-- insert perl -->
197 <!--<unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/gs2build/bin/windows"/>-->
198 <exec executable="svn" dir="compiled/gs2build/bin/windows">
199 <arg line="${global-svn-args}"/>
200 <arg value="export"/>
201 <arg value="${svn.root}/main/trunk/release-kits/shared/windows/perl.zip"/>
202 </exec>
203 <unzip src="compiled/gs2build/bin/windows/perl.zip" dest="compiled/gs2build/bin/windows"/>
204 <delete failonerror="false" file="compiled/gs2build/bin/windows/perl.zip" />
205 </if>
206
207 <!-- minify tomcat -->
208 <delete dir="compiled/packages/tomcat/webapps/docs"/>
209 <delete dir="compiled/packages/tomcat/webapps/examples"/>
210
211 <!-- tidy up gli to make it smaller -->
212 <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
213
214 <!-- strip out .svn dirs -->
215 <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
216
217 <!-- get rid of bin/formatconverter on windows and get rid of bin/formatconverter.exe on linux/mac. Now we have specific OS dirs, so get rid of the irrelevant OS dirs instead -->
218 <if>
219 <bool><equals arg1="${rk.os}" arg2="windows"/></bool>
220 <delete dir="compiled/bin/darwin"/>
221 <delete dir="compiled/bin/linux"/>
222 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
223 <delete dir="compiled/bin/windows"/>
224 <delete dir="compiled/bin/linux"/>
225 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
226 <delete dir="compiled/bin/windows"/>
227 <delete dir="compiled/bin/darwin"/>
228 </if></else>
229 </if></else>
230 </if>
231
232 <!-- (linux only) -->
233 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
234 <!-- grab imagemagick binaries -->
235 <delete dir="compiled/gs2build/bin/linux/imagemagick"/>
236
237 <exec executable="svn">
238 <arg line="${global-svn-args}"/>
239 <arg value="export"/>
240 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-linux${extension-x64}.tar.gz"/>
241 <arg value="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
242 </exec>
243
244 <exec executable="tar" dir="compiled/ext">
245 <arg value="xvzf"/>
246 <arg value="imagemagick-linux${extension-x64}.tar.gz"/>
247 </exec>
248 <delete file="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
249 <move todir="compiled/gs2build/bin/linux/imagemagick">
250 <fileset dir="compiled/ext/imagemagick/linux"/>
251 </move>
252 <delete dir="compiled/ext/imagemagick"/>
253
254 <!--<delete dir="compiled/gs2build/bin/linux/imagemagick"/>
255 <exec executable="svn">
256 <arg line="${global-svn-args}"/>
257 <arg value="export"/>
258 <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
259 <arg value="compiled/gs2build/bin/linux/imagemagick"/>
260 </exec>-->
261
262 <!-- We don't want to bundle the old pre-compiled 32 bit wv folder anymore -->
263 <!-- grab wv binaries -->
264 <!--<delete dir="compiled/gs2build/bin/linux/wv"/>
265 <exec executable="svn">
266 <arg line="${global-svn-args}"/>
267 <arg value="export"/>
268 <arg value="${svn.root}/main/${branch.path}/binaries/linux/wv"/>
269 <arg value="compiled/gs2build/bin/linux/wv"/>
270 </exec>
271 -->
272 <!-- (mac only) -->
273 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
274 <!-- grab imagemagick binaries -->
275
276 <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
277 <!-- before mojave -->
278 <!--<property name="darwin-imagick-tarball" value="imagemagick-darwin-10.5.tar.gz"/>-->
279 <!-- mojave onwards -->
280 <property name="darwin-imagick-tarball" value="imagemagick-darwin-10.11.tar.gz"/>
281 <exec executable="svn">
282 <arg line="${global-svn-args}"/>
283 <arg value="export"/>
284 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/${darwin-imagick-tarball}"/>
285 <arg value="compiled/ext/${darwin-imagick-tarball}"/>
286 </exec>
287
288 <exec executable="tar" dir="compiled/ext">
289 <arg value="xvzf"/>
290 <arg value="${darwin-imagick-tarball}"/>
291 </exec>
292 <delete file="compiled/ext/${darwin-imagick-tarball}"/>
293 <move todir="compiled/gs2build/bin/darwin/imagemagick">
294 <fileset dir="compiled/ext/imagemagick/darwin"/>
295 </move>
296 <delete dir="compiled/ext/imagemagick"/>
297
298
299 <!--
300 <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
301 <exec executable="svn">
302 <arg line="${global-svn-args}"/>
303 <arg value="export"/>
304 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
305 <arg value="compiled/gs2build/bin/darwin/imagemagick"/>
306 </exec>-->
307
308 <if><bool><not><equals arg1="${forward.install.flax}" arg2="true"/></not></bool>
309 <!-- grab ghostscript binaries -->
310 <delete dir="compiled/gs2build/bin/darwin/ghostscript"/>
311 <exec executable="svn">
312 <arg line="${global-svn-args}"/>
313 <arg value="export"/>
314 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
315 <arg value="compiled/gs2build/bin/darwin/ghostscript"/>
316 </exec>
317 </if>
318 </if></else></if>
319
320 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
321 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
322 <arg line="-S"/>
323 <arg line="gs2build/bin/script/import.pl -removeold -site localsite lucene-jdbm-demo"/>
324 <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
325 <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
326 <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
327 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
328 <env key="GSDLOS" value="windows"/>
329 <env key="PERL_PERTURB_KEYS" value="0"/>
330 <env key="PERL_HASH_SEED" value="0"/>
331 <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
332 </exec>
333 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
334 <arg line="-S"/>
335 <arg line="gs2build/bin/script/buildcol.pl -removeold -site localsite lucene-jdbm-demo"/>
336 <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
337 <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
338 <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
339 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
340 <env key="GSDLOS" value="windows"/>
341 <env key="PERL_PERTURB_KEYS" value="0"/>
342 <env key="PERL_HASH_SEED" value="0"/>
343 <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
344 </exec>
345 <delete dir="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
346 <move file="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building" tofile="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
347 <else>
348 <echo file="${basedir}/compiled/buildscript.sh">
349 #!/bin/bash
350 source gs3-setup.sh
351 /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/import.pl -site localsite lucene-jdbm-demo
352 /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/buildcol.pl -site localsite lucene-jdbm-demo
353 rm -rf ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
354 mv ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
355 </echo>
356 <chmod perm="775" file="${basedir}/compiled/buildscript.sh"/>
357 <exec dir="${basedir}/compiled" executable="/bin/bash">
358 <arg line="buildscript.sh"/>
359 </exec>
360 <delete file="${basedir}/compiled/buildscript.sh"/>
361 </else>
362 </if>
363
364 </target>
365
366</project>
Note: See TracBrowser for help on using the repository browser.