Apostolos\’ Daily Plate

Compiling FontForge on OpenIndiana

Posted in Πληροφορική, OpenIndiana by asyropoulos on Απρίλιος 3, 2018

FontForge is an open-source font editor. I have been using this editor for many year and I always compile it myself on OI/hipster. In order to proceed, one need to download and install a few libraries:

We only need the source code of the FreeType not to compile it. Compiling the other two libraries is easy:

$ CC=gcc64 ./configure --prefix=/opt/gnu \
--libdir=/opt/gnu/lib/amd64 --bindir=/opt/gnu/bin/amd64"

The command gcc64 is actually a script that calls gcc with the -m64 option enabled. To configure fontforge I had to make sure GNU date is the first date accessible. Also, I had to patch the configure script as follows:

--- configure.old       2018-04-03 10:59:31.003080406 +0000
+++ configure   2018-03-31 16:49:04.069977255 +0000
@@ -37305,10 +37305,10 @@
 fi
 FONTFORGE_DATE_NOW=${SOURCE_DATE_EPOCH:-$(date +'%s')}
 FONTFORGE_DATE_OPTS="--date=@${FONTFORGE_DATE_NOW}"
-if ! date --version 2>/dev/null ; then
-  # Use POSIX date instead of GNU date on BSD systems
-  FONTFORGE_DATE_OPTS="-j -f %s ${FONTFORGE_DATE_NOW}"
-fi
+#if ! date --version 2>/dev/null ; then
+#  # Use POSIX date instead of GNU date on BSD systems
+#  FONTFORGE_DATE_OPTS="-j -f %s ${FONTFORGE_DATE_NOW}"
+#fi
 FONTFORGE_MODTIME="$(date -u $FONTFORGE_DATE_OPTS +'%s')L"
 FONTFORGE_MODTIME_STR="$(date -u $FONTFORGE_DATE_OPTS +'%H:%M %Z %e-%b-%Y')"
 FONTFORGE_VERSIONDATE="$(date -u $FONTFORGE_DATE_OPTS +'%Y%m%d')"

The command that follows is the one I have used to configure fontforge:

CC=gcc64 CXX=g++64 CFLAGS="-I/opt/gnu/include" LIBSPIRO_CFLAGS="-I/opt/gnu/include" \
LDFLAGS="-L/opt/gnu/lib/amd64 -R/opt/gnu/lib/amd64" ./configure --prefix=/opt/gnu \
--libdir=/opt/gnu/lib/amd64 --bindir=/opt/gnu/bin/amd64/ \
--with-freetype-source=../freetype-2.6.5

Of course you should adjust the name of the freetype source tree. That’s it.

Advertisements