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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (hide annotations) (download)
Wed Jul 6 20:20:03 2005 UTC (9 years ago) by agriffis
Branch: MAIN
Changes since 1.12: +1 -2 lines
Remove ECLASS= and INHERITED= which haven't been necessary for a long time now

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

  ViewVC Help
Powered by ViewVC 1.1.20