-
Notifications
You must be signed in to change notification settings - Fork 5
40 lines (33 loc) · 1.29 KB
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
# Use legacy bundle on high-sierra
if [ "x${OSTYPE:6:1}" = "x1" ]; then
bottle="https://github.com/autobrew/bundler/releases/download/openssl-1.1.1t/openssl-1.1.1h-high_sierra.tar.xz"
else
bottle="https://github.com/autobrew/bundler/releases/download/openssl-1.1.1t/openssl-1.1.1t-universal.tar.xz"
fi
# Skip if disabled
if [ "$DISABLE_AUTOBREW" ]; then return 0; fi
echo "Using autobrew bundle: $(basename $bottle)"
# General setup
BREWDIR="$PWD/.deps"
mkdir -p $BREWDIR
curl -sSL $bottle -o libs.tar.xz
tar -xf libs.tar.xz --strip 1 -C $BREWDIR && rm -f libs.tar.xz
PKG_CFLAGS="-I${BREWDIR}/include"
PKG_LIBS="-L${BREWDIR}/lib -lssl -lcrypto"
# package may look under /opt
mkdir -p $BREWDIR/opt/{openssl,[email protected]}
ln -s $BREWDIR/{include,lib} $BREWDIR/opt/openssl/
ln -s $BREWDIR/{include,lib} $BREWDIR/opt/[email protected]/
# Some old workarounds for MacOS 10.11
if [ $(sw_vers -productVersion | grep -F "10.11") ]; then
echo "PKG_CFLAGS=-isysroot /" >> src/Makevars.in
echo "#include <stdio.h>" > $PKG_TEST_FILE
# Workaround for s2 package
sed -i.bak 's@PKG_CXXFLAGS = @PKG_CXXFLAGS = -isysroot / @g' src/Makevars.in
# Workaround for IPv6 problems on CRAN
rm -f tests/testthat/test_google.R
sed -i.bak 's/cloud/cran/g' man/certificates.Rd && rm man/*.bak
fi
# Cleanup
echo "rm -Rf .deps" >> cleanup
chmod +x cleanup