-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathharfbuzz
33 lines (28 loc) · 1.23 KB
/
harfbuzz
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
# Use legacy bundle on high-sierra
if [ "x${OSTYPE:6:1}" = "x1" ]; then
bottle="https://github.com/autobrew/bundler/releases/download/harfbuzz-7.1.0/harfbuzz-2.6.8-high_sierra.tar.xz"
else
bottle="https://github.com/autobrew/bundler/releases/download/harfbuzz-7.1.0/harfbuzz-7.1.0-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 -I${BREWDIR}/include/harfbuzz -I${BREWDIR}/include/freetype2 -I${BREWDIR}/include/fribidi"
# IMPORTANT: we need libharfbuzz-subset for meson builds because regular
# libharfbuzz depends on graphite even though we told it not to.
PKG_LIBS="-L${BREWDIR}/lib -lharfbuzz -lfreetype -lfribidi -lpng -lz"
# Prevent CRAN builder from linking against old libs in /usr/local/lib
for FILE in $BREWDIR/lib/*.a; do
BASENAME=$(basename $FILE)
LIBNAME=$(echo "${BASENAME%.*}" | cut -c4-)
cp -f $FILE $BREWDIR/lib/libbrew$LIBNAME.a
PKG_LIBS=$(echo $PKG_LIBS | sed "s/-l$LIBNAME /-lbrew$LIBNAME /g")
done
# Cleanup
echo "rm -Rf .deps" >> cleanup
chmod +x cleanup