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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (show annotations) (download)
Wed Jul 6 20:20:03 2005 UTC (9 years, 5 months 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 # 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.12 2005/05/28 19:01:24 foser 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 INHERITED="$INHERITED $ECLASS"
14
15 #
16 # Variable declarations
17 #
18
19 FONT_SUFFIX="" # Space delimited list of font suffixes to install
20
21 FONT_S="${S}" # Dir containing the fonts
22
23 DOCS="" # Docs to install
24
25 IUSE="${IUSE} X"
26
27 DEPEND="${DEPEND} \
28 X? ( virtual/x11 ) \
29 media-libs/fontconfig"
30
31 #
32 # Public functions
33 #
34
35 font_xfont_config() {
36
37 # create Xfont files
38 if use X ; 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 -e /usr/X11R6/$(get_libdir)/X11/fonts/encodings \
45 "${D}/usr/share/fonts/${PN}"
46 if [ -e "${FONT_S}/fonts.alias" ] ; then
47 doins "${FONT_S}/fonts.alias"
48 fi
49 fi
50
51 }
52
53 font_xft_config() {
54
55 # create fontconfig cache
56 einfo "Creating fontconfig cache ..."
57 # Mac OS X has fc-cache at /usr/X11R6/bin
58 HOME="/root" fc-cache -f "${D}/usr/share/fonts/${PN}"
59
60 }
61
62 #
63 # Public inheritable functions
64 #
65
66 font_src_install() {
67
68 local suffix
69
70 cd "${FONT_S}"
71
72 insinto "/usr/share/fonts/${PN}"
73
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 cd "${S}"
84 # try to install some common docs
85 DOCS="${DOCS} COPYRIGHT README NEWS"
86 dodoc ${DOCS}
87
88 }
89
90 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