yngwin      15/02/21 07:20:22

  Modified:             ChangeLog font.eclass
  Log:
  Apply patch from Ryan Hill to font.eclass to support multiple FONT_S 
directories (bug #338634)

Revision  Changes    Path
1.1546               eclass/ChangeLog

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1546&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1546&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1545&r2=1.1546

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1545
retrieving revision 1.1546
diff -u -r1.1545 -r1.1546
--- ChangeLog   20 Feb 2015 17:57:22 -0000      1.1545
+++ ChangeLog   21 Feb 2015 07:20:22 -0000      1.1546
@@ -1,6 +1,10 @@
 # ChangeLog for eclass directory
 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1545 2015/02/20 
17:57:22 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1546 2015/02/21 
07:20:22 yngwin Exp $
+
+  21 Feb 2015; Ben de Groot <[email protected]> font.eclass:
+  Apply patch from Ryan Hill to font.eclass to support multiple FONT_S
+  directories (bug #338634)
 
   20 Feb 2015; Michał Górny <[email protected]> distutils-r1.eclass,
   python-r1.eclass, python-single-r1.eclass, python-utils-r1.eclass:



1.58                 eclass/font.eclass

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/font.eclass?rev=1.58&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/font.eclass?rev=1.58&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/font.eclass?r1=1.57&r2=1.58

Index: font.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/font.eclass,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- font.eclass 25 Jul 2013 13:13:18 -0000      1.57
+++ font.eclass 21 Feb 2015 07:20:22 -0000      1.58
@@ -1,6 +1,6 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.57 2013/07/25 
13:13:18 pva Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.58 2015/02/21 
07:20:22 yngwin Exp $
 
 # @ECLASS: font.eclass
 # @MAINTAINER:
@@ -19,10 +19,9 @@
 FONT_SUFFIX=${FONT_SUFFIX:-}
 
 # @ECLASS-VARIABLE: FONT_S
-# @DEFAULT_UNSET
 # @REQUIRED
 # @DESCRIPTION:
-# Working directory containing the fonts.
+# Space delimited list of directories containing the fonts.
 FONT_S=${FONT_S:-${S}}
 
 # @ECLASS-VARIABLE: FONT_PN
@@ -61,17 +60,19 @@
 # @DESCRIPTION:
 # Generate Xorg font files (mkfontscale/mkfontdir).
 font_xfont_config() {
+       local dir_name
        if has X ${IUSE//+} && use X ; then
-               ebegin "Creating fonts.scale & fonts.dir"
-               rm -f "${ED}${FONTDIR}"/fonts.{dir,scale}
-               mkfontscale "${ED}${FONTDIR}"
+               dir_name="${1:-${FONT_PN}}"
+               ebegin "Creating fonts.scale & fonts.dir in ${dir_name##*/}"
+               rm -f 
"${ED}${FONTDIR}/${1//${S}/}"/{fonts.{dir,scale},encodings.dir}
+               mkfontscale "${ED}${FONTDIR}/${1//${S}/}"
                mkfontdir \
                        -e ${EPREFIX}/usr/share/fonts/encodings \
                        -e ${EPREFIX}/usr/share/fonts/encodings/large \
-                       "${ED}${FONTDIR}"
+                       "${ED}${FONTDIR}/${1//${S}/}"
                eend $?
-               if [[ -e ${FONT_S}/fonts.alias ]] ; then
-                       doins "${FONT_S}"/fonts.alias
+               if [[ -e fonts.alias ]] ; then
+                       doins fonts.alias
                fi
        fi
 }
@@ -162,23 +163,33 @@
 # @DESCRIPTION:
 # The font src_install function.
 font_src_install() {
-       local suffix commondoc
-
-       pushd "${FONT_S}" > /dev/null
-
-       insinto "${FONTDIR}"
+       local dir suffix commondoc
 
-       for suffix in ${FONT_SUFFIX}; do
-               doins *.${suffix}
-       done
-
-       rm -f fonts.{dir,scale} encodings.dir
+       set -- ${FONT_S:-${S}}
+       if [[ $# -gt 1 ]]; then
+               # if we have multiple FONT_S elements then we want to recreate 
the dir
+               # structure
+               for dir in ${FONT_S}; do
+                       pushd "${dir}" > /dev/null
+                       insinto "${FONTDIR}/${dir//${S}/}"
+                       for suffix in ${FONT_SUFFIX}; do
+                               doins *.${suffix}
+                       done
+                       font_xfont_config "${dir}"
+                       popd > /dev/null
+               done
+       else
+               pushd "${FONT_S}" > /dev/null
+               insinto "${FONTDIR}"
+               for suffix in ${FONT_SUFFIX}; do
+                       doins *.${suffix}
+               done
+               font_xfont_config
+               popd > /dev/null
+       fi
 
-       font_xfont_config
        font_fontconfig
 
-       popd > /dev/null
-
        [[ -n ${DOCS} ]] && { dodoc ${DOCS} || die "docs installation failed" ; 
}
 
        # install common docs




Reply via email to