123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- #!/bin/sh
- BUILD="$HOME/ttfautohint-build"
- FREETYPE_VERSION="2.8"
- HARFBUZZ_VERSION="1.5.0"
- TTFAUTOHINT_VERSION="1.7"
- FREETYPE_PATCHES="\
- http://git.savannah.gnu.org/cgit/freetype/freetype2.git/patch/?id=c9a9cf59 \
- http://git.savannah.gnu.org/cgit/freetype/freetype2.git/patch/?id=c8829e4b \
- "
- HARFBUZZ_PATCHES=""
- TTFAUTOHINT_PATCHES=""
- FREETYPE="freetype-$FREETYPE_VERSION"
- HARFBUZZ="harfbuzz-$HARFBUZZ_VERSION"
- TTFAUTOHINT="ttfautohint-$TTFAUTOHINT_VERSION"
- if test -d "$BUILD" -o -f "$BUILD"; then
- echo "Build directory \`$BUILD' must not exist."
- exit 1
- fi
- INST="$BUILD/local"
- mkdir "$BUILD"
- mkdir "$INST"
- cd "$BUILD" || exit 1
- echo "#####"
- echo "Download all necessary archives and patches."
- echo "#####"
- curl -L -O "http://download.savannah.gnu.org/releases/freetype/$FREETYPE.tar.gz"
- curl -O "https://www.freedesktop.org/software/harfbuzz/release/$HARFBUZZ.tar.bz2"
- curl -L -O "http://download.savannah.gnu.org/releases/freetype/$TTFAUTOHINT.tar.gz"
- count=0
- for i in $FREETYPE_PATCHES
- do
- curl -o ft-patch-$count.diff "$i"
- count=$((count + 1))
- done
- count=0
- for i in $HARFBUZZ_PATCHES
- do
- curl -o hb-patch-$count.diff "$i"
- count=$((count + 1))
- done
- count=0
- for i in $TTFAUTOHINT_PATCHES
- do
- curl -o ta-patch-$count.diff "$i"
- count=$((count + 1))
- done
- TA_CPPFLAGS="-I$INST/include"
- TA_CFLAGS="-g -O2"
- TA_CXXFLAGS="-g -O2"
- TA_LDFLAGS="-L$INST/lib -L$INST/lib64"
- echo "#####"
- echo "Extract archives."
- echo "#####"
- tar -xzvf "$FREETYPE.tar.gz"
- tar -xjvf "$HARFBUZZ.tar.bz2"
- tar -xzvf "$TTFAUTOHINT.tar.gz"
- echo "#####"
- echo "Apply patches."
- echo "#####"
- cd "$FREETYPE" || exit 1
- for i in ../ft-patch-*.diff
- do
- test -f "$i" || continue
- patch -p1 -N -r - < "$i"
- done
- cd ..
- cd "$HARFBUZZ" || exit 1
- for i in ../hb-patch-*.diff
- do
- test -f "$i" || continue
- patch -p1 -N -r - < "$i"
- done
- cd ..
- cd "$TTFAUTOHINT" || exit 1
- for i in ../ta-patch-*.diff
- do
- test -f "$i" || continue
- patch -p1 -N -r - < "$i"
- done
- cd ..
- echo "#####"
- echo "$FREETYPE"
- echo "#####"
- cd "$FREETYPE" || exit 1
- ./configure \
- --without-bzip2 \
- --without-png \
- --without-zlib \
- --without-harfbuzz \
- --prefix="$INST" \
- --enable-static \
- --disable-shared \
- PKG_CONFIG=" " \
- CFLAGS="$TA_CPPFLAGS $TA_CFLAGS" \
- CXXFLAGS="$TA_CPPFLAGS $TA_CXXFLAGS" \
- LDFLAGS="$TA_LDFLAGS"
- make
- make install
- cd ..
- echo "#####"
- echo "$HARFBUZZ"
- echo "#####"
- cd "$HARFBUZZ" || exit 1
- ./configure \
- --disable-dependency-tracking \
- --disable-gtk-doc-html \
- --with-glib=no \
- --with-cairo=no \
- --with-fontconfig=no \
- --with-icu=no \
- --prefix="$INST" \
- --enable-static \
- --disable-shared \
- CFLAGS="$TA_CPPFLAGS $TA_CFLAGS" \
- CXXFLAGS="$TA_CPPFLAGS $TA_CXXFLAGS" \
- LDFLAGS="$TA_LDFLAGS" \
- PKG_CONFIG=true \
- FREETYPE_CFLAGS="$TA_CPPFLAGS/freetype2" \
- FREETYPE_LIBS="$TA_LDFLAGS -lfreetype"
- make
- make install
- cd ..
- echo "#####"
- echo "$TTFAUTOHINT"
- echo "#####"
- cd "$TTFAUTOHINT" || exit 1
- ./configure \
- --disable-dependency-tracking \
- --without-qt \
- --without-doc \
- --prefix="$INST" \
- --enable-static \
- --disable-shared \
- --with-freetype-config="$INST/bin/freetype-config" \
- CFLAGS="$TA_CPPFLAGS $TA_CFLAGS" \
- CXXFLAGS="$TA_CPPFLAGS $TA_CXXFLAGS" \
- LDFLAGS="$TA_LDFLAGS" \
- PKG_CONFIG=true \
- HARFBUZZ_CFLAGS="$TA_CPPFLAGS/harfbuzz" \
- HARFBUZZ_LIBS="$TA_LDFLAGS -lharfbuzz"
- make LDFLAGS="$TA_LDFLAGS -all-static"
- make install-strip
- cd ..
- echo "#####"
- echo "binary: $INST/bin/ttfautohint"
- echo "#####"
|