/[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.121
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.121 2011/08/29 01:28:10 vapier 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" 186 sys-devel/binutils"
170fi 187fi
171 188
172RDEPEND="${RDEPEND} 189RDEPEND="${RDEPEND}
173 !<=x11-base/xorg-x11-6.9" 190 !<=x11-base/xorg-x11-6.9"
174# Provides virtual/x11 for temporary use until packages are ported 191# Provides virtual/x11 for temporary use until packages are ported
175# x11-base/x11-env" 192# x11-base/x11-env"
176
177inherit eutils libtool multilib toolchain-funcs flag-o-matic autotools \
178 ${FONT_ECLASS} ${GIT_ECLASS}
179 193
180# @FUNCTION: x-modular_specs_check 194# @FUNCTION: x-modular_specs_check
181# @USAGE: 195# @USAGE:
182# @DESCRIPTION: 196# @DESCRIPTION:
183# Make any necessary changes related to gcc specs (generally hardened) 197# Make any necessary changes related to gcc specs (generally hardened)
194# @DESCRIPTION: 208# @DESCRIPTION:
195# Ensures the server supports DRI if building a driver with DRI support 209# Ensures the server supports DRI if building a driver with DRI support
196x-modular_dri_check() { 210x-modular_dri_check() {
197 # (#120057) Enabling DRI in drivers requires that the server was built with 211 # (#120057) Enabling DRI in drivers requires that the server was built with
198 # support for it 212 # support for it
213 # Starting with xorg-server 1.5.3, DRI support is always enabled unless
214 # USE=minimal is set (see bug #252084)
199 if [[ -n "${DRIVER}" ]]; then 215 if [[ -n "${DRIVER}" ]]; then
200 if has dri ${IUSE} && use dri; then 216 if has dri ${IUSE} && use dri; then
201 einfo "Checking for direct rendering capabilities ..." 217 einfo "Checking for direct rendering capabilities ..."
218 if has_version '>=x11-base/xorg-server-1.5.3'; then
219 if built_with_use x11-base/xorg-server minimal; then
220 die "You must build x11-base/xorg-server with USE=-minimal."
221 fi
222 else
202 if ! built_with_use x11-base/xorg-server dri; then 223 if ! built_with_use x11-base/xorg-server dri; then
203 die "You must build x11-base/xorg-server with USE=dri." 224 die "You must build x11-base/xorg-server with USE=dri."
225 fi
204 fi 226 fi
205 fi 227 fi
206 fi 228 fi
207} 229}
208 230
231 if [[ -n ${GIT_ECLASS} ]]; then 253 if [[ -n ${GIT_ECLASS} ]]; then
232 git_src_unpack 254 git_src_unpack
233 else 255 else
234 unpack ${A} 256 unpack ${A}
235 fi 257 fi
236 cd ${S} 258 cd "${S}"
237 259
238 if [[ -n ${FONT_OPTIONS} ]]; then 260 if [[ -n ${FONT_OPTIONS} ]]; then
239 einfo "Detected font directory: ${FONT_DIR}" 261 einfo "Detected font directory: ${FONT_DIR}"
240 fi 262 fi
241} 263}
291 # Joshua Baergen - October 23, 2005 313 # Joshua Baergen - October 23, 2005
292 # Fix shared lib issues on MIPS, FBSD, etc etc 314 # Fix shared lib issues on MIPS, FBSD, etc etc
293 elibtoolize 315 elibtoolize
294} 316}
295 317
318# @FUNCTION: x-modular_src_prepare
319# @USAGE:
320# @DESCRIPTION:
321# Prepare a package after unpacking, performing all X-related tasks.
322x-modular_src_prepare() {
323 [[ -n ${GIT_ECLASS} ]] && has src_prepare ${EXPORTED_FUNCTIONS} \
324 && git_src_prepare
325 x-modular_patch_source
326 x-modular_reconf_source
327}
328
296# @FUNCTION: x-modular_src_unpack 329# @FUNCTION: x-modular_src_unpack
297# @USAGE: 330# @USAGE:
298# @DESCRIPTION: 331# @DESCRIPTION:
299# Unpack a package, performing all X-related tasks. 332# Unpack a package, performing all X-related tasks.
300x-modular_src_unpack() { 333x-modular_src_unpack() {
301 x-modular_specs_check 334 x-modular_specs_check
302 x-modular_server_supports_drivers_check 335 x-modular_server_supports_drivers_check
303 x-modular_dri_check 336 x-modular_dri_check
304 x-modular_unpack_source 337 x-modular_unpack_source
305 x-modular_patch_source 338 has src_prepare ${EXPORTED_FUNCTIONS} || x-modular_src_prepare
306 x-modular_reconf_source
307} 339}
308 340
309# @FUNCTION: x-modular_font_configure 341# @FUNCTION: x-modular_font_configure
310# @USAGE: 342# @USAGE:
311# @DESCRIPTION: 343# @DESCRIPTION:
312# If a font package, perform any necessary configuration steps 344# If a font package, perform any necessary configuration steps
313x-modular_font_configure() { 345x-modular_font_configure() {
314 if [[ -n "${FONT}" ]]; then 346 if [[ -n "${FONT}" ]]; then
315 # Might be worth adding an option to configure your desired font 347 # Might be worth adding an option to configure your desired font
316 # and exclude all others. Also, should this USE be nls or minimal? 348 # and exclude all others. Also, should this USE be nls or minimal?
317 if ! use nls; then 349 if has nls ${IUSE//+} && ! use nls; then
318 FONT_OPTIONS="${FONT_OPTIONS} 350 FONT_OPTIONS="${FONT_OPTIONS}
319 --disable-iso8859-2 351 --disable-iso8859-2
320 --disable-iso8859-3 352 --disable-iso8859-3
321 --disable-iso8859-4 353 --disable-iso8859-4
322 --disable-iso8859-5 354 --disable-iso8859-5
358 x-modular_font_configure 390 x-modular_font_configure
359 x-modular_debug_setup 391 x-modular_debug_setup
360 392
361# @VARIABLE: CONFIGURE_OPTIONS 393# @VARIABLE: CONFIGURE_OPTIONS
362# @DESCRIPTION: 394# @DESCRIPTION:
363# Any options to pass to configure 395# Any extra options to pass to configure
364[[ -n ${CONFIGURE_OPTIONTS} ]]
365 396
366 # If prefix isn't set here, .pc files cause problems 397 # If prefix isn't set here, .pc files cause problems
367 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then 398 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
368 econf --prefix=${XDIR} \ 399 econf --prefix=${XDIR} \
369 --datadir=${XDIR}/share \ 400 --datadir=${XDIR}/share \
379# Run make. 410# Run make.
380x-modular_src_make() { 411x-modular_src_make() {
381 emake || die "emake failed" 412 emake || die "emake failed"
382} 413}
383 414
384# @FUNCTION: x-modular_src_configure 415# @FUNCTION: x-modular_src_compile
385# @USAGE: 416# @USAGE:
386# @DESCRIPTION: 417# @DESCRIPTION:
387# Compile a package, performing all X-related tasks. 418# Compile a package, performing all X-related tasks.
388x-modular_src_compile() { 419x-modular_src_compile() {
389 x-modular_src_configure 420 has src_configure ${EXPORTED_FUNCTIONS} || x-modular_src_configure
390 x-modular_src_make 421 x-modular_src_make
391} 422}
392 423
393# @FUNCTION: x-modular_src_install 424# @FUNCTION: x-modular_src_install
394# @USAGE: 425# @USAGE:
395# @DESCRIPTION: 426# @DESCRIPTION:
396# Install a built package to ${D}, performing any necessary steps. 427# Install a built package to ${D}, performing any necessary steps.
397# Creates a ChangeLog from git if using live ebuilds. 428# Creates a ChangeLog from git if using live ebuilds.
398x-modular_src_install() { 429x-modular_src_install() {
399 # Install everything to ${XDIR} 430 # Install everything to ${XDIR}
431 if [[ ${CATEGORY} = x11-proto ]]; then
400 make \ 432 make \
433 ${PN/proto/}docdir=/usr/share/doc/${PF} \
401 DESTDIR="${D}" \ 434 DESTDIR="${D}" \
402 install 435 install \
436 || die
437 else
438 make \
439 docdir=/usr/share/doc/${PF} \
440 DESTDIR="${D}" \
441 install \
442 || die
443 fi
403# Shouldn't be necessary in XDIR=/usr 444# Shouldn't be necessary in XDIR=/usr
404# einstall forces datadir, so we need to re-force it 445# einstall forces datadir, so we need to re-force it
405# datadir=${XDIR}/share \ 446# datadir=${XDIR}/share \
406# mandir=${XDIR}/share/man \ 447# mandir=${XDIR}/share/man \
407 448
410 git log ${GIT_TREE} > "${S}"/ChangeLog 451 git log ${GIT_TREE} > "${S}"/ChangeLog
411 popd 452 popd
412 fi 453 fi
413 454
414 if [[ -e ${S}/ChangeLog ]]; then 455 if [[ -e ${S}/ChangeLog ]]; then
415 dodoc ${S}/ChangeLog 456 dodoc "${S}"/ChangeLog
416 fi 457 fi
417# @VARIABLE: DOCS 458# @VARIABLE: DOCS
418# @DESCRIPTION: 459# @DESCRIPTION:
419# Any documentation to install 460# Any documentation to install via dodoc
420 [[ -n ${DOCS} ]] && dodoc ${DOCS} 461 [[ -n ${DOCS} ]] && dodoc ${DOCS}
421
422 # Make sure docs get compressed
423 prepalldocs
424 462
425 # Don't install libtool archives for server modules 463 # Don't install libtool archives for server modules
426 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then 464 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then
427 find ${D}/usr/$(get_libdir)/xorg/modules -name '*.la' \ 465 find "${D}"/usr/$(get_libdir)/xorg/modules -name '*.la' \
428 | xargs rm -f 466 | xargs rm -f
429 fi 467 fi
430 468
431 if [[ -n "${FONT}" ]]; then 469 if [[ -n "${FONT}" ]]; then
432 remove_font_metadata 470 remove_font_metadata
462# @DESCRIPTION: 500# @DESCRIPTION:
463# Run X-specific post-removal tasks on the live filesystem. The only 501# Run X-specific post-removal tasks on the live filesystem. The only
464# task right now is some cleanup for font packages. 502# task right now is some cleanup for font packages.
465x-modular_pkg_postrm() { 503x-modular_pkg_postrm() {
466 if [[ -n "${FONT}" ]]; then 504 if [[ -n "${FONT}" ]]; then
467 cleanup_fonts
468 font_pkg_postrm 505 font_pkg_postrm
469 fi 506 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} 507}
510 508
511# @FUNCTION: setup_fonts 509# @FUNCTION: setup_fonts
512# @USAGE: 510# @USAGE:
513# @DESCRIPTION: 511# @DESCRIPTION:
519 die "${msg}" 517 die "${msg}"
520 fi 518 fi
521 519
522 create_fonts_scale 520 create_fonts_scale
523 create_fonts_dir 521 create_fonts_dir
524 fix_font_permissions
525 create_font_cache 522 create_font_cache
526} 523}
527 524
528# @FUNCTION: remove_font_metadata 525# @FUNCTION: remove_font_metadata
529# @USAGE: 526# @USAGE:
535 for DIR in ${FONT_DIR}; do 532 for DIR in ${FONT_DIR}; do
536 if [[ "${DIR}" != "Speedo" ]] && \ 533 if [[ "${DIR}" != "Speedo" ]] && \
537 [[ "${DIR}" != "CID" ]] ; then 534 [[ "${DIR}" != "CID" ]] ; then
538 # Delete font metadata files 535 # Delete font metadata files
539 # fonts.scale, fonts.dir, fonts.cache-1 536 # fonts.scale, fonts.dir, fonts.cache-1
540 rm -f ${D}/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1} 537 rm -f "${D}"/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1}
541 fi 538 fi
542 done 539 done
543} 540}
544 541
545# @FUNCTION: install_driver_hwdata 542# @FUNCTION: install_driver_hwdata
546# @USAGE: 543# @USAGE:
547# @DESCRIPTION: 544# @DESCRIPTION:
548# Installs device-to-driver mappings for system-config-display and 545# Installs device-to-driver mappings for system-config-display and
549# anything else that uses hwdata. 546# anything else that uses hwdata.
550install_driver_hwdata() { 547install_driver_hwdata() {
551 insinto /usr/share/hwdata/videoaliases 548 insinto /usr/share/hwdata/videoaliases
552 for i in "${FILESDIR}"/*.xinf; do 549 for i in "${FILESDIR}"/*.xinf; do
553 # We need this for the case when none exist, 550 # We need this for the case when none exist,
584 # NOTE: There is no way to regenerate Speedo/CID fonts.scale 581 # NOTE: There is no way to regenerate Speedo/CID fonts.scale
585 # <dberkholz@gentoo.org> 2 August 2004 582 # <dberkholz@gentoo.org> 2 August 2004
586 if [[ "${x/encodings}" = "${x}" ]] \ 583 if [[ "${x/encodings}" = "${x}" ]] \
587 && [[ -n "$(find ${x} -iname '*.[pot][ft][abcf]' -print)" ]]; then 584 && [[ -n "$(find ${x} -iname '*.[pot][ft][abcf]' -print)" ]]; then
588 mkfontscale \ 585 mkfontscale \
589 -a ${ROOT}/usr/share/fonts/encodings/encodings.dir \ 586 -a "${ROOT}"/usr/share/fonts/encodings/encodings.dir \
590 -- ${x} 587 -- ${x}
591 fi 588 fi
592 done 589 done
593 eend 0 590 eend 0
594} 591}
604 [[ -z "$(ls ${x}/)" ]] && continue 601 [[ -z "$(ls ${x}/)" ]] && continue
605 [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue 602 [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue
606 603
607 if [[ "${x/encodings}" = "${x}" ]]; then 604 if [[ "${x/encodings}" = "${x}" ]]; then
608 mkfontdir \ 605 mkfontdir \
609 -e ${ROOT}/usr/share/fonts/encodings \ 606 -e "${ROOT}"/usr/share/fonts/encodings \
610 -e ${ROOT}/usr/share/fonts/encodings/large \ 607 -e "${ROOT}"/usr/share/fonts/encodings/large \
611 -- ${x} 608 -- ${x}
612 fi 609 fi
613 done 610 done
614 eend 0 611 eend 0
615} 612}
616 613
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 614# @FUNCTION: create_font_cache
631# @USAGE: 615# @USAGE:
632# @DESCRIPTION: 616# @DESCRIPTION:
633# Create fonts.cache-1 files, used by the new client-side fonts 617# Create fonts.cache-1 files, used by the new client-side fonts
634# subsystem. 618# subsystem.
635create_font_cache() { 619create_font_cache() {
636 font_pkg_postinst 620 font_pkg_postinst
637} 621}
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.121

  ViewVC Help
Powered by ViewVC 1.1.20