| 1 |
vapier |
1.5 |
# Copyright 1999-2004 Gentoo Foundation
|
| 2 |
foser |
1.1 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
usata |
1.6 |
# $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.5 2004/06/25 00:39:48 vapier Exp $
|
| 4 |
foser |
1.1 |
|
| 5 |
|
|
# Author: foser <foser@gentoo.org>
|
| 6 |
|
|
|
| 7 |
|
|
# Font Eclass
|
| 8 |
|
|
#
|
| 9 |
|
|
# Eclass to make font installation more uniform
|
| 10 |
|
|
|
| 11 |
|
|
ECLASS="font"
|
| 12 |
|
|
INHERITED="$INHERITED $ECLASS"
|
| 13 |
|
|
|
| 14 |
|
|
#
|
| 15 |
|
|
# Variable declarations
|
| 16 |
|
|
#
|
| 17 |
|
|
|
| 18 |
|
|
FONT_SUFFIX="" # Space delimited list of font suffixes to install
|
| 19 |
|
|
|
| 20 |
foser |
1.2 |
FONT_S="${S}" # Dir containing the fonts
|
| 21 |
|
|
|
| 22 |
foser |
1.1 |
DOCS="" # Docs to install
|
| 23 |
|
|
|
| 24 |
|
|
IUSE="${IUSE} X"
|
| 25 |
|
|
|
| 26 |
|
|
DEPEND="${DEPEND} \
|
| 27 |
|
|
X? ( virtual/x11 ) \
|
| 28 |
|
|
media-libs/fontconfig"
|
| 29 |
|
|
|
| 30 |
foser |
1.2 |
#
|
| 31 |
|
|
# Public functions
|
| 32 |
foser |
1.1 |
#
|
| 33 |
|
|
|
| 34 |
foser |
1.2 |
font_xfont_config() {
|
| 35 |
foser |
1.1 |
|
| 36 |
|
|
# create Xfont files
|
| 37 |
mr_bones_ |
1.4 |
if use X ;
|
| 38 |
foser |
1.1 |
then
|
| 39 |
|
|
einfo "Creating fonts.scale & fonts.dir..."
|
| 40 |
|
|
mkfontscale ${D}/usr/share/fonts/${PN}
|
| 41 |
|
|
mkfontdir \
|
| 42 |
|
|
-e /usr/share/fonts/encodings \
|
| 43 |
|
|
-e /usr/share/fonts/encodings/large \
|
| 44 |
foser |
1.2 |
-e /usr/X11R6/lib/X11/fonts/encodings \
|
| 45 |
|
|
${D}/usr/share/fonts/${PN}
|
| 46 |
usata |
1.3 |
if [ -e ${FONT_S}/fonts.alias ] ;
|
| 47 |
|
|
then
|
| 48 |
|
|
doins ${FONT_S}/fonts.alias
|
| 49 |
|
|
fi
|
| 50 |
foser |
1.1 |
fi
|
| 51 |
|
|
|
| 52 |
foser |
1.2 |
}
|
| 53 |
|
|
|
| 54 |
|
|
font_xft_config() {
|
| 55 |
|
|
|
| 56 |
foser |
1.1 |
# create fontconfig cache
|
| 57 |
|
|
einfo "Creating fontconfig cache..."
|
| 58 |
|
|
HOME="/root" /usr/bin/fc-cache -f ${D}/usr/share/fonts/${PN}
|
| 59 |
|
|
|
| 60 |
foser |
1.2 |
}
|
| 61 |
|
|
|
| 62 |
|
|
#
|
| 63 |
|
|
# Public inheritable functions
|
| 64 |
|
|
#
|
| 65 |
|
|
|
| 66 |
|
|
font_src_install() {
|
| 67 |
|
|
|
| 68 |
mr_bones_ |
1.4 |
local suffix
|
| 69 |
foser |
1.2 |
|
| 70 |
|
|
cd ${FONT_S}
|
| 71 |
|
|
|
| 72 |
|
|
insinto /usr/share/fonts/${PN}
|
| 73 |
|
|
|
| 74 |
|
|
for suffix in ${FONT_SUFFIX}; do
|
| 75 |
|
|
doins *.${suffix}
|
| 76 |
|
|
done
|
| 77 |
|
|
|
| 78 |
|
|
rm -f fonts.{dir,scale} encodings.dir
|
| 79 |
|
|
|
| 80 |
|
|
font_xfont_config
|
| 81 |
|
|
font_xft_config
|
| 82 |
|
|
|
| 83 |
|
|
cd ${S}
|
| 84 |
foser |
1.1 |
# try to install some common docs
|
| 85 |
|
|
DOCS="${DOCS} COPYRIGHT README NEWS"
|
| 86 |
usata |
1.6 |
for f in ${DOCS}; do
|
| 87 |
|
|
[[ -e ${f} ]] && dodoc ${f}
|
| 88 |
|
|
done
|
| 89 |
foser |
1.1 |
}
|
| 90 |
|
|
|
| 91 |
|
|
EXPORT_FUNCTIONS src_install
|