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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Tue Oct 19 19:51:12 2004 UTC (10 years, 1 month ago) by vapier
Branch: MAIN
Changes since 1.9: +3 -3 lines
'...' -> ' ...'

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

  ViewVC Help
Powered by ViewVC 1.1.20