/[gentoo-x86]/eclass/x-modular.eclass
Gentoo

Diff of /eclass/x-modular.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.99 Revision 1.118
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.99 2008/05/27 18:42:33 dberkholz Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.118 2009/12/09 10:21:49 vapier Exp $
4# 4#
5# @ECLASS: x-modular.eclass 5# @ECLASS: x-modular.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Donnie Berkholz <dberkholz@gentoo.org>, x11@gentoo.org 7# Donnie Berkholz <dberkholz@gentoo.org>, x11@gentoo.org
8# @BLURB: Reduces code duplication in the modularized X11 ebuilds. 8# @BLURB: Reduces code duplication in the modularized X11 ebuilds.
15# All you need to do in a basic ebuild is inherit this eclass and set 15# All you need to do in a basic ebuild is inherit this eclass and set
16# DESCRIPTION, KEYWORDS and RDEPEND/DEPEND. If your package is hosted 16# DESCRIPTION, KEYWORDS and RDEPEND/DEPEND. If your package is hosted
17# with the other X packages, you don't need to set SRC_URI. Pretty much 17# with the other X packages, you don't need to set SRC_URI. Pretty much
18# everything else should be automatic. 18# everything else should be automatic.
19 19
20if [[ ${PV} = 9999* ]]; then
21 GIT_ECLASS="git"
22 SNAPSHOT="yes"
23 SRC_URI=""
24fi
25
26# If we're a font package, but not the font.alias one
27FONT_ECLASS=""
28if [[ "${PN/#font-}" != "${PN}" ]] \
29 && [[ "${CATEGORY}" = "media-fonts" ]] \
30 && [[ "${PN}" != "font-alias" ]] \
31 && [[ "${PN}" != "font-util" ]]; then
32 # Activate font code in the rest of the eclass
33 FONT="yes"
34
35 # Whether to inherit the font eclass
36 FONT_ECLASS="font"
37fi
38
39inherit eutils libtool multilib toolchain-funcs flag-o-matic autotools \
40 ${FONT_ECLASS} ${GIT_ECLASS}
41
42EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm"
43
44case "${EAPI:-0}" in
45 0|1)
46 ;;
47 2)
48 EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure"
49 ;;
50 *)
51 die "Unknown EAPI ${EAPI}"
52 ;;
53esac
54
55# exports must be ALWAYS after inherit
56EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
57
20# @ECLASS-VARIABLE: XDIR 58# @ECLASS-VARIABLE: XDIR
21# @DESCRIPTION: 59# @DESCRIPTION:
22# Directory prefix to use for everything. If you want to install to a 60# Directory prefix to use for everything. If you want to install to a
23# non-default prefix (e.g., /opt/xorg), change XDIR. This has not been 61# non-default prefix (e.g., /opt/xorg), change XDIR. This has not been
24# recently tested. You may need to uncomment the setting of datadir and 62# recently tested. You may need to uncomment the setting of datadir and
27XDIR="/usr" 65XDIR="/usr"
28 66
29IUSE="" 67IUSE=""
30HOMEPAGE="http://xorg.freedesktop.org/" 68HOMEPAGE="http://xorg.freedesktop.org/"
31 69
32if [[ -z ${SNAPSHOT} ]]; then
33# @ECLASS-VARIABLE: SNAPSHOT 70# @ECLASS-VARIABLE: SNAPSHOT
34# @DESCRIPTION: 71# @DESCRIPTION:
35# If set to 'yes' and configure.ac exists, eautoreconf will run. Set 72# If set to 'yes' and configure.ac exists, eautoreconf will run. Set
36# before inheriting this eclass. 73# before inheriting this eclass.
37 SNAPSHOT="no" 74: ${SNAPSHOT:=no}
38fi
39
40if [[ ${PV} = 9999* ]]; then
41 GIT_ECLASS="git"
42 SNAPSHOT="yes"
43 SRC_URI=""
44fi
45 75
46# Set up SRC_URI for individual modular releases 76# Set up SRC_URI for individual modular releases
47BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual" 77BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual"
48if [[ -z ${MODULE} ]]; then
49# @ECLASS-VARIABLE: MODULE 78# @ECLASS-VARIABLE: MODULE
50# @DESCRIPTION: 79# @DESCRIPTION:
51# The subdirectory to download source from. Possible settings are app, 80# The subdirectory to download source from. Possible settings are app,
52# doc, data, util, driver, font, lib, proto, xserver. Set above the 81# doc, data, util, driver, font, lib, proto, xserver. Set above the
53# inherit to override the default autoconfigured module. 82# inherit to override the default autoconfigured module.
54 MODULE="" 83if [[ -z ${MODULE} ]]; then
55 if [[ ${CATEGORY} = x11-apps ]] || [[ ${CATEGORY} = x11-wm ]]; then 84 case ${CATEGORY} in
56 MODULE="app" 85 app-doc) MODULE="doc" ;;
57 elif [[ ${CATEGORY} = app-doc ]]; then 86 media-fonts) MODULE="font" ;;
58 MODULE="doc" 87 x11-apps|x11-wm) MODULE="app" ;;
59 # x11-misc contains data and util, x11-themes contains data 88 x11-misc|x11-themes) MODULE="util" ;;
60 elif [[ ${CATEGORY} = x11-misc ]] || [[ ${CATEGORY} = x11-themes ]]; then 89 x11-drivers) MODULE="driver" ;;
61 if [[ ${PN} == xbitmaps || ${PN} == xcursor-themes || ${PN} == xkbdata ]]; then 90 x11-base) MODULE="xserver" ;;
62 MODULE="data" 91 x11-proto) MODULE="proto" ;;
63 else 92 x11-libs) MODULE="lib" ;;
64 MODULE="util" 93 esac
65 fi
66 elif [[ ${CATEGORY} = x11-drivers ]]; then
67 MODULE="driver"
68 elif [[ ${CATEGORY} = media-fonts ]]; then
69 MODULE="font"
70 elif [[ ${CATEGORY} = x11-libs ]]; then
71 MODULE="lib"
72 elif [[ ${CATEGORY} = x11-proto ]]; then
73 MODULE="proto"
74 elif [[ ${CATEGORY} = x11-base ]]; then
75 MODULE="xserver"
76 fi
77fi 94fi
78 95
79if [[ -n ${GIT_ECLASS} ]]; then 96if [[ -n ${GIT_ECLASS} ]]; then
80 EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}/${PN}" 97 EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}/${PN}"
81else 98else
83fi 100fi
84 101
85SLOT="0" 102SLOT="0"
86 103
87# Set the license for the package. This can be overridden by setting 104# Set the license for the package. This can be overridden by setting
88# LICENSE after the inherit. 105# LICENSE after the inherit. Nearly all FreeDesktop-hosted X packages
89LICENSE=${PN} 106# are under the MIT license. (This is what Red Hat does in their rpms)
107LICENSE="MIT"
90 108
91# Set up shared dependencies 109# Set up shared dependencies
92if [[ -n "${SNAPSHOT}" ]]; then 110if [[ -n "${SNAPSHOT}" ]]; then
93# FIXME: What's the minimal libtool version supporting arbitrary versioning? 111# FIXME: What's the minimal libtool version supporting arbitrary versioning?
94 DEPEND="${DEPEND} 112 DEPEND="${DEPEND}
96 >=sys-devel/m4-1.4" 114 >=sys-devel/m4-1.4"
97 WANT_AUTOCONF="latest" 115 WANT_AUTOCONF="latest"
98 WANT_AUTOMAKE="latest" 116 WANT_AUTOMAKE="latest"
99fi 117fi
100 118
101# If we're a font package, but not the font.alias one 119if [[ -n "${FONT}" ]]; then
102FONT_ECLASS=""
103if [[ "${PN/#font-}" != "${PN}" ]] \
104 && [[ "${CATEGORY}" = "media-fonts" ]] \
105 && [[ "${PN}" != "font-alias" ]] \
106 && [[ "${PN}" != "font-util" ]]; then
107 # Activate font code in the rest of the eclass
108 FONT="yes"
109
110 # Whether to inherit the font eclass
111 FONT_ECLASS="font"
112
113 RDEPEND="${RDEPEND} 120 RDEPEND="${RDEPEND}
114 media-fonts/encodings 121 media-fonts/encodings
115 x11-apps/mkfontscale 122 x11-apps/mkfontscale
116 x11-apps/mkfontdir" 123 x11-apps/mkfontdir"
117 PDEPEND="${PDEPEND} 124 PDEPEND="${PDEPEND}
118 media-fonts/font-alias" 125 media-fonts/font-alias"
119 126
120 # Starting with 7.0RC3, we can specify the font directory 127 # Starting with 7.0RC3, we can specify the font directory
121 # But oddly, we can't do the same for encodings or font-alias 128 # But oddly, we can't do the same for encodings or font-alias
122 129
123 # Wrap in `if` so ebuilds can set it too
124 if [[ -z ${FONT_DIR} ]]; then
125# @ECLASS-VARIABLE: FONT_DIR 130# @ECLASS-VARIABLE: FONT_DIR
126# @DESCRIPTION: 131# @DESCRIPTION:
127# If you're creating a font package and the suffix of PN is not equal to 132# If you're creating a font package and the suffix of PN is not equal to
128# the subdirectory of /usr/share/fonts/ it should install into, set 133# the subdirectory of /usr/share/fonts/ it should install into, set
129# FONT_DIR to that directory or directories. Set before inheriting this 134# FONT_DIR to that directory or directories. Set before inheriting this
130# eclass. 135# eclass.
131 FONT_DIR=${PN##*-} 136 : ${FONT_DIR:=${PN##*-}}
132
133 fi
134 137
135 # Fix case of font directories 138 # Fix case of font directories
136 FONT_DIR=${FONT_DIR/ttf/TTF} 139 FONT_DIR=${FONT_DIR/ttf/TTF}
137 FONT_DIR=${FONT_DIR/otf/OTF} 140 FONT_DIR=${FONT_DIR/otf/OTF}
138 FONT_DIR=${FONT_DIR/type1/Type1} 141 FONT_DIR=${FONT_DIR/type1/Type1}
139 FONT_DIR=${FONT_DIR/speedo/Speedo} 142 FONT_DIR=${FONT_DIR/speedo/Speedo}
140 143
141 # Set up configure option 144 # Set up configure options, wrapped so ebuilds can override if need be
145 if [[ -z ${FONT_OPTIONS} ]]; then
142 FONT_OPTIONS="--with-fontdir=\"/usr/share/fonts/${FONT_DIR}\"" 146 FONT_OPTIONS="--with-fontdir=\"/usr/share/fonts/${FONT_DIR}\""
147 fi
143 148
144 if [[ -n "${FONT}" ]]; then 149 if [[ -n "${FONT}" ]]; then
145 if [[ ${PN##*-} = misc ]] || [[ ${PN##*-} = 75dpi ]] || [[ ${PN##*-} = 100dpi ]] || [[ ${PN##*-} = cyrillic ]]; then 150 if [[ ${PN##*-} = misc ]] || [[ ${PN##*-} = 75dpi ]] || [[ ${PN##*-} = 100dpi ]] || [[ ${PN##*-} = cyrillic ]]; then
146 IUSE="${IUSE} nls" 151 IUSE="${IUSE} nls"
147 fi 152 fi
171DEPEND="${DEPEND} 176DEPEND="${DEPEND}
172 >=dev-util/pkgconfig-0.18" 177 >=dev-util/pkgconfig-0.18"
173 178
174if [[ "${PN/util-macros}" = "${PN}" ]]; then 179if [[ "${PN/util-macros}" = "${PN}" ]]; then
175 DEPEND="${DEPEND} 180 DEPEND="${DEPEND}
176 >=x11-misc/util-macros-0.99.2 181 >=x11-misc/util-macros-1.3.0
177 >=sys-devel/binutils-2.16.1-r3" 182 sys-devel/binutils"
178fi 183fi
179 184
180RDEPEND="${RDEPEND} 185RDEPEND="${RDEPEND}
181 !<=x11-base/xorg-x11-6.9" 186 !<=x11-base/xorg-x11-6.9"
182# Provides virtual/x11 for temporary use until packages are ported 187# Provides virtual/x11 for temporary use until packages are ported
183# x11-base/x11-env" 188# x11-base/x11-env"
184
185inherit eutils libtool multilib toolchain-funcs flag-o-matic autotools \
186 ${FONT_ECLASS} ${GIT_ECLASS}
187 189
188# @FUNCTION: x-modular_specs_check 190# @FUNCTION: x-modular_specs_check
189# @USAGE: 191# @USAGE:
190# @DESCRIPTION: 192# @DESCRIPTION:
191# Make any necessary changes related to gcc specs (generally hardened) 193# Make any necessary changes related to gcc specs (generally hardened)
202# @DESCRIPTION: 204# @DESCRIPTION:
203# Ensures the server supports DRI if building a driver with DRI support 205# Ensures the server supports DRI if building a driver with DRI support
204x-modular_dri_check() { 206x-modular_dri_check() {
205 # (#120057) Enabling DRI in drivers requires that the server was built with 207 # (#120057) Enabling DRI in drivers requires that the server was built with
206 # support for it 208 # support for it
209 # Starting with xorg-server 1.5.3, DRI support is always enabled unless
210 # USE=minimal is set (see bug #252084)
207 if [[ -n "${DRIVER}" ]]; then 211 if [[ -n "${DRIVER}" ]]; then
208 if has dri ${IUSE} && use dri; then 212 if has dri ${IUSE} && use dri; then
209 einfo "Checking for direct rendering capabilities ..." 213 einfo "Checking for direct rendering capabilities ..."
214 if has_version '>=x11-base/xorg-server-1.5.3'; then
215 if built_with_use x11-base/xorg-server minimal; then
216 die "You must build x11-base/xorg-server with USE=-minimal."
217 fi
218 else
210 if ! built_with_use x11-base/xorg-server dri; then 219 if ! built_with_use x11-base/xorg-server dri; then
211 die "You must build x11-base/xorg-server with USE=dri." 220 die "You must build x11-base/xorg-server with USE=dri."
221 fi
212 fi 222 fi
213 fi 223 fi
214 fi 224 fi
215} 225}
216 226
239 if [[ -n ${GIT_ECLASS} ]]; then 249 if [[ -n ${GIT_ECLASS} ]]; then
240 git_src_unpack 250 git_src_unpack
241 else 251 else
242 unpack ${A} 252 unpack ${A}
243 fi 253 fi
244 cd ${S} 254 cd "${S}"
245 255
246 if [[ -n ${FONT_OPTIONS} ]]; then 256 if [[ -n ${FONT_OPTIONS} ]]; then
247 einfo "Detected font directory: ${FONT_DIR}" 257 einfo "Detected font directory: ${FONT_DIR}"
248 fi 258 fi
249} 259}
299 # Joshua Baergen - October 23, 2005 309 # Joshua Baergen - October 23, 2005
300 # Fix shared lib issues on MIPS, FBSD, etc etc 310 # Fix shared lib issues on MIPS, FBSD, etc etc
301 elibtoolize 311 elibtoolize
302} 312}
303 313
314# @FUNCTION: x-modular_src_prepare
315# @USAGE:
316# @DESCRIPTION:
317# Prepare a package after unpacking, performing all X-related tasks.
318x-modular_src_prepare() {
319 [[ -n ${GIT_ECLASS} ]] && has src_prepare ${EXPORTED_FUNCTIONS} \
320 && git_src_prepare
321 x-modular_patch_source
322 x-modular_reconf_source
323}
324
304# @FUNCTION: x-modular_src_unpack 325# @FUNCTION: x-modular_src_unpack
305# @USAGE: 326# @USAGE:
306# @DESCRIPTION: 327# @DESCRIPTION:
307# Unpack a package, performing all X-related tasks. 328# Unpack a package, performing all X-related tasks.
308x-modular_src_unpack() { 329x-modular_src_unpack() {
309 x-modular_specs_check 330 x-modular_specs_check
310 x-modular_server_supports_drivers_check 331 x-modular_server_supports_drivers_check
311 x-modular_dri_check 332 x-modular_dri_check
312 x-modular_unpack_source 333 x-modular_unpack_source
313 x-modular_patch_source 334 has src_prepare ${EXPORTED_FUNCTIONS} || x-modular_src_prepare
314 x-modular_reconf_source
315} 335}
316 336
317# @FUNCTION: x-modular_font_configure 337# @FUNCTION: x-modular_font_configure
318# @USAGE: 338# @USAGE:
319# @DESCRIPTION: 339# @DESCRIPTION:
320# If a font package, perform any necessary configuration steps 340# If a font package, perform any necessary configuration steps
321x-modular_font_configure() { 341x-modular_font_configure() {
322 if [[ -n "${FONT}" ]]; then 342 if [[ -n "${FONT}" ]]; then
323 # Might be worth adding an option to configure your desired font 343 # Might be worth adding an option to configure your desired font
324 # and exclude all others. Also, should this USE be nls or minimal? 344 # and exclude all others. Also, should this USE be nls or minimal?
325 if ! use nls; then 345 if has nls ${IUSE//+} && ! use nls; then
326 FONT_OPTIONS="${FONT_OPTIONS} 346 FONT_OPTIONS="${FONT_OPTIONS}
327 --disable-iso8859-2 347 --disable-iso8859-2
328 --disable-iso8859-3 348 --disable-iso8859-3
329 --disable-iso8859-4 349 --disable-iso8859-4
330 --disable-iso8859-5 350 --disable-iso8859-5
366 x-modular_font_configure 386 x-modular_font_configure
367 x-modular_debug_setup 387 x-modular_debug_setup
368 388
369# @VARIABLE: CONFIGURE_OPTIONS 389# @VARIABLE: CONFIGURE_OPTIONS
370# @DESCRIPTION: 390# @DESCRIPTION:
371# Any options to pass to configure 391# Any extra options to pass to configure
372[[ -n ${CONFIGURE_OPTIONS} ]]
373 392
374 # If prefix isn't set here, .pc files cause problems 393 # If prefix isn't set here, .pc files cause problems
375 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then 394 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
376 econf --prefix=${XDIR} \ 395 econf --prefix=${XDIR} \
377 --datadir=${XDIR}/share \ 396 --datadir=${XDIR}/share \
387# Run make. 406# Run make.
388x-modular_src_make() { 407x-modular_src_make() {
389 emake || die "emake failed" 408 emake || die "emake failed"
390} 409}
391 410
392# @FUNCTION: x-modular_src_configure 411# @FUNCTION: x-modular_src_compile
393# @USAGE: 412# @USAGE:
394# @DESCRIPTION: 413# @DESCRIPTION:
395# Compile a package, performing all X-related tasks. 414# Compile a package, performing all X-related tasks.
396x-modular_src_compile() { 415x-modular_src_compile() {
397 x-modular_src_configure 416 has src_configure ${EXPORTED_FUNCTIONS} || x-modular_src_configure
398 x-modular_src_make 417 x-modular_src_make
399} 418}
400 419
401# @FUNCTION: x-modular_src_install 420# @FUNCTION: x-modular_src_install
402# @USAGE: 421# @USAGE:
403# @DESCRIPTION: 422# @DESCRIPTION:
404# Install a built package to ${D}, performing any necessary steps. 423# Install a built package to ${D}, performing any necessary steps.
405# Creates a ChangeLog from git if using live ebuilds. 424# Creates a ChangeLog from git if using live ebuilds.
406x-modular_src_install() { 425x-modular_src_install() {
407 # Install everything to ${XDIR} 426 # Install everything to ${XDIR}
427 if [[ ${CATEGORY} = x11-proto ]]; then
408 make \ 428 make \
429 ${PN/proto/}docdir=/usr/share/doc/${PF} \
409 DESTDIR="${D}" \ 430 DESTDIR="${D}" \
410 install 431 install \
432 || die
433 else
434 make \
435 docdir=/usr/share/doc/${PF} \
436 DESTDIR="${D}" \
437 install \
438 || die
439 fi
411# Shouldn't be necessary in XDIR=/usr 440# Shouldn't be necessary in XDIR=/usr
412# einstall forces datadir, so we need to re-force it 441# einstall forces datadir, so we need to re-force it
413# datadir=${XDIR}/share \ 442# datadir=${XDIR}/share \
414# mandir=${XDIR}/share/man \ 443# mandir=${XDIR}/share/man \
415 444
418 git log ${GIT_TREE} > "${S}"/ChangeLog 447 git log ${GIT_TREE} > "${S}"/ChangeLog
419 popd 448 popd
420 fi 449 fi
421 450
422 if [[ -e ${S}/ChangeLog ]]; then 451 if [[ -e ${S}/ChangeLog ]]; then
423 dodoc ${S}/ChangeLog 452 dodoc "${S}"/ChangeLog
424 fi 453 fi
425# @VARIABLE: DOCS 454# @VARIABLE: DOCS
426# @DESCRIPTION: 455# @DESCRIPTION:
427# Any documentation to install 456# Any documentation to install via dodoc
428 [[ -n ${DOCS} ]] && dodoc ${DOCS} 457 [[ -n ${DOCS} ]] && dodoc ${DOCS}
429
430 # Make sure docs get compressed
431 prepalldocs
432 458
433 # Don't install libtool archives for server modules 459 # Don't install libtool archives for server modules
434 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then 460 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then
435 find ${D}/usr/$(get_libdir)/xorg/modules -name '*.la' \ 461 find "${D}"/usr/$(get_libdir)/xorg/modules -name '*.la' \
436 | xargs rm -f 462 | xargs rm -f
437 fi 463 fi
438 464
439 if [[ -n "${FONT}" ]]; then 465 if [[ -n "${FONT}" ]]; then
440 remove_font_metadata 466 remove_font_metadata
480# @FUNCTION: cleanup_fonts 506# @FUNCTION: cleanup_fonts
481# @USAGE: 507# @USAGE:
482# @DESCRIPTION: 508# @DESCRIPTION:
483# Get rid of font directories that only contain generated files 509# Get rid of font directories that only contain generated files
484cleanup_fonts() { 510cleanup_fonts() {
485 local ALLOWED_FILES="encodings.dir fonts.cache-1 fonts.dir fonts.scale" 511 local ALLOWED_FILES="encodings.dir fonts.alias fonts.cache-1 fonts.dir fonts.scale"
486 for DIR in ${FONT_DIR}; do 512 for DIR in ${FONT_DIR}; do
487 unset KEEP_FONTDIR 513 unset KEEP_FONTDIR
488 REAL_DIR=${ROOT}usr/share/fonts/${DIR} 514 REAL_DIR=${ROOT}usr/share/fonts/${DIR}
489 515
490 ebegin "Checking ${REAL_DIR} for useless files" 516 ebegin "Checking ${REAL_DIR} for useless files"
527 die "${msg}" 553 die "${msg}"
528 fi 554 fi
529 555
530 create_fonts_scale 556 create_fonts_scale
531 create_fonts_dir 557 create_fonts_dir
532 fix_font_permissions
533 create_font_cache 558 create_font_cache
534} 559}
535 560
536# @FUNCTION: remove_font_metadata 561# @FUNCTION: remove_font_metadata
537# @USAGE: 562# @USAGE:
543 for DIR in ${FONT_DIR}; do 568 for DIR in ${FONT_DIR}; do
544 if [[ "${DIR}" != "Speedo" ]] && \ 569 if [[ "${DIR}" != "Speedo" ]] && \
545 [[ "${DIR}" != "CID" ]] ; then 570 [[ "${DIR}" != "CID" ]] ; then
546 # Delete font metadata files 571 # Delete font metadata files
547 # fonts.scale, fonts.dir, fonts.cache-1 572 # fonts.scale, fonts.dir, fonts.cache-1
548 rm -f ${D}/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1} 573 rm -f "${D}"/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1}
549 fi 574 fi
550 done 575 done
551} 576}
552 577
553# @FUNCTION: install_driver_hwdata 578# @FUNCTION: install_driver_hwdata
592 # NOTE: There is no way to regenerate Speedo/CID fonts.scale 617 # NOTE: There is no way to regenerate Speedo/CID fonts.scale
593 # <dberkholz@gentoo.org> 2 August 2004 618 # <dberkholz@gentoo.org> 2 August 2004
594 if [[ "${x/encodings}" = "${x}" ]] \ 619 if [[ "${x/encodings}" = "${x}" ]] \
595 && [[ -n "$(find ${x} -iname '*.[pot][ft][abcf]' -print)" ]]; then 620 && [[ -n "$(find ${x} -iname '*.[pot][ft][abcf]' -print)" ]]; then
596 mkfontscale \ 621 mkfontscale \
597 -a ${ROOT}/usr/share/fonts/encodings/encodings.dir \ 622 -a "${ROOT}"/usr/share/fonts/encodings/encodings.dir \
598 -- ${x} 623 -- ${x}
599 fi 624 fi
600 done 625 done
601 eend 0 626 eend 0
602} 627}
612 [[ -z "$(ls ${x}/)" ]] && continue 637 [[ -z "$(ls ${x}/)" ]] && continue
613 [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue 638 [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue
614 639
615 if [[ "${x/encodings}" = "${x}" ]]; then 640 if [[ "${x/encodings}" = "${x}" ]]; then
616 mkfontdir \ 641 mkfontdir \
617 -e ${ROOT}/usr/share/fonts/encodings \ 642 -e "${ROOT}"/usr/share/fonts/encodings \
618 -e ${ROOT}/usr/share/fonts/encodings/large \ 643 -e "${ROOT}"/usr/share/fonts/encodings/large \
619 -- ${x} 644 -- ${x}
620 fi 645 fi
621 done 646 done
622 eend 0 647 eend 0
623} 648}
624 649
625# @FUNCTION: fix_font_permissions
626# @USAGE:
627# @DESCRIPTION:
628# Font files should have 644 permissions. Ensure this is the case.
629fix_font_permissions() {
630 ebegin "Fixing permissions"
631 for DIR in ${FONT_DIR}; do
632 find ${ROOT}/usr/share/fonts/${DIR} -type f -name 'font.*' \
633 -exec chmod 0644 {} \;
634 done
635 eend 0
636}
637
638# @FUNCTION: create_font_cache 650# @FUNCTION: create_font_cache
639# @USAGE: 651# @USAGE:
640# @DESCRIPTION: 652# @DESCRIPTION:
641# Create fonts.cache-1 files, used by the new client-side fonts 653# Create fonts.cache-1 files, used by the new client-side fonts
642# subsystem. 654# subsystem.
643create_font_cache() { 655create_font_cache() {
644 font_pkg_postinst 656 font_pkg_postinst
645} 657}
646
647EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm

Legend:
Removed from v.1.99  
changed lines
  Added in v.1.118

  ViewVC Help
Powered by ViewVC 1.1.20