Index: font.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/font.eclass,v retrieving revision 1.56 diff -u -B -r1.56 font.eclass --- font.eclass 9 Jun 2013 02:08:23 -0000 1.56 +++ font.eclass 3 Jul 2013 11:53:26 -0000 @@ -9,7 +9,7 @@ inherit eutils -EXPORT_FUNCTIONS pkg_setup src_install pkg_postinst pkg_postrm +EXPORT_FUNCTIONS pkg_setup src_install pkg_preinst pkg_postinst pkg_postrm # @ECLASS-VARIABLE: FONT_SUFFIX # @DEFAULT_UNSET @@ -25,6 +25,13 @@ # Working directory containing the fonts. FONT_S=${FONT_S:-${S}} +# @ECLASS-VARIABLE: FONT_SLOT +# @DEFAULT_UNSET +# @REQUIRED +# @DESCRIPTION: +# Slot of the installed font package +FONT_SLOT=${FONT_SLOT:-${SLOT}} + # @ECLASS-VARIABLE: FONT_PN # @DESCRIPTION: # Font name (ie. last part of FONTDIR). @@ -35,6 +42,13 @@ # Full path to installation directory. FONTDIR=${FONTDIR:-/usr/share/fonts/${FONT_PN}} +# @ECLASS-VARIABLE: FONT_X11_CONF +# @DEFAULT_UNSET +# @REQUIRED +# @DESCRIPTION: +# X11 config file containing the additional fontpath element. +FONT_X11_CONF=${FONT_X11_CONF:-/etc/X11/xorg.conf.d/90-${FONT_PN}-${FONT_SLOT}.conf} + # @ECLASS-VARIABLE: FONT_CONF # @DEFAULT_UNSET # @DESCRIPTION: @@ -74,6 +88,23 @@ if [[ -e ${FONT_S}/fonts.alias ]] ; then doins "${FONT_S}"/fonts.alias fi + # this is not epreix compatible, as is the default FONTDIR + # are (massive) multiple entries in fontpath problematic? + if [[ -n ${FONT_X11_CONF} ]] && + [[ ${FONTDIR} != /usr/share/fonts/75dpi ]] && + [[ ${FONTDIR} != /usr/share/fonts/100dpi ]] && + [[ ${FONTDIR} != /usr/share/fonts/misc ]] && + [[ ${FONTDIR} != /usr/share/fonts/TTF ]] && + [[ ${FONTDIR} != /usr/share/fonts/OTF ]] && + [[ ${FONTDIR} != /usr/share/fonts/TYPE1 ]] ; then + { + echo "Section \"Files\"" + echo " FontPath \"${FONTDIR}\"" + echo "EndSection" + } > ${T}/$(basename ${FONT_X11_CONF}) + insinto /etc/X11/xorg.conf.d + doins ${T}/$(basename ${FONT_X11_CONF}) + fi fi } @@ -188,6 +219,18 @@ done } +# @FUNCTION: font_pkg_preinst +# @DESCRIPTION: +# The font pkg_preinst function. +font_pkg_preinst() { + if has X ${USE} && [[ -n "${FONT_X11_CONF}" ]] && + ! [[ -e ${EROOT}${FONT_X11_CONF} ]] ; then + elog "A new path element has been added to x11 fontpath." + elog "Either restart your x11 sessions or run" + elog "xset fp+ ${FONTDIR} ; xset fp rehash" + fi +} + # @FUNCTION: font_pkg_postinst # @DESCRIPTION: # The font pkg_postinst function.