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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.17 - (hide annotations) (download)
Tue Dec 13 05:08:37 2005 UTC (9 years ago) by spyderous
Branch: MAIN
Changes since 1.16: +2 -2 lines
Add modular X dependencies.

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

  ViewVC Help
Powered by ViewVC 1.1.20