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

Contents of /eclass/font.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.18 - (hide annotations) (download)
Thu Jan 12 04:42:13 2006 UTC (8 years, 6 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 vapier 1.5 # Copyright 1999-2004 Gentoo Foundation
2 foser 1.1 # Distributed under the terms of the GNU General Public License v2
3 robbat2 1.18 # $Header: /var/cvsroot/gentoo-x86/eclass/font.eclass,v 1.17 2005/12/13 05:08:37 spyderous 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 robbat2 1.18 FONT_PN="${PN}" # Last part of $FONTDIR
23    
24     FONTDIR="/usr/share/fonts/${FONT_PN}" # this is where the fonts are installed
25    
26 foser 1.1 DOCS="" # Docs to install
27    
28 swegener 1.15 IUSE="X"
29 foser 1.1
30 spyderous 1.17 DEPEND="X? ( || ( x11-apps/mkfontdir virtual/x11 ) )
31 robbat2 1.18 media-libs/fontconfig"
32 foser 1.1
33 swegener 1.15 #
34 foser 1.2 # Public functions
35 foser 1.1 #
36    
37 foser 1.2 font_xfont_config() {
38 foser 1.1
39     # create Xfont files
40 foser 1.11 if use X ; then
41 vapier 1.10 einfo "Creating fonts.scale & fonts.dir ..."
42 robbat2 1.18 mkfontscale "${D}${FONTDIR}"
43 foser 1.1 mkfontdir \
44     -e /usr/share/fonts/encodings \
45     -e /usr/share/fonts/encodings/large \
46 robbat2 1.18 "${D}${FONTDIR}"
47 foser 1.11 if [ -e "${FONT_S}/fonts.alias" ] ; then
48 usata 1.8 doins "${FONT_S}/fonts.alias"
49 usata 1.3 fi
50 foser 1.1 fi
51    
52 foser 1.2 }
53    
54     font_xft_config() {
55    
56 foser 1.1 # create fontconfig cache
57 vapier 1.10 einfo "Creating fontconfig cache ..."
58 usata 1.9 # Mac OS X has fc-cache at /usr/X11R6/bin
59 robbat2 1.18 HOME="/root" fc-cache -f "${D}${FONTDIR}"
60 foser 1.1
61 foser 1.2 }
62    
63     #
64     # Public inheritable functions
65     #
66    
67     font_src_install() {
68    
69 mr_bones_ 1.4 local suffix
70 foser 1.2
71 usata 1.8 cd "${FONT_S}"
72 foser 1.2
73 robbat2 1.18 insinto "${FONTDIR}"
74 swegener 1.15
75 foser 1.2 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 usata 1.8 cd "${S}"
85 foser 1.1 # try to install some common docs
86     DOCS="${DOCS} COPYRIGHT README NEWS"
87 foser 1.11 dodoc ${DOCS}
88    
89 foser 1.1 }
90    
91 foser 1.12 font_pkg_setup() {
92     # make sure we get no colissions
93     # setup is not the nicest place, but preinst doesn't cut it
94 robbat2 1.18 rm -f "${FONTDIR}/fonts.cache-1"
95 foser 1.12 }
96    
97     EXPORT_FUNCTIONS src_install pkg_setup

  ViewVC Help
Powered by ViewVC 1.1.20