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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (hide annotations) (download)
Mon Jul 11 15:08:06 2005 UTC (9 years, 6 months ago) by swegener
Branch: MAIN
Changes since 1.14: +5 -6 lines
QA: Apply whitespace checks from repoman to eclasses.

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 swegener 1.15 # $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.14 2005/07/06 20:23:20 agriffis 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
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 swegener 1.15 IUSE="X"
25 foser 1.1
26 swegener 1.15 DEPEND="X? ( virtual/x11 )
27 foser 1.11 media-libs/fontconfig"
28 foser 1.1
29 swegener 1.15 #
30 foser 1.2 # Public functions
31 foser 1.1 #
32    
33 foser 1.2 font_xfont_config() {
34 foser 1.1
35     # create Xfont files
36 foser 1.11 if use X ; then
37 vapier 1.10 einfo "Creating fonts.scale & fonts.dir ..."
38 usata 1.8 mkfontscale "${D}/usr/share/fonts/${PN}"
39 foser 1.1 mkfontdir \
40     -e /usr/share/fonts/encodings \
41     -e /usr/share/fonts/encodings/large \
42 kugelfang 1.7 -e /usr/X11R6/$(get_libdir)/X11/fonts/encodings \
43 usata 1.8 "${D}/usr/share/fonts/${PN}"
44 foser 1.11 if [ -e "${FONT_S}/fonts.alias" ] ; then
45 usata 1.8 doins "${FONT_S}/fonts.alias"
46 usata 1.3 fi
47 foser 1.1 fi
48    
49 foser 1.2 }
50    
51     font_xft_config() {
52    
53 foser 1.1 # create fontconfig cache
54 vapier 1.10 einfo "Creating fontconfig cache ..."
55 usata 1.9 # Mac OS X has fc-cache at /usr/X11R6/bin
56     HOME="/root" fc-cache -f "${D}/usr/share/fonts/${PN}"
57 foser 1.1
58 foser 1.2 }
59    
60     #
61     # Public inheritable functions
62     #
63    
64     font_src_install() {
65    
66 mr_bones_ 1.4 local suffix
67 foser 1.2
68 usata 1.8 cd "${FONT_S}"
69 foser 1.2
70 usata 1.8 insinto "/usr/share/fonts/${PN}"
71 swegener 1.15
72 foser 1.2 for suffix in ${FONT_SUFFIX}; do
73     doins *.${suffix}
74     done
75    
76     rm -f fonts.{dir,scale} encodings.dir
77    
78     font_xfont_config
79     font_xft_config
80    
81 usata 1.8 cd "${S}"
82 foser 1.1 # try to install some common docs
83     DOCS="${DOCS} COPYRIGHT README NEWS"
84 foser 1.11 dodoc ${DOCS}
85    
86 foser 1.1 }
87    
88 foser 1.12 font_pkg_setup() {
89    
90     # make sure we get no colissions
91     # setup is not the nicest place, but preinst doesn't cut it
92     rm "/usr/share/fonts/${PN}/fonts.cache-1"
93    
94     }
95    
96     EXPORT_FUNCTIONS src_install pkg_setup

  ViewVC Help
Powered by ViewVC 1.1.20