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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Mon May 31 14:59:26 2004 UTC (10 years, 4 months ago) by foser
Branch: MAIN
Changes since 1.1: +37 -16 lines
some fixes

1 foser 1.1 # Copyright 1999-2004 Gentoo Technologies, Inc.
2     # Distributed under the terms of the GNU General Public License v2
3 foser 1.2 # $Header: /home/cvsroot/gentoo-x86/eclass/font.eclass,v 1.1 2004/05/31 14:21:06 foser 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     ECLASS="font"
12     INHERITED="$INHERITED $ECLASS"
13    
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     IUSE="${IUSE} X"
25    
26     DEPEND="${DEPEND} \
27     X? ( virtual/x11 ) \
28     media-libs/fontconfig"
29    
30 foser 1.2 #
31     # Public functions
32 foser 1.1 #
33    
34 foser 1.2 font_xfont_config() {
35 foser 1.1
36     # create Xfont files
37     if [ -n "`use X`" ] ;
38     then
39     einfo "Creating fonts.scale & fonts.dir..."
40     mkfontscale ${D}/usr/share/fonts/${PN}
41     mkfontdir \
42     -e /usr/share/fonts/encodings \
43     -e /usr/share/fonts/encodings/large \
44 foser 1.2 -e /usr/X11R6/lib/X11/fonts/encodings \
45     ${D}/usr/share/fonts/${PN}
46     doins ${FONT_S}/fonts.alias
47 foser 1.1 fi
48    
49 foser 1.2 }
50    
51     font_xft_config() {
52    
53 foser 1.1 # create fontconfig cache
54     einfo "Creating fontconfig cache..."
55     HOME="/root" /usr/bin/fc-cache -f ${D}/usr/share/fonts/${PN}
56    
57 foser 1.2 }
58    
59     #
60     # Public inheritable functions
61     #
62    
63     font_src_install() {
64    
65     local suffix doc
66    
67     cd ${FONT_S}
68    
69     insinto /usr/share/fonts/${PN}
70    
71     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     cd ${S}
81 foser 1.1 # try to install some common docs
82     DOCS="${DOCS} COPYRIGHT README NEWS"
83     for doc in ${DOCS}; do
84     dodoc ${doc}
85     done
86    
87     }
88    
89     EXPORT_FUNCTIONS src_install

  ViewVC Help
Powered by ViewVC 1.1.20