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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (hide annotations) (download)
Tue Oct 19 19:51:12 2004 UTC (9 years, 8 months ago) by vapier
Branch: MAIN
Changes since 1.9: +3 -3 lines
'...' -> ' ...'

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 vapier 1.10 # $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.9 2004/10/06 14:00:39 usata 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 kugelfang 1.7 inherit eutils
12    
13 foser 1.1 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 foser 1.2 FONT_S="${S}" # Dir containing the fonts
23    
24 foser 1.1 DOCS="" # Docs to install
25    
26     IUSE="${IUSE} X"
27    
28     DEPEND="${DEPEND} \
29     X? ( virtual/x11 ) \
30     media-libs/fontconfig"
31    
32 foser 1.2 #
33     # Public functions
34 foser 1.1 #
35    
36 foser 1.2 font_xfont_config() {
37 foser 1.1
38     # create Xfont files
39 mr_bones_ 1.4 if use X ;
40 foser 1.1 then
41 vapier 1.10 einfo "Creating fonts.scale & fonts.dir ..."
42 usata 1.8 mkfontscale "${D}/usr/share/fonts/${PN}"
43 foser 1.1 mkfontdir \
44     -e /usr/share/fonts/encodings \
45     -e /usr/share/fonts/encodings/large \
46 kugelfang 1.7 -e /usr/X11R6/$(get_libdir)/X11/fonts/encodings \
47 usata 1.8 "${D}/usr/share/fonts/${PN}"
48     if [ -e "${FONT_S}/fonts.alias" ] ;
49 usata 1.3 then
50 usata 1.8 doins "${FONT_S}/fonts.alias"
51 usata 1.3 fi
52 foser 1.1 fi
53    
54 foser 1.2 }
55    
56     font_xft_config() {
57    
58 foser 1.1 # create fontconfig cache
59 vapier 1.10 einfo "Creating fontconfig cache ..."
60 usata 1.9 # Mac OS X has fc-cache at /usr/X11R6/bin
61     HOME="/root" fc-cache -f "${D}/usr/share/fonts/${PN}"
62 foser 1.1
63 foser 1.2 }
64    
65     #
66     # Public inheritable functions
67     #
68    
69     font_src_install() {
70    
71 mr_bones_ 1.4 local suffix
72 foser 1.2
73 usata 1.8 cd "${FONT_S}"
74 foser 1.2
75 usata 1.8 insinto "/usr/share/fonts/${PN}"
76 foser 1.2
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 usata 1.8 cd "${S}"
87 foser 1.1 # try to install some common docs
88     DOCS="${DOCS} COPYRIGHT README NEWS"
89 usata 1.6 for f in ${DOCS}; do
90 usata 1.8 [[ -e "${f}" ]] && dodoc "${f}"
91 usata 1.6 done
92 foser 1.1 }
93    
94     EXPORT_FUNCTIONS src_install

  ViewVC Help
Powered by ViewVC 1.1.20