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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.14 - (show annotations) (download)
Wed Jul 6 20:23:20 2005 UTC (9 years 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 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.13 2005/07/06 20:20:03 agriffis Exp $
4
5 # Author: foser <foser@gentoo.org>
6
7 # Font Eclass
8 #
9 # Eclass to make font installation more uniform
10
11 inherit eutils
12
13
14 #
15 # Variable declarations
16 #
17
18 FONT_SUFFIX="" # Space delimited list of font suffixes to install
19
20 FONT_S="${S}" # Dir containing the fonts
21
22 DOCS="" # Docs to install
23
24 IUSE="${IUSE} X"
25
26 DEPEND="${DEPEND} \
27 X? ( virtual/x11 ) \
28 media-libs/fontconfig"
29
30 #
31 # Public functions
32 #
33
34 font_xfont_config() {
35
36 # create Xfont files
37 if use X ; then
38 einfo "Creating fonts.scale & fonts.dir ..."
39 mkfontscale "${D}/usr/share/fonts/${PN}"
40 mkfontdir \
41 -e /usr/share/fonts/encodings \
42 -e /usr/share/fonts/encodings/large \
43 -e /usr/X11R6/$(get_libdir)/X11/fonts/encodings \
44 "${D}/usr/share/fonts/${PN}"
45 if [ -e "${FONT_S}/fonts.alias" ] ; then
46 doins "${FONT_S}/fonts.alias"
47 fi
48 fi
49
50 }
51
52 font_xft_config() {
53
54 # create fontconfig cache
55 einfo "Creating fontconfig cache ..."
56 # Mac OS X has fc-cache at /usr/X11R6/bin
57 HOME="/root" fc-cache -f "${D}/usr/share/fonts/${PN}"
58
59 }
60
61 #
62 # Public inheritable functions
63 #
64
65 font_src_install() {
66
67 local suffix
68
69 cd "${FONT_S}"
70
71 insinto "/usr/share/fonts/${PN}"
72
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 cd "${S}"
83 # try to install some common docs
84 DOCS="${DOCS} COPYRIGHT README NEWS"
85 dodoc ${DOCS}
86
87 }
88
89 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