Wednesday, April 30, 2014

Compiling FontForge2 on Centos 6

As devops engineer I get often challenged by PHP developers to install cutting edge (almost bleeding!) packages against a conservative and stable distro like Centos. Recently I was asked to install grunt-webfont on one of the deployment servers which runs on Centos 6.

This npm package requires FontForge 2 which is not available on the base repo of Centos 6 (the current one is very outdated...dating to 2009!). Looking for prebuilt RPMs proved difficult, if not pointless so I decided to take a shot in compiling from sources. Since compiling FontForge 2 on Linux is a royal pain in the ass, I hope that this document will save you some time (read hours!):


Install these packages with yum:

$ sudo yum install libtool libtool-ltdl libtool-ltdl-devel libuninameslist-devel libXt-devel xorg-x11-proto-devel gettext pango-devel cairo-devel freetype-devel libxml2 libxml2-devel ibpng libpng-devel giflib-devel giflib libjpeg-turbo-devel libjpeg-turbo libtiff-devel libtiff libspiro-devel libspiro cairo

Install autoconf 2.69 from rpm:
$ wget ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/monkeyiq:/centos6updates/CentOS_CentOS-6/noarch/autoconf-2.69-12.2.noarch.rpm

$ sudo yum localinstall autoconf-2.69-12.2.noarch.rpm


Install the iPython module:
$ pip2.7 install ipython



Install bdwgc:
$git clone https://github.com/ivmai/bdwgc/

$ push bdwgc

$ git clone https://github.com/ivmai/libatomic_ops/

$ pushd libatomic_ops && ./configure

$ make && sudo make install

$ popd

$ ./autogen.sh && ./configure

$ make && sudo make install

$ popd



Install FontForge 2:
$git clone https://github.com/fontforge/fontforge.git

$ pushd && ./bootstrap

$ ./configure

$ make && sudo make install