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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20