/[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.118 Revision 1.125
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2012 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.118 2009/12/09 10:21:49 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.125 2012/05/02 18:31:45 jdhore 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>
12# x11@gentoo.org
8# @BLURB: Reduces code duplication in the modularized X11 ebuilds. 13# @BLURB: Reduces code duplication in the modularized X11 ebuilds.
9# @DESCRIPTION: 14# @DESCRIPTION:
10# This eclass makes trivial X ebuilds possible for apps, fonts, drivers, 15# This eclass makes trivial X ebuilds possible for apps, fonts, drivers,
11# and more. Many things that would normally be done in various functions 16# and more. Many things that would normally be done in various functions
12# can be accessed by setting variables instead, such as patching, 17# can be accessed by setting variables instead, such as patching,
172 DEBUGGABLE="yes" 177 DEBUGGABLE="yes"
173 IUSE="${IUSE} debug" 178 IUSE="${IUSE} debug"
174fi 179fi
175 180
176DEPEND="${DEPEND} 181DEPEND="${DEPEND}
177 >=dev-util/pkgconfig-0.18" 182 virtual/pkgconfig"
178 183
179if [[ "${PN/util-macros}" = "${PN}" ]]; then 184if [[ "${PN/util-macros}" = "${PN}" ]]; then
180 DEPEND="${DEPEND} 185 DEPEND="${DEPEND}
181 >=x11-misc/util-macros-1.3.0 186 >=x11-misc/util-macros-1.3.0"
182 sys-devel/binutils"
183fi 187fi
184 188
185RDEPEND="${RDEPEND} 189RDEPEND="${RDEPEND}
186 !<=x11-base/xorg-x11-6.9" 190 !<=x11-base/xorg-x11-6.9"
187# Provides virtual/x11 for temporary use until packages are ported 191# Provides virtual/x11 for temporary use until packages are ported
496# @DESCRIPTION: 500# @DESCRIPTION:
497# 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
498# task right now is some cleanup for font packages. 502# task right now is some cleanup for font packages.
499x-modular_pkg_postrm() { 503x-modular_pkg_postrm() {
500 if [[ -n "${FONT}" ]]; then 504 if [[ -n "${FONT}" ]]; then
501 cleanup_fonts
502 font_pkg_postrm 505 font_pkg_postrm
503 fi 506 fi
504}
505
506# @FUNCTION: cleanup_fonts
507# @USAGE:
508# @DESCRIPTION:
509# Get rid of font directories that only contain generated files
510cleanup_fonts() {
511 local ALLOWED_FILES="encodings.dir fonts.alias fonts.cache-1 fonts.dir fonts.scale"
512 for DIR in ${FONT_DIR}; do
513 unset KEEP_FONTDIR
514 REAL_DIR=${ROOT}usr/share/fonts/${DIR}
515
516 ebegin "Checking ${REAL_DIR} for useless files"
517 pushd ${REAL_DIR} &> /dev/null
518 for FILE in *; do
519 unset MATCH
520 for ALLOWED_FILE in ${ALLOWED_FILES}; do
521 if [[ ${FILE} = ${ALLOWED_FILE} ]]; then
522 # If it's allowed, then move on to the next file
523 MATCH="yes"
524 break
525 fi
526 done
527 # If we found a match in allowed files, move on to the next file
528 if [[ -n ${MATCH} ]]; then
529 continue
530 fi
531 # If we get this far, there wasn't a match in the allowed files
532 KEEP_FONTDIR="yes"
533 # We don't need to check more files if we're already keeping it
534 break
535 done
536 popd &> /dev/null
537 # If there are no files worth keeping, then get rid of the dir
538 if [[ -z "${KEEP_FONTDIR}" ]]; then
539 rm -rf ${REAL_DIR}
540 fi
541 eend 0
542 done
543} 507}
544 508
545# @FUNCTION: setup_fonts 509# @FUNCTION: setup_fonts
546# @USAGE: 510# @USAGE:
547# @DESCRIPTION: 511# @DESCRIPTION:
576} 540}
577 541
578# @FUNCTION: install_driver_hwdata 542# @FUNCTION: install_driver_hwdata
579# @USAGE: 543# @USAGE:
580# @DESCRIPTION: 544# @DESCRIPTION:
581# Installs device-to-driver mappings for system-config-display and 545# Installs device-to-driver mappings for system-config-display and
582# anything else that uses hwdata. 546# anything else that uses hwdata.
583install_driver_hwdata() { 547install_driver_hwdata() {
584 insinto /usr/share/hwdata/videoaliases 548 insinto /usr/share/hwdata/videoaliases
585 for i in "${FILESDIR}"/*.xinf; do 549 for i in "${FILESDIR}"/*.xinf; do
586 # We need this for the case when none exist, 550 # We need this for the case when none exist,

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

  ViewVC Help
Powered by ViewVC 1.1.20