/[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.109 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.109 2009/05/14 12:40:55 remi 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.
65XDIR="/usr" 65XDIR="/usr"
66 66
67IUSE="" 67IUSE=""
68HOMEPAGE="http://xorg.freedesktop.org/" 68HOMEPAGE="http://xorg.freedesktop.org/"
69 69
70if [[ -z ${SNAPSHOT} ]]; then
71# @ECLASS-VARIABLE: SNAPSHOT 70# @ECLASS-VARIABLE: SNAPSHOT
72# @DESCRIPTION: 71# @DESCRIPTION:
73# 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
74# before inheriting this eclass. 73# before inheriting this eclass.
75 SNAPSHOT="no" 74: ${SNAPSHOT:=no}
76fi
77 75
78# Set up SRC_URI for individual modular releases 76# Set up SRC_URI for individual modular releases
79BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual" 77BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual"
80# @ECLASS-VARIABLE: MODULE 78# @ECLASS-VARIABLE: MODULE
81# @DESCRIPTION: 79# @DESCRIPTION:
82# The subdirectory to download source from. Possible settings are app, 80# The subdirectory to download source from. Possible settings are app,
83# doc, data, util, driver, font, lib, proto, xserver. Set above the 81# doc, data, util, driver, font, lib, proto, xserver. Set above the
84# inherit to override the default autoconfigured module. 82# inherit to override the default autoconfigured module.
85if [[ -z ${MODULE} ]]; then 83if [[ -z ${MODULE} ]]; then
86 MODULE=""
87 case ${CATEGORY} in 84 case ${CATEGORY} in
88 app-doc) MODULE="doc" ;; 85 app-doc) MODULE="doc" ;;
89 media-fonts) MODULE="font" ;; 86 media-fonts) MODULE="font" ;;
90 x11-apps|x11-wm) MODULE="app" ;; 87 x11-apps|x11-wm) MODULE="app" ;;
91 x11-misc|x11-themes) MODULE="util" ;; 88 x11-misc|x11-themes) MODULE="util" ;;
103fi 100fi
104 101
105SLOT="0" 102SLOT="0"
106 103
107# 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
108# LICENSE after the inherit. 105# LICENSE after the inherit. Nearly all FreeDesktop-hosted X packages
109LICENSE=${PN} 106# are under the MIT license. (This is what Red Hat does in their rpms)
107LICENSE="MIT"
110 108
111# Set up shared dependencies 109# Set up shared dependencies
112if [[ -n "${SNAPSHOT}" ]]; then 110if [[ -n "${SNAPSHOT}" ]]; then
113# FIXME: What's the minimal libtool version supporting arbitrary versioning? 111# FIXME: What's the minimal libtool version supporting arbitrary versioning?
114 DEPEND="${DEPEND} 112 DEPEND="${DEPEND}
127 media-fonts/font-alias" 125 media-fonts/font-alias"
128 126
129 # Starting with 7.0RC3, we can specify the font directory 127 # Starting with 7.0RC3, we can specify the font directory
130 # 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
131 129
132 # Wrap in `if` so ebuilds can set it too
133 if [[ -z ${FONT_DIR} ]]; then
134# @ECLASS-VARIABLE: FONT_DIR 130# @ECLASS-VARIABLE: FONT_DIR
135# @DESCRIPTION: 131# @DESCRIPTION:
136# 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
137# the subdirectory of /usr/share/fonts/ it should install into, set 133# the subdirectory of /usr/share/fonts/ it should install into, set
138# FONT_DIR to that directory or directories. Set before inheriting this 134# FONT_DIR to that directory or directories. Set before inheriting this
139# eclass. 135# eclass.
140 FONT_DIR=${PN##*-} 136 : ${FONT_DIR:=${PN##*-}}
141
142 fi
143 137
144 # Fix case of font directories 138 # Fix case of font directories
145 FONT_DIR=${FONT_DIR/ttf/TTF} 139 FONT_DIR=${FONT_DIR/ttf/TTF}
146 FONT_DIR=${FONT_DIR/otf/OTF} 140 FONT_DIR=${FONT_DIR/otf/OTF}
147 FONT_DIR=${FONT_DIR/type1/Type1} 141 FONT_DIR=${FONT_DIR/type1/Type1}
148 FONT_DIR=${FONT_DIR/speedo/Speedo} 142 FONT_DIR=${FONT_DIR/speedo/Speedo}
149 143
150 # Set up configure option 144 # Set up configure options, wrapped so ebuilds can override if need be
145 if [[ -z ${FONT_OPTIONS} ]]; then
151 FONT_OPTIONS="--with-fontdir=\"/usr/share/fonts/${FONT_DIR}\"" 146 FONT_OPTIONS="--with-fontdir=\"/usr/share/fonts/${FONT_DIR}\""
147 fi
152 148
153 if [[ -n "${FONT}" ]]; then 149 if [[ -n "${FONT}" ]]; then
154 if [[ ${PN##*-} = misc ]] || [[ ${PN##*-} = 75dpi ]] || [[ ${PN##*-} = 100dpi ]] || [[ ${PN##*-} = cyrillic ]]; then 150 if [[ ${PN##*-} = misc ]] || [[ ${PN##*-} = 75dpi ]] || [[ ${PN##*-} = 100dpi ]] || [[ ${PN##*-} = cyrillic ]]; then
155 IUSE="${IUSE} nls" 151 IUSE="${IUSE} nls"
156 fi 152 fi
180DEPEND="${DEPEND} 176DEPEND="${DEPEND}
181 >=dev-util/pkgconfig-0.18" 177 >=dev-util/pkgconfig-0.18"
182 178
183if [[ "${PN/util-macros}" = "${PN}" ]]; then 179if [[ "${PN/util-macros}" = "${PN}" ]]; then
184 DEPEND="${DEPEND} 180 DEPEND="${DEPEND}
185 >=x11-misc/util-macros-0.99.2 181 >=x11-misc/util-macros-1.3.0
186 >=sys-devel/binutils-2.16.1-r3" 182 sys-devel/binutils"
187fi 183fi
188 184
189RDEPEND="${RDEPEND} 185RDEPEND="${RDEPEND}
190 !<=x11-base/xorg-x11-6.9" 186 !<=x11-base/xorg-x11-6.9"
191# Provides virtual/x11 for temporary use until packages are ported 187# Provides virtual/x11 for temporary use until packages are ported
344# If a font package, perform any necessary configuration steps 340# If a font package, perform any necessary configuration steps
345x-modular_font_configure() { 341x-modular_font_configure() {
346 if [[ -n "${FONT}" ]]; then 342 if [[ -n "${FONT}" ]]; then
347 # Might be worth adding an option to configure your desired font 343 # Might be worth adding an option to configure your desired font
348 # 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?
349 if ! use nls; then 345 if has nls ${IUSE//+} && ! use nls; then
350 FONT_OPTIONS="${FONT_OPTIONS} 346 FONT_OPTIONS="${FONT_OPTIONS}
351 --disable-iso8859-2 347 --disable-iso8859-2
352 --disable-iso8859-3 348 --disable-iso8859-3
353 --disable-iso8859-4 349 --disable-iso8859-4
354 --disable-iso8859-5 350 --disable-iso8859-5
390 x-modular_font_configure 386 x-modular_font_configure
391 x-modular_debug_setup 387 x-modular_debug_setup
392 388
393# @VARIABLE: CONFIGURE_OPTIONS 389# @VARIABLE: CONFIGURE_OPTIONS
394# @DESCRIPTION: 390# @DESCRIPTION:
395# Any options to pass to configure 391# Any extra options to pass to configure
396[[ -n ${CONFIGURE_OPTIONS} ]]
397 392
398 # If prefix isn't set here, .pc files cause problems 393 # If prefix isn't set here, .pc files cause problems
399 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then 394 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
400 econf --prefix=${XDIR} \ 395 econf --prefix=${XDIR} \
401 --datadir=${XDIR}/share \ 396 --datadir=${XDIR}/share \
435 DESTDIR="${D}" \ 430 DESTDIR="${D}" \
436 install \ 431 install \
437 || die 432 || die
438 else 433 else
439 make \ 434 make \
435 docdir=/usr/share/doc/${PF} \
440 DESTDIR="${D}" \ 436 DESTDIR="${D}" \
441 install \ 437 install \
442 || die 438 || die
443 fi 439 fi
444# Shouldn't be necessary in XDIR=/usr 440# Shouldn't be necessary in XDIR=/usr
455 if [[ -e ${S}/ChangeLog ]]; then 451 if [[ -e ${S}/ChangeLog ]]; then
456 dodoc "${S}"/ChangeLog 452 dodoc "${S}"/ChangeLog
457 fi 453 fi
458# @VARIABLE: DOCS 454# @VARIABLE: DOCS
459# @DESCRIPTION: 455# @DESCRIPTION:
460# Any documentation to install 456# Any documentation to install via dodoc
461 [[ -n ${DOCS} ]] && dodoc ${DOCS} 457 [[ -n ${DOCS} ]] && dodoc ${DOCS}
462 458
463 # Don't install libtool archives for server modules 459 # Don't install libtool archives for server modules
464 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then 460 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then
465 find "${D}"/usr/$(get_libdir)/xorg/modules -name '*.la' \ 461 find "${D}"/usr/$(get_libdir)/xorg/modules -name '*.la' \
510# @FUNCTION: cleanup_fonts 506# @FUNCTION: cleanup_fonts
511# @USAGE: 507# @USAGE:
512# @DESCRIPTION: 508# @DESCRIPTION:
513# Get rid of font directories that only contain generated files 509# Get rid of font directories that only contain generated files
514cleanup_fonts() { 510cleanup_fonts() {
515 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"
516 for DIR in ${FONT_DIR}; do 512 for DIR in ${FONT_DIR}; do
517 unset KEEP_FONTDIR 513 unset KEEP_FONTDIR
518 REAL_DIR=${ROOT}usr/share/fonts/${DIR} 514 REAL_DIR=${ROOT}usr/share/fonts/${DIR}
519 515
520 ebegin "Checking ${REAL_DIR} for useless files" 516 ebegin "Checking ${REAL_DIR} for useless files"
557 die "${msg}" 553 die "${msg}"
558 fi 554 fi
559 555
560 create_fonts_scale 556 create_fonts_scale
561 create_fonts_dir 557 create_fonts_dir
562 fix_font_permissions
563 create_font_cache 558 create_font_cache
564} 559}
565 560
566# @FUNCTION: remove_font_metadata 561# @FUNCTION: remove_font_metadata
567# @USAGE: 562# @USAGE:
650 fi 645 fi
651 done 646 done
652 eend 0 647 eend 0
653} 648}
654 649
655# @FUNCTION: fix_font_permissions
656# @USAGE:
657# @DESCRIPTION:
658# Font files should have 644 permissions. Ensure this is the case.
659fix_font_permissions() {
660 ebegin "Fixing permissions"
661 for DIR in ${FONT_DIR}; do
662 find "${ROOT}"/usr/share/fonts/${DIR} -type f -name 'font.*' \
663 -exec chmod 0644 {} \;
664 done
665 eend 0
666}
667
668# @FUNCTION: create_font_cache 650# @FUNCTION: create_font_cache
669# @USAGE: 651# @USAGE:
670# @DESCRIPTION: 652# @DESCRIPTION:
671# 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
672# subsystem. 654# subsystem.

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

  ViewVC Help
Powered by ViewVC 1.1.20