Skip to content

Instantly share code, notes, and snippets.

@lazar-mitrovic
Last active February 25, 2020 23:57
Show Gist options
  • Save lazar-mitrovic/24a9bd1e14fdfd82871029137cfcce81 to your computer and use it in GitHub Desktop.
Save lazar-mitrovic/24a9bd1e14fdfd82871029137cfcce81 to your computer and use it in GitHub Desktop.
Builds libfreetype for Android
#!/bin/bash
set -e
FREETYPE_VER="2.9"
if [ ! -d "toolchain" ]; then
$ANDROID_NDK/build/tools/make-standalone-toolchain.sh --arch=arm64 --platform=android-21 --install-dir=$(pwd)/toolchain
fi
export TOOLCHAIN=$(pwd)/toolchain
if [ ! -d "freetype-$FREETYPE_VER" ]; then
wget -nc http://download.savannah.gnu.org/releases/freetype/freetype-$FREETYPE_VER.tar.bz2
tar -xf freetype-$FREETYPE_VER.tar.bz2
fi
OLDPATH=$PATH
export PATH=$TOOLCHAIN/bin:$PATH
pushd "freetype-$FREETYPE_VER"
export FREETYPE=`pwd`
sed -i 's/\-version\-info \$(version_info)/-avoid-version/' builds/unix/unix-cc.in
./configure --host=aarch64-linux-android --prefix=$FREETYPE/install --without-png --without-zlib --without-harfbuzz --enable-shared
make clean
make
make install
popd
export PATH=$OLDPATH
[ ! -e "freetype" ] || rm "freetype"
ln -s "freetype-$FREETYPE_VER" "freetype"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment