/[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.117 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.117 2009/11/28 10:25:37 scarabeus 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.
65XDIR="/usr" 69XDIR="/usr"
66 70
67IUSE="" 71IUSE=""
68HOMEPAGE="http://xorg.freedesktop.org/" 72HOMEPAGE="http://xorg.freedesktop.org/"
69 73
70if [[ -z ${SNAPSHOT} ]]; then
71# @ECLASS-VARIABLE: SNAPSHOT 74# @ECLASS-VARIABLE: SNAPSHOT
72# @DESCRIPTION: 75# @DESCRIPTION:
73# 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
74# before inheriting this eclass. 77# before inheriting this eclass.
75 SNAPSHOT="no" 78: ${SNAPSHOT:=no}
76fi
77 79
78# Set up SRC_URI for individual modular releases 80# Set up SRC_URI for individual modular releases
79BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual" 81BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual"
80# @ECLASS-VARIABLE: MODULE 82# @ECLASS-VARIABLE: MODULE
81# @DESCRIPTION: 83# @DESCRIPTION:
82# The subdirectory to download source from. Possible settings are app, 84# The subdirectory to download source from. Possible settings are app,
83# doc, data, util, driver, font, lib, proto, xserver. Set above the 85# doc, data, util, driver, font, lib, proto, xserver. Set above the
84# inherit to override the default autoconfigured module. 86# inherit to override the default autoconfigured module.
85if [[ -z ${MODULE} ]]; then 87if [[ -z ${MODULE} ]]; then
86 MODULE=""
87 case ${CATEGORY} in 88 case ${CATEGORY} in
88 app-doc) MODULE="doc" ;; 89 app-doc) MODULE="doc" ;;
89 media-fonts) MODULE="font" ;; 90 media-fonts) MODULE="font" ;;
90 x11-apps|x11-wm) MODULE="app" ;; 91 x11-apps|x11-wm) MODULE="app" ;;
91 x11-misc|x11-themes) MODULE="util" ;; 92 x11-misc|x11-themes) MODULE="util" ;;
128 media-fonts/font-alias" 129 media-fonts/font-alias"
129 130
130 # Starting with 7.0RC3, we can specify the font directory 131 # Starting with 7.0RC3, we can specify the font directory
131 # 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
132 133
133 # Wrap in `if` so ebuilds can set it too
134 if [[ -z ${FONT_DIR} ]]; then
135# @ECLASS-VARIABLE: FONT_DIR 134# @ECLASS-VARIABLE: FONT_DIR
136# @DESCRIPTION: 135# @DESCRIPTION:
137# 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
138# the subdirectory of /usr/share/fonts/ it should install into, set 137# the subdirectory of /usr/share/fonts/ it should install into, set
139# FONT_DIR to that directory or directories. Set before inheriting this 138# FONT_DIR to that directory or directories. Set before inheriting this
140# eclass. 139# eclass.
141 FONT_DIR=${PN##*-} 140 : ${FONT_DIR:=${PN##*-}}
142
143 fi
144 141
145 # Fix case of font directories 142 # Fix case of font directories
146 FONT_DIR=${FONT_DIR/ttf/TTF} 143 FONT_DIR=${FONT_DIR/ttf/TTF}
147 FONT_DIR=${FONT_DIR/otf/OTF} 144 FONT_DIR=${FONT_DIR/otf/OTF}
148 FONT_DIR=${FONT_DIR/type1/Type1} 145 FONT_DIR=${FONT_DIR/type1/Type1}
393 x-modular_font_configure 390 x-modular_font_configure
394 x-modular_debug_setup 391 x-modular_debug_setup
395 392
396# @VARIABLE: CONFIGURE_OPTIONS 393# @VARIABLE: CONFIGURE_OPTIONS
397# @DESCRIPTION: 394# @DESCRIPTION:
398# Any options to pass to configure 395# Any extra options to pass to configure
399[[ -n ${CONFIGURE_OPTIONS} ]]
400 396
401 # If prefix isn't set here, .pc files cause problems 397 # If prefix isn't set here, .pc files cause problems
402 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then 398 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
403 econf --prefix=${XDIR} \ 399 econf --prefix=${XDIR} \
404 --datadir=${XDIR}/share \ 400 --datadir=${XDIR}/share \
459 if [[ -e ${S}/ChangeLog ]]; then 455 if [[ -e ${S}/ChangeLog ]]; then
460 dodoc "${S}"/ChangeLog 456 dodoc "${S}"/ChangeLog
461 fi 457 fi
462# @VARIABLE: DOCS 458# @VARIABLE: DOCS
463# @DESCRIPTION: 459# @DESCRIPTION:
464# Any documentation to install 460# Any documentation to install via dodoc
465 [[ -n ${DOCS} ]] && dodoc ${DOCS} 461 [[ -n ${DOCS} ]] && dodoc ${DOCS}
466 462
467 # Don't install libtool archives for server modules 463 # Don't install libtool archives for server modules
468 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then 464 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then
469 find "${D}"/usr/$(get_libdir)/xorg/modules -name '*.la' \ 465 find "${D}"/usr/$(get_libdir)/xorg/modules -name '*.la' \
504# @DESCRIPTION: 500# @DESCRIPTION:
505# 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
506# task right now is some cleanup for font packages. 502# task right now is some cleanup for font packages.
507x-modular_pkg_postrm() { 503x-modular_pkg_postrm() {
508 if [[ -n "${FONT}" ]]; then 504 if [[ -n "${FONT}" ]]; then
509 cleanup_fonts
510 font_pkg_postrm 505 font_pkg_postrm
511 fi 506 fi
512}
513
514# @FUNCTION: cleanup_fonts
515# @USAGE:
516# @DESCRIPTION:
517# Get rid of font directories that only contain generated files
518cleanup_fonts() {
519 local ALLOWED_FILES="encodings.dir fonts.alias fonts.cache-1 fonts.dir fonts.scale"
520 for DIR in ${FONT_DIR}; do
521 unset KEEP_FONTDIR
522 REAL_DIR=${ROOT}usr/share/fonts/${DIR}
523
524 ebegin "Checking ${REAL_DIR} for useless files"
525 pushd ${REAL_DIR} &> /dev/null
526 for FILE in *; do
527 unset MATCH
528 for ALLOWED_FILE in ${ALLOWED_FILES}; do
529 if [[ ${FILE} = ${ALLOWED_FILE} ]]; then
530 # If it's allowed, then move on to the next file
531 MATCH="yes"
532 break
533 fi
534 done
535 # If we found a match in allowed files, move on to the next file
536 if [[ -n ${MATCH} ]]; then
537 continue
538 fi
539 # If we get this far, there wasn't a match in the allowed files
540 KEEP_FONTDIR="yes"
541 # We don't need to check more files if we're already keeping it
542 break
543 done
544 popd &> /dev/null
545 # If there are no files worth keeping, then get rid of the dir
546 if [[ -z "${KEEP_FONTDIR}" ]]; then
547 rm -rf ${REAL_DIR}
548 fi
549 eend 0
550 done
551} 507}
552 508
553# @FUNCTION: setup_fonts 509# @FUNCTION: setup_fonts
554# @USAGE: 510# @USAGE:
555# @DESCRIPTION: 511# @DESCRIPTION:
584} 540}
585 541
586# @FUNCTION: install_driver_hwdata 542# @FUNCTION: install_driver_hwdata
587# @USAGE: 543# @USAGE:
588# @DESCRIPTION: 544# @DESCRIPTION:
589# Installs device-to-driver mappings for system-config-display and 545# Installs device-to-driver mappings for system-config-display and
590# anything else that uses hwdata. 546# anything else that uses hwdata.
591install_driver_hwdata() { 547install_driver_hwdata() {
592 insinto /usr/share/hwdata/videoaliases 548 insinto /usr/share/hwdata/videoaliases
593 for i in "${FILESDIR}"/*.xinf; do 549 for i in "${FILESDIR}"/*.xinf; do
594 # We need this for the case when none exist, 550 # We need this for the case when none exist,

Legend:
Removed from v.1.117  
changed lines
  Added in v.1.121

  ViewVC Help
Powered by ViewVC 1.1.20