/
spkg-src
executable file
·57 lines (47 loc) · 1.46 KB
/
spkg-src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env bash
#
# Script to prepare a ECL tarball for Sage. This script is only for the
# package maintainer, not for building ECL during a Sage install.
# WARNING: This script will delete/overwrite files in this directory
# and its subdirectories!
#
# HOW TO MAKE THE TARBALL:
# 1) sage --sh build/pkgs/ecl/spkg-src
#
# needs autotools and sage in your PATH.
#
# AUTHOR: Jeroen Demeyer (November 2011)
# Dima Pasechnik (July 2015)
if [ -z "$SAGE_ROOT" ] ; then
echo >&2 "Error - SAGE_ROOT undefined ... exiting"
echo >&2 "Maybe run 'sage -sh'?"
exit 1
fi
# Exit on failure
set -e
cd build/pkgs/ecl
ECLVERSION=`cat package-version.txt |sed 's/[.]p.*//'`
ECLTARBALL="$SAGE_DISTFILES/ecl-$ECLVERSION.tar.bz2"
# Remove old cruft
rm -rf ecl-*
# Download and extract upstream tarball
sage-download-file https://common-lisp.net/project/ecl/static/files/release/ecl-$ECLVERSION.tgz |tar xz
cd ecl-$ECLVERSION
# Some patches are applied here, if they need to be applied before
# running autoconf.
echo "applying patches in ecl-$ECLVERSION/src"
# For some of the patches, Cygwin also has upstream fixes that are
# closely related, keep track. See Trac #11119, for example.
for patch in ../patches/src/*.patch; do
patch -p1 <"$patch"
done
# Remove unneeded files to save space
rm -r msvc src/gmp/ src/libffi
# Run autotools
cd src
libtoolize
autoreconf -ivf
cd ../..
tar c ecl-$ECLVERSION | bzip2 -c >"$ECLTARBALL"
sage-fix-pkg-checksums "$ECLTARBALL"
rm -rf ecl-*