1 | #!/usr/bin/env bash |
---|
2 | |
---|
3 | CUR=`pwd` |
---|
4 | cd .. |
---|
5 | SAGE_ROOT=`pwd` |
---|
6 | # Storing the start time of the build process. The time is stored in |
---|
7 | # seconds since 1970-01-01 in a hidden file called |
---|
8 | # "SAGE_ROOT/.BUILDSTART". See ticket #6744. |
---|
9 | echo `date -u "+%s"` > .BUILDSTART |
---|
10 | cd "$CUR" |
---|
11 | SAGE_LOCAL="$SAGE_ROOT/local" |
---|
12 | SAGE_LOGS="$SAGE_ROOT/spkg/logs" |
---|
13 | PATH="$SAGE_ROOT:$SAGE_LOCAL/bin:$PATH" |
---|
14 | PYTHONPATH="$SAGE_LOCAL" |
---|
15 | PKGDIR=standard |
---|
16 | export PATH SAGE_ROOT SAGE_LOCAL SAGE_LOGS PYTHONPATH |
---|
17 | |
---|
18 | if [ ! -f "$SAGE_LOCAL/bin/sage-spkg" ]; then |
---|
19 | if [ ! -d "$SAGE_LOCAL" ]; then |
---|
20 | mkdir "$SAGE_LOCAL" |
---|
21 | fi |
---|
22 | if [ ! -d "$SAGE_LOCAL/bin" ]; then |
---|
23 | mkdir "$SAGE_LOCAL/bin" |
---|
24 | fi |
---|
25 | cp base/sage-* base/testcc.sh base/testcxx.sh "$SAGE_LOCAL/bin/" |
---|
26 | fi |
---|
27 | |
---|
28 | if [ ! -d "$SAGE_LOGS" ]; then |
---|
29 | mkdir -p "$SAGE_LOGS" |
---|
30 | fi |
---|
31 | |
---|
32 | ############ |
---|
33 | # Setup environment variables pointing to the newest versions |
---|
34 | # of the base packages |
---|
35 | ############ |
---|
36 | newest="$PKGDIR/newest_version -base " |
---|
37 | |
---|
38 | SAGE_BZIP2=`$newest bzip2` |
---|
39 | export SAGE_BZIP2 |
---|
40 | |
---|
41 | DIR=`$newest dir` |
---|
42 | export DIR |
---|
43 | |
---|
44 | PREREQ=`$newest prereq` |
---|
45 | export PREREQ |
---|
46 | |
---|
47 | ############ |
---|
48 | # Setup environment variables pointing to the newest versions |
---|
49 | # of the standard packages |
---|
50 | ############ |
---|
51 | newest="$PKGDIR/newest_version" |
---|
52 | |
---|
53 | ATLAS=`$newest atlas` |
---|
54 | export ATLAS |
---|
55 | |
---|
56 | BLAS=`$newest blas` |
---|
57 | export BLAS |
---|
58 | |
---|
59 | BOEHM_GC=`$newest boehm_gc` |
---|
60 | export BOEHM_GC |
---|
61 | |
---|
62 | BOOST_CROPPED=`$newest boost-cropped` |
---|
63 | export BOOST_CROPPED |
---|
64 | |
---|
65 | CEPHES=`$newest cephes` |
---|
66 | export CEPHES |
---|
67 | |
---|
68 | CLIQUER=`$newest cliquer` |
---|
69 | export CLIQUER |
---|
70 | |
---|
71 | CDDLIB=`$newest cddlib` |
---|
72 | export CDDLIB |
---|
73 | |
---|
74 | ECL=`$newest ecl` |
---|
75 | export ECL |
---|
76 | |
---|
77 | CONWAY=`$newest conway_polynomials` |
---|
78 | if [ $? -ne 0 ]; then |
---|
79 | echo "Error determining package name using spkg/standard/newest_version script." |
---|
80 | exit 1 |
---|
81 | fi |
---|
82 | export CONWAY |
---|
83 | |
---|
84 | ECLIB=`$newest eclib` |
---|
85 | export ECLIB |
---|
86 | |
---|
87 | ELLIPTIC_CURVES=`$newest elliptic_curves` |
---|
88 | export ELLIPTIC_CURVES |
---|
89 | |
---|
90 | CVXOPT=`$newest cvxopt` |
---|
91 | export CVXOPT |
---|
92 | |
---|
93 | DOCUTILS=`$newest docutils` |
---|
94 | export DOCUTILS |
---|
95 | |
---|
96 | ECM=`$newest ecm` |
---|
97 | export ECM |
---|
98 | |
---|
99 | EXAMPLES=`$newest examples` |
---|
100 | export EXAMPLES |
---|
101 | |
---|
102 | EXTCODE=`$newest extcode` |
---|
103 | export EXTCODE |
---|
104 | |
---|
105 | F2C=`$newest f2c` |
---|
106 | export F2C |
---|
107 | |
---|
108 | ICONV=`$newest iconv` |
---|
109 | export ICONV |
---|
110 | |
---|
111 | ############# |
---|
112 | # This is all for GNUtls crypto |
---|
113 | LIBGCRYPT=`$newest libgcrypt` |
---|
114 | export LIBGCRYPT |
---|
115 | |
---|
116 | OPENCDK=`$newest opencdk` |
---|
117 | export OPENCDK |
---|
118 | |
---|
119 | GNUTLS=`$newest gnutls` |
---|
120 | export GNUTLS |
---|
121 | |
---|
122 | LIBGPG_ERROR=`$newest libgpg_error` |
---|
123 | export LIBGPG_ERROR |
---|
124 | |
---|
125 | PYGMENTS=`$newest pygments` |
---|
126 | export PYGMENTS |
---|
127 | |
---|
128 | PYTHON_GNUTLS=`$newest python_gnutls` |
---|
129 | export PYTHON_GNUTLS |
---|
130 | ############# end gnutls crypto |
---|
131 | |
---|
132 | PIL=`$newest pil` |
---|
133 | export PIL |
---|
134 | |
---|
135 | LIBM4RI=`$newest libm4ri` |
---|
136 | export LIBM4RI |
---|
137 | |
---|
138 | FORTRAN=`$newest fortran` |
---|
139 | export FORTRAN |
---|
140 | |
---|
141 | FPLLL=`$newest libfplll` |
---|
142 | export FPLLL |
---|
143 | |
---|
144 | FREETYPE=`$newest freetype` |
---|
145 | export FREETYPE |
---|
146 | |
---|
147 | GAP=`$newest gap` |
---|
148 | export GAP |
---|
149 | |
---|
150 | G2RED=`$newest genus2reduction` |
---|
151 | export G2RED |
---|
152 | |
---|
153 | GD=`$newest gd` |
---|
154 | export GD |
---|
155 | |
---|
156 | GDMODULE=`$newest gdmodule` |
---|
157 | export GDMODULE |
---|
158 | |
---|
159 | GFAN=`$newest gfan` |
---|
160 | export GFAN |
---|
161 | |
---|
162 | GIVARO=`$newest givaro` |
---|
163 | export GIVARO |
---|
164 | |
---|
165 | GHMM=`$newest ghmm` |
---|
166 | export GHMM |
---|
167 | |
---|
168 | MPIR=`$newest mpir` |
---|
169 | export MPIR |
---|
170 | |
---|
171 | GRAPHS=`$newest graphs` |
---|
172 | export GRAPHS |
---|
173 | |
---|
174 | GSL=`$newest gsl` |
---|
175 | export GSL |
---|
176 | |
---|
177 | IPYTHON=`$newest ipython` |
---|
178 | export IPYTHON |
---|
179 | |
---|
180 | LAPACK=`$newest lapack` |
---|
181 | export LAPACK |
---|
182 | |
---|
183 | LCALC=`$newest lcalc` |
---|
184 | export LCALC |
---|
185 | |
---|
186 | LIBPNG=`$newest libpng` |
---|
187 | export LIBPNG |
---|
188 | |
---|
189 | LINBOX=`$newest linbox` |
---|
190 | export LINBOX |
---|
191 | |
---|
192 | IML=`$newest iml` |
---|
193 | export IML |
---|
194 | |
---|
195 | JINJA2=`$newest jinja2` |
---|
196 | export JINJA2 |
---|
197 | |
---|
198 | MATPLOTLIB=`$newest matplotlib` |
---|
199 | export MATPLOTLIB |
---|
200 | |
---|
201 | MAXIMA=`$newest maxima` |
---|
202 | export MAXIMA |
---|
203 | |
---|
204 | MERCURIAL=`$newest mercurial` |
---|
205 | export MERCURIAL |
---|
206 | |
---|
207 | MPFI=`$newest mpfi` |
---|
208 | export MPFI |
---|
209 | |
---|
210 | MOIN=`$newest moin` |
---|
211 | export MOIN |
---|
212 | |
---|
213 | MPFR=`$newest mpfr` |
---|
214 | export MPFR |
---|
215 | |
---|
216 | MPMATH=`$newest mpmath` |
---|
217 | export MPMATH |
---|
218 | |
---|
219 | NETWORKX=`$newest networkx` |
---|
220 | export NETWORKX |
---|
221 | |
---|
222 | NUMPY=`$newest numpy` |
---|
223 | export NUMPY |
---|
224 | |
---|
225 | NTL=`$newest ntl` |
---|
226 | export NTL |
---|
227 | |
---|
228 | #OPENSSL=`$newest openssl` |
---|
229 | #export OPENSSL |
---|
230 | |
---|
231 | #PYOPENSSL=`$newest pyopenssl` |
---|
232 | #export PYOPENSSL |
---|
233 | |
---|
234 | PALP=`$newest palp` |
---|
235 | export PALP |
---|
236 | |
---|
237 | PARI=`$newest pari` |
---|
238 | export PARI |
---|
239 | |
---|
240 | PEXPECT=`$newest pexpect` |
---|
241 | export PEXPECT |
---|
242 | |
---|
243 | POLYBORI=`$newest polybori` |
---|
244 | export POLYBORI |
---|
245 | |
---|
246 | PYNAC=`$newest pynac` |
---|
247 | export PYNAC |
---|
248 | |
---|
249 | CYTHON=`$newest cython` |
---|
250 | export CYTHON |
---|
251 | |
---|
252 | RATPOINTS=`$newest ratpoints` |
---|
253 | export RATPOINTS |
---|
254 | |
---|
255 | SAGENB=`$newest sagenb` |
---|
256 | export SAGENB |
---|
257 | |
---|
258 | SAGETEX=`$newest sagetex` |
---|
259 | export SAGETEX |
---|
260 | |
---|
261 | SPHINX=`$newest sphinx` |
---|
262 | export SPHINX |
---|
263 | |
---|
264 | SQLALCHEMY=`$newest sqlalchemy` |
---|
265 | export SQLALCHEMY |
---|
266 | |
---|
267 | SQLITE=`$newest sqlite` |
---|
268 | export SQLITE |
---|
269 | |
---|
270 | FLINTQS=`$newest flintqs` |
---|
271 | export FLINTQS |
---|
272 | |
---|
273 | FLINT=`$newest flint` |
---|
274 | export FLINT |
---|
275 | |
---|
276 | POLYTOPES_DB=`$newest polytopes_db` |
---|
277 | export POLYTOPES_DB |
---|
278 | |
---|
279 | PYCRYPTO=`$newest pycrypto` |
---|
280 | export PYCRYPTO |
---|
281 | |
---|
282 | PYTHON=`$newest python` |
---|
283 | export PYTHON |
---|
284 | |
---|
285 | R=`$newest r` |
---|
286 | export R |
---|
287 | |
---|
288 | READLINE=`$newest readline` |
---|
289 | export READLINE |
---|
290 | |
---|
291 | RUBIKS=`$newest rubiks` |
---|
292 | export RUBIKS |
---|
293 | |
---|
294 | SAGE=`$newest sage` |
---|
295 | export SAGE |
---|
296 | |
---|
297 | SAGE_SCRIPTS=`$newest sage_scripts` |
---|
298 | export SAGE_SCRIPTS |
---|
299 | |
---|
300 | SCIPY=`$newest scipy` |
---|
301 | export SCIPY |
---|
302 | |
---|
303 | SCIPY_SANDBOX=`$newest scipy_sandbox` |
---|
304 | export SCIPY_SANDBOX |
---|
305 | |
---|
306 | TACHYON=`$newest tachyon` |
---|
307 | export TACHYON |
---|
308 | |
---|
309 | TWISTED=`$newest twisted` |
---|
310 | export TWISTED |
---|
311 | |
---|
312 | SCONS=`$newest scons` |
---|
313 | export SCONS |
---|
314 | |
---|
315 | SETUPTOOLS=`$newest setuptools` |
---|
316 | export SETUPTOOLS |
---|
317 | |
---|
318 | SINGULAR=`$newest singular` |
---|
319 | export SINGULAR |
---|
320 | |
---|
321 | SYMPOW=`$newest sympow` |
---|
322 | export SYMPOW |
---|
323 | |
---|
324 | SYMPY=`$newest sympy` |
---|
325 | export SYMPY |
---|
326 | |
---|
327 | SYMMETRICA=`$newest symmetrica` |
---|
328 | export SYMMETRICA |
---|
329 | |
---|
330 | TERMCAP=`$newest termcap` |
---|
331 | export TERMCAP |
---|
332 | |
---|
333 | WEAVE=`$newest weave` |
---|
334 | export WEAVE |
---|
335 | |
---|
336 | ZLIB=`$newest zlib` |
---|
337 | export ZLIB |
---|
338 | |
---|
339 | ZODB=`$newest zodb3` |
---|
340 | export ZODB |
---|
341 | |
---|
342 | ZNPOLY=`$newest zn_poly` |
---|
343 | export ZNPOLY |
---|
344 | |
---|
345 | ######## |
---|
346 | # NOW do the actual build |
---|
347 | if [ "$SAGE_PARALLEL_SPKG_BUILD" = "yes" ] && [ -n "$MAKE" ]; then |
---|
348 | time $MAKE -f standard/deps $1 |
---|
349 | else |
---|
350 | time make -f standard/deps $1 |
---|
351 | fi |
---|
352 | |
---|
353 | # added by Burcin Erocal, see trac #6295. |
---|
354 | if [ $? -ne 0 ]; then |
---|
355 | echo "Error building Sage." |
---|
356 | exit 1 |
---|
357 | fi |
---|
358 | |
---|
359 | if [ "$1" = "all" -a $? = 0 ]; then |
---|
360 | echo "To install gap, gp, singular, etc., scripts" |
---|
361 | echo "in a standard bin directory, start sage and" |
---|
362 | echo "type something like" |
---|
363 | echo " sage: install_scripts('/usr/local/bin')" |
---|
364 | echo "at the Sage command prompt." |
---|
365 | echo "" |
---|
366 | echo "To build the documentation, run" |
---|
367 | echo " make doc" |
---|
368 | echo "" |
---|
369 | echo "Sage build/upgrade complete!" |
---|
370 | fi |
---|