Skip to content

Commit a0612ca

Browse files
committed
Add xz build directory to the base
1 parent 9dbf30b commit a0612ca

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

Sage_base/sage/xz/build_xz.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
VERSION=5.8.2
3+
SRC_DIR=xz-${VERSION}
4+
SRC_ARCHIVE=${SRC_DIR}.tar.gz
5+
URL=https://github.com/tukaani-project/xz/releases/download/v$VERSION}/${SRC_ARCHIVE}
6+
HASH=7bf2d887bd0ad401e0a4787a9033d9235036b3bb
7+
INSTALL_PREFIX=`pwd`/local
8+
ARCH=`/usr/bin/arch`
9+
10+
set -e
11+
cd xz
12+
13+
if ! [ -e ${SRC_ARCHIVE} ]; then
14+
echo "Downloading source archive ${SRC_ARCHIVE}..."
15+
curl -L -O ${URL}
16+
ACTUAL_HASH=`/usr/bin/shasum ${SRC_ARCHIVE} | cut -f 1 -d' '`
17+
if [[ ${ACTUAL_HASH} != ${HASH} ]]; then
18+
echo Invalid hash value for ${SRC_ARCHIVE}
19+
exit 1
20+
fi
21+
fi
22+
23+
if ! [ -d ${SRC_DIR} ]; then
24+
tar xfz ${SRC_ARCHIVE}
25+
pushd ${SRC_DIR}
26+
for patchfile in `ls ../patches`; do
27+
patch -p1 < ../patches/$patchfile
28+
done
29+
popd
30+
fi
31+
32+
cd ${SRC_DIR}
33+
if [ -e Makefile ]; then
34+
make distclean
35+
fi
36+
37+
if [ $ARCH == "arm64" ]; then
38+
./configure \
39+
--prefix=${INSTALL_PREFIX} \
40+
CFLAGS="-mmacosx-version-min=11" \
41+
LDFLAGS="-Wl,-ld_classic"
42+
else
43+
./configure \
44+
--prefix=${INSTALL_PREFIX} \
45+
CFLAGS="-mmacosx-version-min=10.13" \
46+
LDFLAGS="-Wl,-ld_classic"
47+
fi
48+
echo "Building xz ..."
49+
gmake -j8
50+
gmake install

0 commit comments

Comments
 (0)