/[gentoo-x86]/eclass/font.eclass
Gentoo

Diff of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.57 Revision 1.58
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2015 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.57 2013/07/25 13:13:18 pva Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.58 2015/02/21 07:20:22 yngwin Exp $
4 4
5# @ECLASS: font.eclass 5# @ECLASS: font.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# fonts@gentoo.org 7# fonts@gentoo.org
8# @BLURB: Eclass to make font installation uniform 8# @BLURB: Eclass to make font installation uniform
17# @DESCRIPTION: 17# @DESCRIPTION:
18# Space delimited list of font suffixes to install. 18# Space delimited list of font suffixes to install.
19FONT_SUFFIX=${FONT_SUFFIX:-} 19FONT_SUFFIX=${FONT_SUFFIX:-}
20 20
21# @ECLASS-VARIABLE: FONT_S 21# @ECLASS-VARIABLE: FONT_S
22# @DEFAULT_UNSET
23# @REQUIRED 22# @REQUIRED
24# @DESCRIPTION: 23# @DESCRIPTION:
25# Working directory containing the fonts. 24# Space delimited list of directories containing the fonts.
26FONT_S=${FONT_S:-${S}} 25FONT_S=${FONT_S:-${S}}
27 26
28# @ECLASS-VARIABLE: FONT_PN 27# @ECLASS-VARIABLE: FONT_PN
29# @DESCRIPTION: 28# @DESCRIPTION:
30# Font name (ie. last part of FONTDIR). 29# Font name (ie. last part of FONTDIR).
59 58
60# @FUNCTION: font_xfont_config 59# @FUNCTION: font_xfont_config
61# @DESCRIPTION: 60# @DESCRIPTION:
62# Generate Xorg font files (mkfontscale/mkfontdir). 61# Generate Xorg font files (mkfontscale/mkfontdir).
63font_xfont_config() { 62font_xfont_config() {
63 local dir_name
64 if has X ${IUSE//+} && use X ; then 64 if has X ${IUSE//+} && use X ; then
65 dir_name="${1:-${FONT_PN}}"
65 ebegin "Creating fonts.scale & fonts.dir" 66 ebegin "Creating fonts.scale & fonts.dir in ${dir_name##*/}"
66 rm -f "${ED}${FONTDIR}"/fonts.{dir,scale} 67 rm -f "${ED}${FONTDIR}/${1//${S}/}"/{fonts.{dir,scale},encodings.dir}
67 mkfontscale "${ED}${FONTDIR}" 68 mkfontscale "${ED}${FONTDIR}/${1//${S}/}"
68 mkfontdir \ 69 mkfontdir \
69 -e ${EPREFIX}/usr/share/fonts/encodings \ 70 -e ${EPREFIX}/usr/share/fonts/encodings \
70 -e ${EPREFIX}/usr/share/fonts/encodings/large \ 71 -e ${EPREFIX}/usr/share/fonts/encodings/large \
71 "${ED}${FONTDIR}" 72 "${ED}${FONTDIR}/${1//${S}/}"
72 eend $? 73 eend $?
73 if [[ -e ${FONT_S}/fonts.alias ]] ; then 74 if [[ -e fonts.alias ]] ; then
74 doins "${FONT_S}"/fonts.alias 75 doins fonts.alias
75 fi 76 fi
76 fi 77 fi
77} 78}
78 79
79# @FUNCTION: font_fontconfig 80# @FUNCTION: font_fontconfig
160 161
161# @FUNCTION: font_src_install 162# @FUNCTION: font_src_install
162# @DESCRIPTION: 163# @DESCRIPTION:
163# The font src_install function. 164# The font src_install function.
164font_src_install() { 165font_src_install() {
165 local suffix commondoc 166 local dir suffix commondoc
166 167
168 set -- ${FONT_S:-${S}}
169 if [[ $# -gt 1 ]]; then
170 # if we have multiple FONT_S elements then we want to recreate the dir
171 # structure
172 for dir in ${FONT_S}; do
173 pushd "${dir}" > /dev/null
174 insinto "${FONTDIR}/${dir//${S}/}"
175 for suffix in ${FONT_SUFFIX}; do
176 doins *.${suffix}
177 done
178 font_xfont_config "${dir}"
179 popd > /dev/null
180 done
181 else
167 pushd "${FONT_S}" > /dev/null 182 pushd "${FONT_S}" > /dev/null
168
169 insinto "${FONTDIR}" 183 insinto "${FONTDIR}"
170
171 for suffix in ${FONT_SUFFIX}; do 184 for suffix in ${FONT_SUFFIX}; do
172 doins *.${suffix} 185 doins *.${suffix}
173 done 186 done
174
175 rm -f fonts.{dir,scale} encodings.dir
176
177 font_xfont_config 187 font_xfont_config
188 popd > /dev/null
189 fi
190
178 font_fontconfig 191 font_fontconfig
179
180 popd > /dev/null
181 192
182 [[ -n ${DOCS} ]] && { dodoc ${DOCS} || die "docs installation failed" ; } 193 [[ -n ${DOCS} ]] && { dodoc ${DOCS} || die "docs installation failed" ; }
183 194
184 # install common docs 195 # install common docs
185 for commondoc in COPYRIGHT README{,.txt} NEWS AUTHORS BUGS ChangeLog FONTLOG.txt; do 196 for commondoc in COPYRIGHT README{,.txt} NEWS AUTHORS BUGS ChangeLog FONTLOG.txt; do

Legend:
Removed from v.1.57  
changed lines
  Added in v.1.58

  ViewVC Help
Powered by ViewVC 1.1.20