# $Id$
PNAME="fontconfig"
PVER="2.11.1"
PBUILD="r1"
PCAT="media-libs"
DESCRIPTION="fontconfig is a library for configuring and customizing font access."
HOMEPAGE="http://fontconfig.org/"
DEPEND=">= media-libs/freetype-2.5
>= dev-libs/expat-2"
SDEPEND=">= virtual/sed"
SRCFILE="${PNAME}-${PVER}.tar.gz"
SRCDIR="${BUILDDIR}/${PNAME}-${PVER}"
sminclude multilib mtools
SRC_URI=(
http://fontconfig.org/release/${SRCFILE}
mirror://${PNAME}/${SRCFILE}
"mirror://${PNAME}/man-2.3.1/fc-cache.man man-2.3.1"
"mirror://${PNAME}/man-2.3.1/fc-list.man man-2.3.1"
)
UP2DATE="updatecmd http://fontconfig.org/release/ | grep ${PNAME}- | lasttarball gz"
src_compile()
{
mconfigure \
--disable-docs \
--with-docdir=/usr/share/doc/${PNAME}-${PVER} \
--x-includes=/usr/include \
--x-libraries=/usr/$(mlibdir) \
--with-default-fonts=/usr/share/fonts \
--with-add-fonts=/usr/local/share/fonts \
|| die
# does not like optimations
mmake -j1 || die
# remove Luxi TTF fonts from the list, the Type1 are much better
# all-abis 'sed -i "s:
/usr/$(mlibdir)/X11/fonts/TTF::" fonts.conf' || die
}
src_install()
{
mmake DESTDIR=${BINDIR} install || die
# install font.conf
minstallfile fonts.conf /etc/fonts || die
minstallfile fonts.conf /etc/fonts/fonts.conf.new || die
# fc-lang directory contains language coverage datafiles
# which are needed to test the coverage of fonts.
minstalldir /usr/share/fc-lang || die
minstallfile fc-lang/\*.orth /usr/share/fc-lang || die
# install man-pages
# we're using prebuilded man pages to prevent docbook dependencies
minstalldir /usr/share/man/man1 || die
minstallfile -s man-2.3.1/fc-cache.man /usr/share/man/man1/fc-cache.1 || die
minstallfile -s man-2.3.1/fc-list.man /usr/share/man/man1/fc-list.1 || die
}
preinstall()
{
# delete this file if it exists
[ -f ${MROOT}/etc/fonts/fonts.conf.new ] && \
rm -f ${MROOT}/etc/fonts/fonts.conf.new
}
postinstall()
{
echo "Creating new font cache..."
# force update; config_protect will prevent this
mv -f ${MROOT}/etc/fonts/fonts.conf.new ${MROOT}/etc/fonts/fonts.conf
rm -f ${MROOT}/etc/fonts/._cfg????_fonts.conf
HOME="${MROOT}/root" ${MROOT}/usr/bin/fc-cache -sr
}