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

Last change on this file since 37382 was 37382, checked in by anupama, 14 months ago

Changes to get release-kit building on mojave as at Mar 2023. Also added in the PERL_HASH_SEED to go with the PERL_PERTURB_KEYS that were already added in.

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