summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorBen de Groot <yngwin@gentoo.org>2015-02-21 07:20:22 +0000
committerBen de Groot <yngwin@gentoo.org>2015-02-21 07:20:22 +0000
commit51c609370bf2ca5e855e1e75502f1c31c6f97926 (patch)
tree35672573decfb94b364188c43d15a5b31dc65fb1 /eclass
parentRecent comments on bug #125902 show that I was overzealous, hearse is not to ... (diff)
downloadgentoo-2-51c609370bf2ca5e855e1e75502f1c31c6f97926.tar.gz
gentoo-2-51c609370bf2ca5e855e1e75502f1c31c6f97926.tar.bz2
gentoo-2-51c609370bf2ca5e855e1e75502f1c31c6f97926.zip
Apply patch from Ryan Hill to font.eclass to support multiple FONT_S directories (bug #338634)
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog6
-rw-r--r--eclass/font.eclass59
2 files changed, 40 insertions, 25 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index da1ec79cd4b8..baecc707e283 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -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 <yngwin@gentoo.org> font.eclass:
+ Apply patch from Ryan Hill to font.eclass to support multiple FONT_S
+ directories (bug #338634)
20 Feb 2015; Michał Górny <mgorny@gentoo.org> distutils-r1.eclass,
python-r1.eclass, python-single-r1.eclass, python-utils-r1.eclass:
diff --git a/eclass/font.eclass b/eclass/font.eclass
index 1dfa75cffb81..2854451b9998 100644
--- a/eclass/font.eclass
+++ b/eclass/font.eclass
@@ -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 @@ EXPORT_FUNCTIONS pkg_setup src_install pkg_postinst pkg_postrm
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 @@ RDEPEND=""
# @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 @@ font_pkg_setup() {
# @DESCRIPTION:
# The font src_install function.
font_src_install() {
- local suffix commondoc
-
- pushd "${FONT_S}" > /dev/null
-
- insinto "${FONTDIR}"
-
- for suffix in ${FONT_SUFFIX}; do
- doins *.${suffix}
- done
-
- rm -f fonts.{dir,scale} encodings.dir
+ local dir suffix commondoc
+
+ 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