aboutsummaryrefslogtreecommitdiff
path: root/math/sage/files/patch-src_bin_sage-spkg
blob: 1533ba10e11ff7fb31be7d618e39ddc9586f26a8 (plain) (blame)
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
--- src/bin/sage-spkg-orig	2014-01-29 17:26:07.000000000 +0000
+++ src/bin/sage-spkg	2014-01-29 17:41:25.000000000 +0000
@@ -593,6 +593,29 @@
     exit 1
 fi
 
+if ls fbsd-patch-* > /dev/null 2>&1; then
+    echo "===>   Applying FreeBSD patches"
+    cat fbsd-patch-* | patch -p0 || exit 1
+    echo "===>   Done applying FreeBSD patches"
+fi
+
+# Inspired by run-autotools-fixup target in Mk/bsd.port.mk.
+# Work around an issue where FreeBSD 10.0 is detected as FreeBSD 1.x.
+for f in `find src -type f \( -name config.libpath -o \
+    -name config.rpath -o -name configure -o -name libtool.m4 -o \
+    -name ltconfig -o -name libtool -o -name aclocal.m4 -o \
+    -name acinclude.m4 \)` ; do \
+        sed -i.fbsd10bak \
+                -e 's|freebsd1\*)|freebsd1.\*)|g' \
+                -e 's|freebsd\[12\]\*)|freebsd[12].*)|g' \
+                -e 's|freebsd\[123\]\*)|freebsd[123].*)|g' \
+                -e 's|freebsd\[\[12\]\]\*)|freebsd[[12]].*)|g' \
+                -e 's|freebsd\[\[123\]\]\*)|freebsd[[123]].*)|g' \
+                        ${f}
+        rm -f ${f}.fbsd10bak
+        echo "===>   FreeBSD 10 autotools fix applied to ${f}"; \
+done
+
 # When there is no spkg-install, assume the "spkg" is a tarball not
 # specifically made for Sage.  Since we want it to be as easy as
 # possible to install such a package, we "guess" spkg-install.