/[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.97 Revision 1.122
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.97 2008/05/09 07:18:19 dberkholz Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.122 2011/10/04 21:23:46 chithanh Exp $
4#
5# @DEPRECATED
6# This eclass has been superseded by xorg-2
7# Please modify your ebuilds to use that instead
4# 8#
5# @ECLASS: x-modular.eclass 9# @ECLASS: x-modular.eclass
6# @MAINTAINER: 10# @MAINTAINER:
7# Donnie Berkholz <dberkholz@gentoo.org>, x11@gentoo.org 11# Donnie Berkholz <dberkholz@gentoo.org>, x11@gentoo.org
8# @BLURB: Reduces code duplication in the modularized X11 ebuilds. 12# @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 19# 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 20# 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 21# with the other X packages, you don't need to set SRC_URI. Pretty much
18# everything else should be automatic. 22# everything else should be automatic.
19 23
24if [[ ${PV} = 9999* ]]; then
25 GIT_ECLASS="git"
26 SNAPSHOT="yes"
27 SRC_URI=""
28fi
29
30# If we're a font package, but not the font.alias one
31FONT_ECLASS=""
32if [[ "${PN/#font-}" != "${PN}" ]] \
33 && [[ "${CATEGORY}" = "media-fonts" ]] \
34 && [[ "${PN}" != "font-alias" ]] \
35 && [[ "${PN}" != "font-util" ]]; then
36 # Activate font code in the rest of the eclass
37 FONT="yes"
38
39 # Whether to inherit the font eclass
40 FONT_ECLASS="font"
41fi
42
43inherit eutils libtool multilib toolchain-funcs flag-o-matic autotools \
44 ${FONT_ECLASS} ${GIT_ECLASS}
45
46EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm"
47
48case "${EAPI:-0}" in
49 0|1)
50 ;;
51 2)
52 EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure"
53 ;;
54 *)
55 die "Unknown EAPI ${EAPI}"
56 ;;
57esac
58
59# exports must be ALWAYS after inherit
60EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS}
61
20# @ECLASS-VARIABLE: XDIR 62# @ECLASS-VARIABLE: XDIR
21# @DESCRIPTION: 63# @DESCRIPTION:
22# Directory prefix to use for everything. If you want to install to a 64# 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 65# 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 66# recently tested. You may need to uncomment the setting of datadir and
27XDIR="/usr" 69XDIR="/usr"
28 70
29IUSE="" 71IUSE=""
30HOMEPAGE="http://xorg.freedesktop.org/" 72HOMEPAGE="http://xorg.freedesktop.org/"
31 73
32if [[ -z ${SNAPSHOT} ]]; then
33# @ECLASS-VARIABLE: SNAPSHOT 74# @ECLASS-VARIABLE: SNAPSHOT
34# @DESCRIPTION: 75# @DESCRIPTION:
35# If set to 'yes' and configure.ac exists, eautoreconf will run. Set 76# If set to 'yes' and configure.ac exists, eautoreconf will run. Set
36# before inheriting this eclass. 77# before inheriting this eclass.
37 SNAPSHOT="no" 78: ${SNAPSHOT:=no}
38fi
39
40if [[ ${PV} = 9999* ]]; then
41 GIT_ECLASS="git"
42 SNAPSHOT="yes"
43 SRC_URI=""
44fi
45 79
46# Set up SRC_URI for individual modular releases 80# Set up SRC_URI for individual modular releases
47BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual" 81BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual"
48if [[ ${CATEGORY} = x11-apps ]] || [[ ${CATEGORY} = x11-wm ]]; then 82# @ECLASS-VARIABLE: MODULE
49 MODULE="app" 83# @DESCRIPTION:
50elif [[ ${CATEGORY} = app-doc ]]; then 84# The subdirectory to download source from. Possible settings are app,
51 MODULE="doc" 85# doc, data, util, driver, font, lib, proto, xserver. Set above the
52# x11-misc contains data and util, x11-themes contains data 86# inherit to override the default autoconfigured module.
53elif [[ ${CATEGORY} = x11-misc ]] || [[ ${CATEGORY} = x11-themes ]]; then 87if [[ -z ${MODULE} ]]; then
54 if [[ ${PN} == xbitmaps || ${PN} == xcursor-themes || ${PN} == xkbdata ]]; then 88 case ${CATEGORY} in
55 MODULE="data" 89 app-doc) MODULE="doc" ;;
56 else 90 media-fonts) MODULE="font" ;;
57 MODULE="util" 91 x11-apps|x11-wm) MODULE="app" ;;
58 fi 92 x11-misc|x11-themes) MODULE="util" ;;
59elif [[ ${CATEGORY} = x11-drivers ]]; then 93 x11-drivers) MODULE="driver" ;;
60 MODULE="driver" 94 x11-base) MODULE="xserver" ;;
61elif [[ ${CATEGORY} = media-fonts ]]; then 95 x11-proto) MODULE="proto" ;;
62 MODULE="font" 96 x11-libs) MODULE="lib" ;;
63elif [[ ${CATEGORY} = x11-libs ]]; then 97 esac
64 MODULE="lib"
65elif [[ ${CATEGORY} = x11-proto ]]; then
66 MODULE="proto"
67elif [[ ${CATEGORY} = x11-base ]]; then
68 MODULE="xserver"
69fi 98fi
70 99
71if [[ -n ${GIT_ECLASS} ]]; then 100if [[ -n ${GIT_ECLASS} ]]; then
72 EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}/${PN}" 101 EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}/${PN}"
73else 102else
75fi 104fi
76 105
77SLOT="0" 106SLOT="0"
78 107
79# Set the license for the package. This can be overridden by setting 108# Set the license for the package. This can be overridden by setting
80# LICENSE after the inherit. 109# LICENSE after the inherit. Nearly all FreeDesktop-hosted X packages
81LICENSE=${PN} 110# are under the MIT license. (This is what Red Hat does in their rpms)
111LICENSE="MIT"
82 112
83# Set up shared dependencies 113# Set up shared dependencies
84if [[ -n "${SNAPSHOT}" ]]; then 114if [[ -n "${SNAPSHOT}" ]]; then
85# FIXME: What's the minimal libtool version supporting arbitrary versioning? 115# FIXME: What's the minimal libtool version supporting arbitrary versioning?
86 DEPEND="${DEPEND} 116 DEPEND="${DEPEND}
88 >=sys-devel/m4-1.4" 118 >=sys-devel/m4-1.4"
89 WANT_AUTOCONF="latest" 119 WANT_AUTOCONF="latest"
90 WANT_AUTOMAKE="latest" 120 WANT_AUTOMAKE="latest"
91fi 121fi
92 122
93# If we're a font package, but not the font.alias one 123if [[ -n "${FONT}" ]]; then
94FONT_ECLASS=""
95if [[ "${PN/#font-}" != "${PN}" ]] \
96 && [[ "${CATEGORY}" = "media-fonts" ]] \
97 && [[ "${PN}" != "font-alias" ]] \
98 && [[ "${PN}" != "font-util" ]]; then
99 # Activate font code in the rest of the eclass
100 FONT="yes"
101
102 # Whether to inherit the font eclass
103 FONT_ECLASS="font"
104
105 RDEPEND="${RDEPEND} 124 RDEPEND="${RDEPEND}
106 media-fonts/encodings 125 media-fonts/encodings
107 x11-apps/mkfontscale 126 x11-apps/mkfontscale
108 x11-apps/mkfontdir" 127 x11-apps/mkfontdir"
109 PDEPEND="${PDEPEND} 128 PDEPEND="${PDEPEND}
110 media-fonts/font-alias" 129 media-fonts/font-alias"
111 130
112 # Starting with 7.0RC3, we can specify the font directory 131 # Starting with 7.0RC3, we can specify the font directory
113 # But oddly, we can't do the same for encodings or font-alias 132 # But oddly, we can't do the same for encodings or font-alias
114 133
115 # Wrap in `if` so ebuilds can set it too
116 if [[ -z ${FONT_DIR} ]]; then
117# @ECLASS-VARIABLE: FONT_DIR 134# @ECLASS-VARIABLE: FONT_DIR
118# @DESCRIPTION: 135# @DESCRIPTION:
119# If you're creating a font package and the suffix of PN is not equal to 136# If you're creating a font package and the suffix of PN is not equal to
120# the subdirectory of /usr/share/fonts/ it should install into, set 137# the subdirectory of /usr/share/fonts/ it should install into, set
121# FONT_DIR to that directory or directories. Set before inheriting this 138# FONT_DIR to that directory or directories. Set before inheriting this
122# eclass. 139# eclass.
123 FONT_DIR=${PN##*-} 140 : ${FONT_DIR:=${PN##*-}}
124
125 fi
126 141
127 # Fix case of font directories 142 # Fix case of font directories
128 FONT_DIR=${FONT_DIR/ttf/TTF} 143 FONT_DIR=${FONT_DIR/ttf/TTF}
129 FONT_DIR=${FONT_DIR/otf/OTF} 144 FONT_DIR=${FONT_DIR/otf/OTF}
130 FONT_DIR=${FONT_DIR/type1/Type1} 145 FONT_DIR=${FONT_DIR/type1/Type1}
131 FONT_DIR=${FONT_DIR/speedo/Speedo} 146 FONT_DIR=${FONT_DIR/speedo/Speedo}
132 147
133 # Set up configure option 148 # Set up configure options, wrapped so ebuilds can override if need be
149 if [[ -z ${FONT_OPTIONS} ]]; then
134 FONT_OPTIONS="--with-fontdir=\"/usr/share/fonts/${FONT_DIR}\"" 150 FONT_OPTIONS="--with-fontdir=\"/usr/share/fonts/${FONT_DIR}\""
151 fi
135 152
136 if [[ -n "${FONT}" ]]; then 153 if [[ -n "${FONT}" ]]; then
137 if [[ ${PN##*-} = misc ]] || [[ ${PN##*-} = 75dpi ]] || [[ ${PN##*-} = 100dpi ]] || [[ ${PN##*-} = cyrillic ]]; then 154 if [[ ${PN##*-} = misc ]] || [[ ${PN##*-} = 75dpi ]] || [[ ${PN##*-} = 100dpi ]] || [[ ${PN##*-} = cyrillic ]]; then
138 IUSE="${IUSE} nls" 155 IUSE="${IUSE} nls"
139 fi 156 fi
163DEPEND="${DEPEND} 180DEPEND="${DEPEND}
164 >=dev-util/pkgconfig-0.18" 181 >=dev-util/pkgconfig-0.18"
165 182
166if [[ "${PN/util-macros}" = "${PN}" ]]; then 183if [[ "${PN/util-macros}" = "${PN}" ]]; then
167 DEPEND="${DEPEND} 184 DEPEND="${DEPEND}
168 >=x11-misc/util-macros-0.99.2 185 >=x11-misc/util-macros-1.3.0"
169 >=sys-devel/binutils-2.16.1-r3"
170fi 186fi
171 187
172RDEPEND="${RDEPEND} 188RDEPEND="${RDEPEND}
173 !<=x11-base/xorg-x11-6.9" 189 !<=x11-base/xorg-x11-6.9"
174# Provides virtual/x11 for temporary use until packages are ported 190# Provides virtual/x11 for temporary use until packages are ported
175# x11-base/x11-env" 191# x11-base/x11-env"
176
177inherit eutils libtool multilib toolchain-funcs flag-o-matic autotools \
178 ${FONT_ECLASS} ${GIT_ECLASS}
179 192
180# @FUNCTION: x-modular_specs_check 193# @FUNCTION: x-modular_specs_check
181# @USAGE: 194# @USAGE:
182# @DESCRIPTION: 195# @DESCRIPTION:
183# Make any necessary changes related to gcc specs (generally hardened) 196# Make any necessary changes related to gcc specs (generally hardened)
194# @DESCRIPTION: 207# @DESCRIPTION:
195# Ensures the server supports DRI if building a driver with DRI support 208# Ensures the server supports DRI if building a driver with DRI support
196x-modular_dri_check() { 209x-modular_dri_check() {
197 # (#120057) Enabling DRI in drivers requires that the server was built with 210 # (#120057) Enabling DRI in drivers requires that the server was built with
198 # support for it 211 # support for it
212 # Starting with xorg-server 1.5.3, DRI support is always enabled unless
213 # USE=minimal is set (see bug #252084)
199 if [[ -n "${DRIVER}" ]]; then 214 if [[ -n "${DRIVER}" ]]; then
200 if has dri ${IUSE} && use dri; then 215 if has dri ${IUSE} && use dri; then
201 einfo "Checking for direct rendering capabilities ..." 216 einfo "Checking for direct rendering capabilities ..."
217 if has_version '>=x11-base/xorg-server-1.5.3'; then
218 if built_with_use x11-base/xorg-server minimal; then
219 die "You must build x11-base/xorg-server with USE=-minimal."
220 fi
221 else
202 if ! built_with_use x11-base/xorg-server dri; then 222 if ! built_with_use x11-base/xorg-server dri; then
203 die "You must build x11-base/xorg-server with USE=dri." 223 die "You must build x11-base/xorg-server with USE=dri."
224 fi
204 fi 225 fi
205 fi 226 fi
206 fi 227 fi
207} 228}
208 229
231 if [[ -n ${GIT_ECLASS} ]]; then 252 if [[ -n ${GIT_ECLASS} ]]; then
232 git_src_unpack 253 git_src_unpack
233 else 254 else
234 unpack ${A} 255 unpack ${A}
235 fi 256 fi
236 cd ${S} 257 cd "${S}"
237 258
238 if [[ -n ${FONT_OPTIONS} ]]; then 259 if [[ -n ${FONT_OPTIONS} ]]; then
239 einfo "Detected font directory: ${FONT_DIR}" 260 einfo "Detected font directory: ${FONT_DIR}"
240 fi 261 fi
241} 262}
291 # Joshua Baergen - October 23, 2005 312 # Joshua Baergen - October 23, 2005
292 # Fix shared lib issues on MIPS, FBSD, etc etc 313 # Fix shared lib issues on MIPS, FBSD, etc etc
293 elibtoolize 314 elibtoolize
294} 315}
295 316
317# @FUNCTION: x-modular_src_prepare
318# @USAGE:
319# @DESCRIPTION:
320# Prepare a package after unpacking, performing all X-related tasks.
321x-modular_src_prepare() {
322 [[ -n ${GIT_ECLASS} ]] && has src_prepare ${EXPORTED_FUNCTIONS} \
323 && git_src_prepare
324 x-modular_patch_source
325 x-modular_reconf_source
326}
327
296# @FUNCTION: x-modular_src_unpack 328# @FUNCTION: x-modular_src_unpack
297# @USAGE: 329# @USAGE:
298# @DESCRIPTION: 330# @DESCRIPTION:
299# Unpack a package, performing all X-related tasks. 331# Unpack a package, performing all X-related tasks.
300x-modular_src_unpack() { 332x-modular_src_unpack() {
301 x-modular_specs_check 333 x-modular_specs_check
302 x-modular_server_supports_drivers_check 334 x-modular_server_supports_drivers_check
303 x-modular_dri_check 335 x-modular_dri_check
304 x-modular_unpack_source 336 x-modular_unpack_source
305 x-modular_patch_source 337 has src_prepare ${EXPORTED_FUNCTIONS} || x-modular_src_prepare
306 x-modular_reconf_source
307} 338}
308 339
309# @FUNCTION: x-modular_font_configure 340# @FUNCTION: x-modular_font_configure
310# @USAGE: 341# @USAGE:
311# @DESCRIPTION: 342# @DESCRIPTION:
312# If a font package, perform any necessary configuration steps 343# If a font package, perform any necessary configuration steps
313x-modular_font_configure() { 344x-modular_font_configure() {
314 if [[ -n "${FONT}" ]]; then 345 if [[ -n "${FONT}" ]]; then
315 # Might be worth adding an option to configure your desired font 346 # Might be worth adding an option to configure your desired font
316 # and exclude all others. Also, should this USE be nls or minimal? 347 # and exclude all others. Also, should this USE be nls or minimal?
317 if ! use nls; then 348 if has nls ${IUSE//+} && ! use nls; then
318 FONT_OPTIONS="${FONT_OPTIONS} 349 FONT_OPTIONS="${FONT_OPTIONS}
319 --disable-iso8859-2 350 --disable-iso8859-2
320 --disable-iso8859-3 351 --disable-iso8859-3
321 --disable-iso8859-4 352 --disable-iso8859-4
322 --disable-iso8859-5 353 --disable-iso8859-5
358 x-modular_font_configure 389 x-modular_font_configure
359 x-modular_debug_setup 390 x-modular_debug_setup
360 391
361# @VARIABLE: CONFIGURE_OPTIONS 392# @VARIABLE: CONFIGURE_OPTIONS
362# @DESCRIPTION: 393# @DESCRIPTION:
363# Any options to pass to configure 394# Any extra options to pass to configure
364[[ -n ${CONFIGURE_OPTIONTS} ]]
365 395
366 # If prefix isn't set here, .pc files cause problems 396 # If prefix isn't set here, .pc files cause problems
367 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then 397 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
368 econf --prefix=${XDIR} \ 398 econf --prefix=${XDIR} \
369 --datadir=${XDIR}/share \ 399 --datadir=${XDIR}/share \
379# Run make. 409# Run make.
380x-modular_src_make() { 410x-modular_src_make() {
381 emake || die "emake failed" 411 emake || die "emake failed"
382} 412}
383 413
384# @FUNCTION: x-modular_src_configure 414# @FUNCTION: x-modular_src_compile
385# @USAGE: 415# @USAGE:
386# @DESCRIPTION: 416# @DESCRIPTION:
387# Compile a package, performing all X-related tasks. 417# Compile a package, performing all X-related tasks.
388x-modular_src_compile() { 418x-modular_src_compile() {
389 x-modular_src_configure 419 has src_configure ${EXPORTED_FUNCTIONS} || x-modular_src_configure
390 x-modular_src_make 420 x-modular_src_make
391} 421}
392 422
393# @FUNCTION: x-modular_src_install 423# @FUNCTION: x-modular_src_install
394# @USAGE: 424# @USAGE:
395# @DESCRIPTION: 425# @DESCRIPTION:
396# Install a built package to ${D}, performing any necessary steps. 426# Install a built package to ${D}, performing any necessary steps.
397# Creates a ChangeLog from git if using live ebuilds. 427# Creates a ChangeLog from git if using live ebuilds.
398x-modular_src_install() { 428x-modular_src_install() {
399 # Install everything to ${XDIR} 429 # Install everything to ${XDIR}
430 if [[ ${CATEGORY} = x11-proto ]]; then
400 make \ 431 make \
432 ${PN/proto/}docdir=/usr/share/doc/${PF} \
401 DESTDIR="${D}" \ 433 DESTDIR="${D}" \
402 install 434 install \
435 || die
436 else
437 make \
438 docdir=/usr/share/doc/${PF} \
439 DESTDIR="${D}" \
440 install \
441 || die
442 fi
403# Shouldn't be necessary in XDIR=/usr 443# Shouldn't be necessary in XDIR=/usr
404# einstall forces datadir, so we need to re-force it 444# einstall forces datadir, so we need to re-force it
405# datadir=${XDIR}/share \ 445# datadir=${XDIR}/share \
406# mandir=${XDIR}/share/man \ 446# mandir=${XDIR}/share/man \
407 447
410 git log ${GIT_TREE} > "${S}"/ChangeLog 450 git log ${GIT_TREE} > "${S}"/ChangeLog
411 popd 451 popd
412 fi 452 fi
413 453
414 if [[ -e ${S}/ChangeLog ]]; then 454 if [[ -e ${S}/ChangeLog ]]; then
415 dodoc ${S}/ChangeLog 455 dodoc "${S}"/ChangeLog
416 fi 456 fi
417# @VARIABLE: DOCS 457# @VARIABLE: DOCS
418# @DESCRIPTION: 458# @DESCRIPTION:
419# Any documentation to install 459# Any documentation to install via dodoc
420 [[ -n ${DOCS} ]] && dodoc ${DOCS} 460 [[ -n ${DOCS} ]] && dodoc ${DOCS}
421
422 # Make sure docs get compressed
423 prepalldocs
424 461
425 # Don't install libtool archives for server modules 462 # Don't install libtool archives for server modules
426 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then 463 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then
427 find ${D}/usr/$(get_libdir)/xorg/modules -name '*.la' \ 464 find "${D}"/usr/$(get_libdir)/xorg/modules -name '*.la' \
428 | xargs rm -f 465 | xargs rm -f
429 fi 466 fi
430 467
431 if [[ -n "${FONT}" ]]; then 468 if [[ -n "${FONT}" ]]; then
432 remove_font_metadata 469 remove_font_metadata
462# @DESCRIPTION: 499# @DESCRIPTION:
463# Run X-specific post-removal tasks on the live filesystem. The only 500# Run X-specific post-removal tasks on the live filesystem. The only
464# task right now is some cleanup for font packages. 501# task right now is some cleanup for font packages.
465x-modular_pkg_postrm() { 502x-modular_pkg_postrm() {
466 if [[ -n "${FONT}" ]]; then 503 if [[ -n "${FONT}" ]]; then
467 cleanup_fonts
468 font_pkg_postrm 504 font_pkg_postrm
469 fi 505 fi
470}
471
472# @FUNCTION: cleanup_fonts
473# @USAGE:
474# @DESCRIPTION:
475# Get rid of font directories that only contain generated files
476cleanup_fonts() {
477 local ALLOWED_FILES="encodings.dir fonts.cache-1 fonts.dir fonts.scale"
478 for DIR in ${FONT_DIR}; do
479 unset KEEP_FONTDIR
480 REAL_DIR=${ROOT}usr/share/fonts/${DIR}
481
482 ebegin "Checking ${REAL_DIR} for useless files"
483 pushd ${REAL_DIR} &> /dev/null
484 for FILE in *; do
485 unset MATCH
486 for ALLOWED_FILE in ${ALLOWED_FILES}; do
487 if [[ ${FILE} = ${ALLOWED_FILE} ]]; then
488 # If it's allowed, then move on to the next file
489 MATCH="yes"
490 break
491 fi
492 done
493 # If we found a match in allowed files, move on to the next file
494 if [[ -n ${MATCH} ]]; then
495 continue
496 fi
497 # If we get this far, there wasn't a match in the allowed files
498 KEEP_FONTDIR="yes"
499 # We don't need to check more files if we're already keeping it
500 break
501 done
502 popd &> /dev/null
503 # If there are no files worth keeping, then get rid of the dir
504 if [[ -z "${KEEP_FONTDIR}" ]]; then
505 rm -rf ${REAL_DIR}
506 fi
507 eend 0
508 done
509} 506}
510 507
511# @FUNCTION: setup_fonts 508# @FUNCTION: setup_fonts
512# @USAGE: 509# @USAGE:
513# @DESCRIPTION: 510# @DESCRIPTION:
519 die "${msg}" 516 die "${msg}"
520 fi 517 fi
521 518
522 create_fonts_scale 519 create_fonts_scale
523 create_fonts_dir 520 create_fonts_dir
524 fix_font_permissions
525 create_font_cache 521 create_font_cache
526} 522}
527 523
528# @FUNCTION: remove_font_metadata 524# @FUNCTION: remove_font_metadata
529# @USAGE: 525# @USAGE:
535 for DIR in ${FONT_DIR}; do 531 for DIR in ${FONT_DIR}; do
536 if [[ "${DIR}" != "Speedo" ]] && \ 532 if [[ "${DIR}" != "Speedo" ]] && \
537 [[ "${DIR}" != "CID" ]] ; then 533 [[ "${DIR}" != "CID" ]] ; then
538 # Delete font metadata files 534 # Delete font metadata files
539 # fonts.scale, fonts.dir, fonts.cache-1 535 # fonts.scale, fonts.dir, fonts.cache-1
540 rm -f ${D}/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1} 536 rm -f "${D}"/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1}
541 fi 537 fi
542 done 538 done
543} 539}
544 540
545# @FUNCTION: install_driver_hwdata 541# @FUNCTION: install_driver_hwdata
546# @USAGE: 542# @USAGE:
547# @DESCRIPTION: 543# @DESCRIPTION:
548# Installs device-to-driver mappings for system-config-display and 544# Installs device-to-driver mappings for system-config-display and
549# anything else that uses hwdata. 545# anything else that uses hwdata.
550install_driver_hwdata() { 546install_driver_hwdata() {
551 insinto /usr/share/hwdata/videoaliases 547 insinto /usr/share/hwdata/videoaliases
552 for i in "${FILESDIR}"/*.xinf; do 548 for i in "${FILESDIR}"/*.xinf; do
553 # We need this for the case when none exist, 549 # We need this for the case when none exist,
584 # NOTE: There is no way to regenerate Speedo/CID fonts.scale 580 # NOTE: There is no way to regenerate Speedo/CID fonts.scale
585 # <dberkholz@gentoo.org> 2 August 2004 581 # <dberkholz@gentoo.org> 2 August 2004
586 if [[ "${x/encodings}" = "${x}" ]] \ 582 if [[ "${x/encodings}" = "${x}" ]] \
587 && [[ -n "$(find ${x} -iname '*.[pot][ft][abcf]' -print)" ]]; then 583 && [[ -n "$(find ${x} -iname '*.[pot][ft][abcf]' -print)" ]]; then
588 mkfontscale \ 584 mkfontscale \
589 -a ${ROOT}/usr/share/fonts/encodings/encodings.dir \ 585 -a "${ROOT}"/usr/share/fonts/encodings/encodings.dir \
590 -- ${x} 586 -- ${x}
591 fi 587 fi
592 done 588 done
593 eend 0 589 eend 0
594} 590}
604 [[ -z "$(ls ${x}/)" ]] && continue 600 [[ -z "$(ls ${x}/)" ]] && continue
605 [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue 601 [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue
606 602
607 if [[ "${x/encodings}" = "${x}" ]]; then 603 if [[ "${x/encodings}" = "${x}" ]]; then
608 mkfontdir \ 604 mkfontdir \
609 -e ${ROOT}/usr/share/fonts/encodings \ 605 -e "${ROOT}"/usr/share/fonts/encodings \
610 -e ${ROOT}/usr/share/fonts/encodings/large \ 606 -e "${ROOT}"/usr/share/fonts/encodings/large \
611 -- ${x} 607 -- ${x}
612 fi 608 fi
613 done 609 done
614 eend 0 610 eend 0
615} 611}
616 612
617# @FUNCTION: fix_font_permissions
618# @USAGE:
619# @DESCRIPTION:
620# Font files should have 644 permissions. Ensure this is the case.
621fix_font_permissions() {
622 ebegin "Fixing permissions"
623 for DIR in ${FONT_DIR}; do
624 find ${ROOT}/usr/share/fonts/${DIR} -type f -name 'font.*' \
625 -exec chmod 0644 {} \;
626 done
627 eend 0
628}
629
630# @FUNCTION: create_font_cache 613# @FUNCTION: create_font_cache
631# @USAGE: 614# @USAGE:
632# @DESCRIPTION: 615# @DESCRIPTION:
633# Create fonts.cache-1 files, used by the new client-side fonts 616# Create fonts.cache-1 files, used by the new client-side fonts
634# subsystem. 617# subsystem.
635create_font_cache() { 618create_font_cache() {
636 font_pkg_postinst 619 font_pkg_postinst
637} 620}
638
639EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm

Legend:
Removed from v.1.97  
changed lines
  Added in v.1.122

  ViewVC Help
Powered by ViewVC 1.1.20