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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (hide annotations) (download)
Sun Oct 3 13:00:32 2004 UTC (10 years, 2 months ago) by usata
Branch: MAIN
Changes since 1.7: +10 -10 lines
Added a patch to fix an error with files or directories containing spaces in their names. Thanks to gna <gnagent2@yahoo.com.au>; bug #66206.

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.8 # $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.7 2004/09/15 23:10:21 kugelfang 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     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     einfo "Creating fontconfig cache..."
60 usata 1.8 HOME="/root" /usr/bin/fc-cache -f "${D}/usr/share/fonts/${PN}"
61 foser 1.1
62 foser 1.2 }
63    
64     #
65     # Public inheritable functions
66     #
67    
68     font_src_install() {
69    
70 mr_bones_ 1.4 local suffix
71 foser 1.2
72 usata 1.8 cd "${FONT_S}"
73 foser 1.2
74 usata 1.8 insinto "/usr/share/fonts/${PN}"
75 foser 1.2
76     for suffix in ${FONT_SUFFIX}; do
77     doins *.${suffix}
78     done
79    
80     rm -f fonts.{dir,scale} encodings.dir
81    
82     font_xfont_config
83     font_xft_config
84    
85 usata 1.8 cd "${S}"
86 foser 1.1 # try to install some common docs
87     DOCS="${DOCS} COPYRIGHT README NEWS"
88 usata 1.6 for f in ${DOCS}; do
89 usata 1.8 [[ -e "${f}" ]] && dodoc "${f}"
90 usata 1.6 done
91 foser 1.1 }
92    
93     EXPORT_FUNCTIONS src_install

  ViewVC Help
Powered by ViewVC 1.1.20