/[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.99 Revision 1.108
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.99 2008/05/27 18:42:33 dberkholz Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.108 2009/03/06 21:00:00 dberkholz 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.
43 SRC_URI="" 43 SRC_URI=""
44fi 44fi
45 45
46# Set up SRC_URI for individual modular releases 46# Set up SRC_URI for individual modular releases
47BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual" 47BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual"
48if [[ -z ${MODULE} ]]; then
49# @ECLASS-VARIABLE: MODULE 48# @ECLASS-VARIABLE: MODULE
50# @DESCRIPTION: 49# @DESCRIPTION:
51# The subdirectory to download source from. Possible settings are app, 50# The subdirectory to download source from. Possible settings are app,
52# doc, data, util, driver, font, lib, proto, xserver. Set above the 51# doc, data, util, driver, font, lib, proto, xserver. Set above the
53# inherit to override the default autoconfigured module. 52# inherit to override the default autoconfigured module.
53if [[ -z ${MODULE} ]]; then
54 MODULE="" 54 MODULE=""
55 if [[ ${CATEGORY} = x11-apps ]] || [[ ${CATEGORY} = x11-wm ]]; then 55 case ${CATEGORY} in
56 MODULE="app" 56 app-doc) MODULE="doc" ;;
57 elif [[ ${CATEGORY} = app-doc ]]; then 57 media-fonts) MODULE="font" ;;
58 MODULE="doc" 58 x11-apps|x11-wm) MODULE="app" ;;
59 # x11-misc contains data and util, x11-themes contains data 59 x11-misc|x11-themes) MODULE="util" ;;
60 elif [[ ${CATEGORY} = x11-misc ]] || [[ ${CATEGORY} = x11-themes ]]; then 60 x11-drivers) MODULE="driver" ;;
61 if [[ ${PN} == xbitmaps || ${PN} == xcursor-themes || ${PN} == xkbdata ]]; then 61 x11-base) MODULE="xserver" ;;
62 MODULE="data" 62 x11-proto) MODULE="proto" ;;
63 else 63 x11-libs) MODULE="lib" ;;
64 MODULE="util" 64 esac
65 fi
66 elif [[ ${CATEGORY} = x11-drivers ]]; then
67 MODULE="driver"
68 elif [[ ${CATEGORY} = media-fonts ]]; then
69 MODULE="font"
70 elif [[ ${CATEGORY} = x11-libs ]]; then
71 MODULE="lib"
72 elif [[ ${CATEGORY} = x11-proto ]]; then
73 MODULE="proto"
74 elif [[ ${CATEGORY} = x11-base ]]; then
75 MODULE="xserver"
76 fi
77fi 65fi
78 66
79if [[ -n ${GIT_ECLASS} ]]; then 67if [[ -n ${GIT_ECLASS} ]]; then
80 EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}/${PN}" 68 EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}/${PN}"
81else 69else
202# @DESCRIPTION: 190# @DESCRIPTION:
203# Ensures the server supports DRI if building a driver with DRI support 191# Ensures the server supports DRI if building a driver with DRI support
204x-modular_dri_check() { 192x-modular_dri_check() {
205 # (#120057) Enabling DRI in drivers requires that the server was built with 193 # (#120057) Enabling DRI in drivers requires that the server was built with
206 # support for it 194 # support for it
195 # Starting with xorg-server 1.5.3, DRI support is always enabled unless
196 # USE=minimal is set (see bug #252084)
207 if [[ -n "${DRIVER}" ]]; then 197 if [[ -n "${DRIVER}" ]]; then
208 if has dri ${IUSE} && use dri; then 198 if has dri ${IUSE} && use dri; then
209 einfo "Checking for direct rendering capabilities ..." 199 einfo "Checking for direct rendering capabilities ..."
200 if has_version '>=x11-base/xorg-server-1.5.3'; then
201 if built_with_use x11-base/xorg-server minimal; then
202 die "You must build x11-base/xorg-server with USE=-minimal."
203 fi
204 else
210 if ! built_with_use x11-base/xorg-server dri; then 205 if ! built_with_use x11-base/xorg-server dri; then
211 die "You must build x11-base/xorg-server with USE=dri." 206 die "You must build x11-base/xorg-server with USE=dri."
207 fi
212 fi 208 fi
213 fi 209 fi
214 fi 210 fi
215} 211}
216 212
239 if [[ -n ${GIT_ECLASS} ]]; then 235 if [[ -n ${GIT_ECLASS} ]]; then
240 git_src_unpack 236 git_src_unpack
241 else 237 else
242 unpack ${A} 238 unpack ${A}
243 fi 239 fi
244 cd ${S} 240 cd "${S}"
245 241
246 if [[ -n ${FONT_OPTIONS} ]]; then 242 if [[ -n ${FONT_OPTIONS} ]]; then
247 einfo "Detected font directory: ${FONT_DIR}" 243 einfo "Detected font directory: ${FONT_DIR}"
248 fi 244 fi
249} 245}
387# Run make. 383# Run make.
388x-modular_src_make() { 384x-modular_src_make() {
389 emake || die "emake failed" 385 emake || die "emake failed"
390} 386}
391 387
392# @FUNCTION: x-modular_src_configure 388# @FUNCTION: x-modular_src_compile
393# @USAGE: 389# @USAGE:
394# @DESCRIPTION: 390# @DESCRIPTION:
395# Compile a package, performing all X-related tasks. 391# Compile a package, performing all X-related tasks.
396x-modular_src_compile() { 392x-modular_src_compile() {
397 x-modular_src_configure 393 x-modular_src_configure
403# @DESCRIPTION: 399# @DESCRIPTION:
404# Install a built package to ${D}, performing any necessary steps. 400# Install a built package to ${D}, performing any necessary steps.
405# Creates a ChangeLog from git if using live ebuilds. 401# Creates a ChangeLog from git if using live ebuilds.
406x-modular_src_install() { 402x-modular_src_install() {
407 # Install everything to ${XDIR} 403 # Install everything to ${XDIR}
404 if [[ ${CATEGORY} = x11-proto ]]; then
408 make \ 405 make \
406 ${PN/proto/}docdir=/usr/share/doc/${PF} \
409 DESTDIR="${D}" \ 407 DESTDIR="${D}" \
410 install 408 install \
409 || die
410 else
411 make \
412 DESTDIR="${D}" \
413 install \
414 || die
415 fi
411# Shouldn't be necessary in XDIR=/usr 416# Shouldn't be necessary in XDIR=/usr
412# einstall forces datadir, so we need to re-force it 417# einstall forces datadir, so we need to re-force it
413# datadir=${XDIR}/share \ 418# datadir=${XDIR}/share \
414# mandir=${XDIR}/share/man \ 419# mandir=${XDIR}/share/man \
415 420
418 git log ${GIT_TREE} > "${S}"/ChangeLog 423 git log ${GIT_TREE} > "${S}"/ChangeLog
419 popd 424 popd
420 fi 425 fi
421 426
422 if [[ -e ${S}/ChangeLog ]]; then 427 if [[ -e ${S}/ChangeLog ]]; then
423 dodoc ${S}/ChangeLog 428 dodoc "${S}"/ChangeLog
424 fi 429 fi
425# @VARIABLE: DOCS 430# @VARIABLE: DOCS
426# @DESCRIPTION: 431# @DESCRIPTION:
427# Any documentation to install 432# Any documentation to install
428 [[ -n ${DOCS} ]] && dodoc ${DOCS} 433 [[ -n ${DOCS} ]] && dodoc ${DOCS}
429 434
430 # Make sure docs get compressed
431 prepalldocs
432
433 # Don't install libtool archives for server modules 435 # Don't install libtool archives for server modules
434 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then 436 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then
435 find ${D}/usr/$(get_libdir)/xorg/modules -name '*.la' \ 437 find "${D}"/usr/$(get_libdir)/xorg/modules -name '*.la' \
436 | xargs rm -f 438 | xargs rm -f
437 fi 439 fi
438 440
439 if [[ -n "${FONT}" ]]; then 441 if [[ -n "${FONT}" ]]; then
440 remove_font_metadata 442 remove_font_metadata
543 for DIR in ${FONT_DIR}; do 545 for DIR in ${FONT_DIR}; do
544 if [[ "${DIR}" != "Speedo" ]] && \ 546 if [[ "${DIR}" != "Speedo" ]] && \
545 [[ "${DIR}" != "CID" ]] ; then 547 [[ "${DIR}" != "CID" ]] ; then
546 # Delete font metadata files 548 # Delete font metadata files
547 # fonts.scale, fonts.dir, fonts.cache-1 549 # fonts.scale, fonts.dir, fonts.cache-1
548 rm -f ${D}/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1} 550 rm -f "${D}"/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1}
549 fi 551 fi
550 done 552 done
551} 553}
552 554
553# @FUNCTION: install_driver_hwdata 555# @FUNCTION: install_driver_hwdata
592 # NOTE: There is no way to regenerate Speedo/CID fonts.scale 594 # NOTE: There is no way to regenerate Speedo/CID fonts.scale
593 # <dberkholz@gentoo.org> 2 August 2004 595 # <dberkholz@gentoo.org> 2 August 2004
594 if [[ "${x/encodings}" = "${x}" ]] \ 596 if [[ "${x/encodings}" = "${x}" ]] \
595 && [[ -n "$(find ${x} -iname '*.[pot][ft][abcf]' -print)" ]]; then 597 && [[ -n "$(find ${x} -iname '*.[pot][ft][abcf]' -print)" ]]; then
596 mkfontscale \ 598 mkfontscale \
597 -a ${ROOT}/usr/share/fonts/encodings/encodings.dir \ 599 -a "${ROOT}"/usr/share/fonts/encodings/encodings.dir \
598 -- ${x} 600 -- ${x}
599 fi 601 fi
600 done 602 done
601 eend 0 603 eend 0
602} 604}
612 [[ -z "$(ls ${x}/)" ]] && continue 614 [[ -z "$(ls ${x}/)" ]] && continue
613 [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue 615 [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue
614 616
615 if [[ "${x/encodings}" = "${x}" ]]; then 617 if [[ "${x/encodings}" = "${x}" ]]; then
616 mkfontdir \ 618 mkfontdir \
617 -e ${ROOT}/usr/share/fonts/encodings \ 619 -e "${ROOT}"/usr/share/fonts/encodings \
618 -e ${ROOT}/usr/share/fonts/encodings/large \ 620 -e "${ROOT}"/usr/share/fonts/encodings/large \
619 -- ${x} 621 -- ${x}
620 fi 622 fi
621 done 623 done
622 eend 0 624 eend 0
623} 625}
627# @DESCRIPTION: 629# @DESCRIPTION:
628# Font files should have 644 permissions. Ensure this is the case. 630# Font files should have 644 permissions. Ensure this is the case.
629fix_font_permissions() { 631fix_font_permissions() {
630 ebegin "Fixing permissions" 632 ebegin "Fixing permissions"
631 for DIR in ${FONT_DIR}; do 633 for DIR in ${FONT_DIR}; do
632 find ${ROOT}/usr/share/fonts/${DIR} -type f -name 'font.*' \ 634 find "${ROOT}"/usr/share/fonts/${DIR} -type f -name 'font.*' \
633 -exec chmod 0644 {} \; 635 -exec chmod 0644 {} \;
634 done 636 done
635 eend 0 637 eend 0
636} 638}
637 639

Legend:
Removed from v.1.99  
changed lines
  Added in v.1.108

  ViewVC Help
Powered by ViewVC 1.1.20