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

Last change on this file since 37453 was 37453, checked in by anupama, 14 months ago
  1. Wno_error still in the release-kit compile.xml because I can't locate where fPIC is generally set in CFLAGS during GS3 compilation (whether release-kits or not), to add this to that flag in the same location. 2. Minor capitalization in monterey-compile.xml for rk3. Will remove monterey and mojave-compile.xml after confirming the nightlies on Mac generate binaries, generate working binaries and that they generate binaries that work through all the tutorials.
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}">
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 <if>
103 <bool><equals arg1="${rk.os}" arg2="mac"/></bool>
104 <rsr file="${basedir}/compiled/build.xml" pattern="CFLAGS=&amp;quot;" replacement="CFLAGS=&amp;quot;-Wno-error=implicit-function-declaration "/>
105 </if>
106
107 <!-- run greenstone3's ant install and ant dist-tidy -->
108 <ant dir="compiled" inheritAll="false">
109 <target name="install"/>
110 <target name="dist-tidy"/>
111 <propertyset refid="forward.properties"/>
112 <property name="properties.accepted" value="true"/>
113 <property name="properties.keep.src" value="${keep.src}"/>
114 <property name="global-svn-args" value="${global-svn-args}"/>
115 </ant>
116
117 <!-- Delete all collections apart from the Lucene demo collection -->
118 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gberg"/>
119 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgdemo"/>
120 <delete dir="${basedir}/compiled/web/sites/localsite/collect/gs2mgppdemo"/>
121 <delete dir="${basedir}/compiled/web/sites/localsite/collect/infomine"/>
122
123 <!-- Delete the entire gnome support library on Linux -->
124 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
125 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal"/>
126 <delete file="${basedir}/compiled/ext/gnome-lib-linux.tar.gz"/>
127 </if>
128
129 <!-- Delete all but the lib folder of the gnome support library on Mac,
130 then move this smaller gnome-lib-minimal dir from the top-level ext folder
131 to gs2build/ext, since wvware on mac needs gnome-lib-minimal -->
132 <if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
133 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/cascade-make"/>
134 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/packages"/>
135 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/bin"/>
136 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/etc"/>
137 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/include"/>
138 <delete dir="${basedir}/compiled/ext/gnome-lib-minimal/darwin/share"/>
139 <delete file="${basedir}/compiled/ext/gnome-lib-minimal/setup.bat"/>
140 <delete file="${basedir}/compiled/ext/gnome-lib-minimal/CASCADE-MAKE.sh"/>
141 <delete file="${basedir}/compiled/ext/gnome-lib-darwin.tar.gz"/>
142 <move file="${basedir}/compiled/ext/gnome-lib-minimal" todir="compiled/gs2build/ext"/>
143 </if>
144
145 <!-- Delete Lucene 3.3 specific ext/solr folders, since we've switched over to Lucene 4.7.2 -->
146 <delete dir="${basedir}/compiled/ext/solr/lib3" />
147 <delete dir="${basedir}/compiled/ext/solr/conf3" />
148 <delete dir="${basedir}/compiled/ext/solr/etc3" />
149
150
151 <if><bool><and>
152 <equals arg1="${rk.os}" arg2="linux"/>
153 <equals arg1="${extension-x64}" arg2="-x64"/>
154 </and></bool>
155 <property name="bitness" value="64"/>
156 <else>
157 <property name="bitness" value="32"/>
158 </else>
159 </if>
160
161 <!-- insert an xml parser (matched to the version of Perl being used by the release kit).
162 For Linux 64 bit, use the 64 bit versions.
163 For other *nix cases, including Macs, we stick to the 32 bit
164 versions since there have been no problems yet, probably
165 because our Mac has 5.12 which is not included in
166 XML-Parser so that our mac then tries to find the xml
167 parser on the system.-->
168 <if><bool><not><equals arg1="${rk.os}" arg2="windows"/></not></bool>
169 <copy todir="compiled/gs2build/perllib/cpan">
170 <fileset dir="${rk.home}/shared/linux/XML-Parser" includes="${bitness}-bit/**/*"/>
171 </copy>
172 <move file="compiled/gs2build/perllib/cpan/${bitness}-bit" tofile="compiled/gs2build/perllib/cpan/XML-Parser"/>
173 </if>
174
175 <!-- insert ant -->
176 <property name="insert.ant.version" value="1.9.13"/> <!-- value="1.8.2" -->
177 <mkdir dir="compiled/packages"/>
178 <!--<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"/>-->
179 <exec executable="wget" failonerror="true">
180 <arg value="-P"/>
181 <arg value="compiled/packages"/>
182 <arg value="--no-check-certificate"/>
183 <arg value="https://www.greenstone.org/gs3files/apache-ant-${insert.ant.version}-bin.tar.gz"/>
184 </exec>
185 <untar src="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz" dest="compiled/packages/" compression="gzip"/>
186 <move file="compiled/packages/apache-ant-${insert.ant.version}" tofile="compiled/packages/ant"/>
187 <delete file="compiled/packages/apache-ant-${insert.ant.version}-bin.tar.gz"/>
188
189 <!-- put the uninstaller in place -->
190 <antcall target="insert-and-compile-uninstaller"/>
191
192 <!-- (windows only) -->
193 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
194 <!-- insert perl -->
195 <!--<unzip src="${rk.home}/shared/windows/perl.zip" dest="compiled/gs2build/bin/windows"/>-->
196 <exec executable="svn" dir="compiled/gs2build/bin/windows">
197 <arg line="${global-svn-args}"/>
198 <arg value="export"/>
199 <arg value="${svn.root}/main/trunk/release-kits/shared/windows/perl.zip"/>
200 </exec>
201 <unzip src="compiled/gs2build/bin/windows/perl.zip" dest="compiled/gs2build/bin/windows"/>
202 <delete failonerror="false" file="compiled/gs2build/bin/windows/perl.zip" />
203 </if>
204
205 <!-- minify tomcat -->
206 <delete dir="compiled/packages/tomcat/webapps/docs"/>
207 <delete dir="compiled/packages/tomcat/webapps/examples"/>
208
209 <!-- tidy up gli to make it smaller -->
210 <antcall target="gli-tidy-for-dist"><param name="glibasedir" value="compiled/gli"/></antcall>
211
212 <!-- strip out .svn dirs -->
213 <antcall target="strip-svn-dirs"><param name="dir" value="compiled"/></antcall>
214
215 <!-- 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 -->
216 <if>
217 <bool><equals arg1="${rk.os}" arg2="windows"/></bool>
218 <delete dir="compiled/bin/darwin"/>
219 <delete dir="compiled/bin/linux"/>
220 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
221 <delete dir="compiled/bin/windows"/>
222 <delete dir="compiled/bin/linux"/>
223 <else><if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
224 <delete dir="compiled/bin/windows"/>
225 <delete dir="compiled/bin/darwin"/>
226 </if></else>
227 </if></else>
228 </if>
229
230 <!-- (linux only) -->
231 <if><bool><equals arg1="${rk.os}" arg2="linux"/></bool>
232 <!-- grab imagemagick binaries -->
233 <delete dir="compiled/gs2build/bin/linux/imagemagick"/>
234
235 <exec executable="svn">
236 <arg line="${global-svn-args}"/>
237 <arg value="export"/>
238 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/imagemagick-linux${extension-x64}.tar.gz"/>
239 <arg value="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
240 </exec>
241
242 <exec executable="tar" dir="compiled/ext">
243 <arg value="xvzf"/>
244 <arg value="imagemagick-linux${extension-x64}.tar.gz"/>
245 </exec>
246 <delete file="compiled/ext/imagemagick-linux${extension-x64}.tar.gz"/>
247 <move todir="compiled/gs2build/bin/linux/imagemagick">
248 <fileset dir="compiled/ext/imagemagick/linux"/>
249 </move>
250 <delete dir="compiled/ext/imagemagick"/>
251
252 <!--<delete dir="compiled/gs2build/bin/linux/imagemagick"/>
253 <exec executable="svn">
254 <arg line="${global-svn-args}"/>
255 <arg value="export"/>
256 <arg value="${svn.root}/main/${branch.path}/binaries/linux/imagemagick"/>
257 <arg value="compiled/gs2build/bin/linux/imagemagick"/>
258 </exec>-->
259
260 <!-- We don't want to bundle the old pre-compiled 32 bit wv folder anymore -->
261 <!-- grab wv binaries -->
262 <!--<delete dir="compiled/gs2build/bin/linux/wv"/>
263 <exec executable="svn">
264 <arg line="${global-svn-args}"/>
265 <arg value="export"/>
266 <arg value="${svn.root}/main/${branch.path}/binaries/linux/wv"/>
267 <arg value="compiled/gs2build/bin/linux/wv"/>
268 </exec>
269 -->
270 <!-- (mac only) -->
271 <else><if><bool><equals arg1="${rk.os}" arg2="mac"/></bool>
272 <!-- grab imagemagick binaries -->
273
274 <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
275 <!-- before mojave -->
276 <!--<property name="darwin-imagick-tarball" value="imagemagick-darwin-10.5.tar.gz"/>-->
277 <!-- mojave onwards -->
278 <property name="darwin-imagick-tarball" value="imagemagick-darwin-10.11.tar.gz"/>
279 <exec executable="svn">
280 <arg line="${global-svn-args}"/>
281 <arg value="export"/>
282 <arg value="${svn.root}/gs2-extensions/imagemagick/trunk/${darwin-imagick-tarball}"/>
283 <arg value="compiled/ext/${darwin-imagick-tarball}"/>
284 </exec>
285
286 <exec executable="tar" dir="compiled/ext">
287 <arg value="xvzf"/>
288 <arg value="${darwin-imagick-tarball}"/>
289 </exec>
290 <delete file="compiled/ext/${darwin-imagick-tarball}"/>
291 <move todir="compiled/gs2build/bin/darwin/imagemagick">
292 <fileset dir="compiled/ext/imagemagick/darwin"/>
293 </move>
294 <delete dir="compiled/ext/imagemagick"/>
295
296
297 <!--
298 <delete dir="compiled/gs2build/bin/darwin/imagemagick"/>
299 <exec executable="svn">
300 <arg line="${global-svn-args}"/>
301 <arg value="export"/>
302 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/imagemagick"/>
303 <arg value="compiled/gs2build/bin/darwin/imagemagick"/>
304 </exec>-->
305
306 <if><bool><not><equals arg1="${forward.install.flax}" arg2="true"/></not></bool>
307 <!-- grab ghostscript binaries -->
308 <delete dir="compiled/gs2build/bin/darwin/ghostscript"/>
309 <exec executable="svn">
310 <arg line="${global-svn-args}"/>
311 <arg value="export"/>
312 <arg value="${svn.root}/main/${branch.path}/binaries/mac/intel/ghostscript"/>
313 <arg value="compiled/gs2build/bin/darwin/ghostscript"/>
314 </exec>
315 </if>
316 </if></else></if>
317
318 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool>
319 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
320 <arg line="-S"/>
321 <arg line="gs2build/bin/script/import.pl -removeold -site localsite lucene-jdbm-demo"/>
322 <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
323 <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
324 <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
325 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
326 <env key="GSDLOS" value="windows"/>
327 <env key="PERL_PERTURB_KEYS" value="0"/>
328 <env key="PERL_HASH_SEED" value="0"/>
329 <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
330 </exec>
331 <exec dir="${basedir}/compiled" executable="${basedir}/compiled/gs2build/bin/windows/perl/bin/perl">
332 <arg line="-S"/>
333 <arg line="gs2build/bin/script/buildcol.pl -removeold -site localsite lucene-jdbm-demo"/>
334 <env key="GSDLHOME" path="${basedir}/compiled/gs2build"/>
335 <env key="GSDL3HOME" path="${basedir}/compiled/web"/>
336 <env key="GSDL3SRCHOME" path="${basedir}/compiled"/>
337 <env key="GSDLCOLLECTDIR" path="${basedir}/compiled/web/sites/localsite/collect"/>
338 <env key="GSDLOS" value="windows"/>
339 <env key="PERL_PERTURB_KEYS" value="0"/>
340 <env key="PERL_HASH_SEED" value="0"/>
341 <env key="PATH" path="${basedir}/compiled/gs2build/bin/windows/perl/bin;${basedir}/compiled/gs2build/bin/windows;${basedir}/compiled/gs2build/bin/script;${env.PATH}"/>
342 </exec>
343 <delete dir="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
344 <move file="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building" tofile="${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index"/>
345 <else>
346 <echo file="${basedir}/compiled/buildscript.sh">
347 #!/bin/bash
348 source gs3-setup.sh
349 /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/import.pl -site localsite lucene-jdbm-demo
350 /usr/bin/perl -S ${basedir}/compiled/gs2build/bin/script/buildcol.pl -site localsite lucene-jdbm-demo
351 rm -rf ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
352 mv ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/building ${basedir}/compiled/web/sites/localsite/collect/lucene-jdbm-demo/index
353 </echo>
354 <chmod perm="775" file="${basedir}/compiled/buildscript.sh"/>
355 <exec dir="${basedir}/compiled" executable="/bin/bash">
356 <arg line="buildscript.sh"/>
357 </exec>
358 <delete file="${basedir}/compiled/buildscript.sh"/>
359 </else>
360 </if>
361
362 </target>
363
364</project>
Note: See TracBrowser for help on using the repository browser.