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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.18 - (show annotations) (download)
Thu Jan 12 04:42:13 2006 UTC (8 years, 11 months ago) by robbat2
Branch: MAIN
Changes since 1.17: +11 -9 lines
Provide FONT_PN to override font.eclass using /usr/share/fonts/PN always - this is for migration of old fonts.

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.17 2005/12/13 05:08:37 spyderous 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 FONT_PN="${PN}" # Last part of $FONTDIR
23
24 FONTDIR="/usr/share/fonts/${FONT_PN}" # this is where the fonts are installed
25
26 DOCS="" # Docs to install
27
28 IUSE="X"
29
30 DEPEND="X? ( || ( x11-apps/mkfontdir virtual/x11 ) )
31 media-libs/fontconfig"
32
33 #
34 # Public functions
35 #
36
37 font_xfont_config() {
38
39 # create Xfont files
40 if use X ; then
41 einfo "Creating fonts.scale & fonts.dir ..."
42 mkfontscale "${D}${FONTDIR}"
43 mkfontdir \
44 -e /usr/share/fonts/encodings \
45 -e /usr/share/fonts/encodings/large \
46 "${D}${FONTDIR}"
47 if [ -e "${FONT_S}/fonts.alias" ] ; then
48 doins "${FONT_S}/fonts.alias"
49 fi
50 fi
51
52 }
53
54 font_xft_config() {
55
56 # create fontconfig cache
57 einfo "Creating fontconfig cache ..."
58 # Mac OS X has fc-cache at /usr/X11R6/bin
59 HOME="/root" fc-cache -f "${D}${FONTDIR}"
60
61 }
62
63 #
64 # Public inheritable functions
65 #
66
67 font_src_install() {
68
69 local suffix
70
71 cd "${FONT_S}"
72
73 insinto "${FONTDIR}"
74
75 for suffix in ${FONT_SUFFIX}; do
76 doins *.${suffix}
77 done
78
79 rm -f fonts.{dir,scale} encodings.dir
80
81 font_xfont_config
82 font_xft_config
83
84 cd "${S}"
85 # try to install some common docs
86 DOCS="${DOCS} COPYRIGHT README NEWS"
87 dodoc ${DOCS}
88
89 }
90
91 font_pkg_setup() {
92 # make sure we get no colissions
93 # setup is not the nicest place, but preinst doesn't cut it
94 rm -f "${FONTDIR}/fonts.cache-1"
95 }
96
97 EXPORT_FUNCTIONS src_install pkg_setup

  ViewVC Help
Powered by ViewVC 1.1.20