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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (hide annotations) (download)
Sat May 28 18:38:17 2005 UTC (9 years, 4 months ago) by foser
Branch: MAIN
Changes since 1.10: +7 -10 lines
some revamping for fontconfig changes

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 foser 1.11 # $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.10 2004/10/19 19:51:12 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 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 foser 1.11 X? ( virtual/x11 ) \
30     media-libs/fontconfig"
31 foser 1.1
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 foser 1.11 if use X ; then
40 vapier 1.10 einfo "Creating fonts.scale & fonts.dir ..."
41 usata 1.8 mkfontscale "${D}/usr/share/fonts/${PN}"
42 foser 1.1 mkfontdir \
43     -e /usr/share/fonts/encodings \
44     -e /usr/share/fonts/encodings/large \
45 kugelfang 1.7 -e /usr/X11R6/$(get_libdir)/X11/fonts/encodings \
46 usata 1.8 "${D}/usr/share/fonts/${PN}"
47 foser 1.11 if [ -e "${FONT_S}/fonts.alias" ] ; then
48 usata 1.8 doins "${FONT_S}/fonts.alias"
49 usata 1.3 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 vapier 1.10 einfo "Creating fontconfig cache ..."
58 usata 1.9 # Mac OS X has fc-cache at /usr/X11R6/bin
59     HOME="/root" fc-cache -f "${D}/usr/share/fonts/${PN}"
60 foser 1.1
61 foser 1.2 }
62    
63     #
64     # Public inheritable functions
65     #
66    
67     font_src_install() {
68    
69 mr_bones_ 1.4 local suffix
70 foser 1.2
71 usata 1.8 cd "${FONT_S}"
72 foser 1.2
73 usata 1.8 insinto "/usr/share/fonts/${PN}"
74 foser 1.2
75     for suffix in ${FONT_SUFFIX}; do
76     doins *.${suffix}
77     done
78    
79     rm -f fonts.{dir,scale} encodings.dir
80    
81     font_xfont_config
82     font_xft_config
83    
84 usata 1.8 cd "${S}"
85 foser 1.1 # try to install some common docs
86     DOCS="${DOCS} COPYRIGHT README NEWS"
87 foser 1.11 dodoc ${DOCS}
88    
89 foser 1.1 }
90    
91     EXPORT_FUNCTIONS src_install

  ViewVC Help
Powered by ViewVC 1.1.20