/[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.105
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.105 2009/02/18 18:40:52 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 [[ ${CATEGORY} = x11-apps ]] || [[ ${CATEGORY} = x11-wm ]]; then 48# @ECLASS-VARIABLE: MODULE
49# @DESCRIPTION:
50# The subdirectory to download source from. Possible settings are app,
51# doc, data, util, driver, font, lib, proto, xserver. Set above the
52# inherit to override the default autoconfigured module.
53if [[ -z ${MODULE} ]]; then
49 MODULE="app" 54 MODULE=""
50elif [[ ${CATEGORY} = app-doc ]]; then 55 case ${CATEGORY} in
51 MODULE="doc" 56 app-doc) MODULE="doc" ;;
52# x11-misc contains data and util, x11-themes contains data 57 media-fonts) MODULE="font" ;;
53elif [[ ${CATEGORY} = x11-misc ]] || [[ ${CATEGORY} = x11-themes ]]; then 58 x11-apps|x11-wm) MODULE="app" ;;
54 if [[ ${PN} == xbitmaps || ${PN} == xcursor-themes || ${PN} == xkbdata ]]; then 59 x11-misc|x11-themes) MODULE="util" ;;
55 MODULE="data" 60 x11-drivers) MODULE="driver" ;;
56 else 61 x11-base) MODULE="xserver" ;;
57 MODULE="util" 62 x11-proto) MODULE="proto" ;;
58 fi 63 x11-libs) MODULE="lib" ;;
59elif [[ ${CATEGORY} = x11-drivers ]]; then 64 esac
60 MODULE="driver"
61elif [[ ${CATEGORY} = media-fonts ]]; then
62 MODULE="font"
63elif [[ ${CATEGORY} = x11-libs ]]; then
64 MODULE="lib"
65elif [[ ${CATEGORY} = x11-proto ]]; then
66 MODULE="proto"
67elif [[ ${CATEGORY} = x11-base ]]; then
68 MODULE="xserver"
69fi 65fi
70 66
71if [[ -n ${GIT_ECLASS} ]]; then 67if [[ -n ${GIT_ECLASS} ]]; then
72 EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}/${PN}" 68 EGIT_REPO_URI="git://anongit.freedesktop.org/git/xorg/${MODULE}/${PN}"
73else 69else
197 # (#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
198 # support for it 194 # support for it
199 if [[ -n "${DRIVER}" ]]; then 195 if [[ -n "${DRIVER}" ]]; then
200 if has dri ${IUSE} && use dri; then 196 if has dri ${IUSE} && use dri; then
201 einfo "Checking for direct rendering capabilities ..." 197 einfo "Checking for direct rendering capabilities ..."
202 if ! built_with_use x11-base/xorg-server dri; then 198 if ! built_with_use --missing true x11-base/xorg-server dri; then
203 die "You must build x11-base/xorg-server with USE=dri." 199 die "You must build x11-base/xorg-server with USE=dri."
204 fi 200 fi
205 fi 201 fi
206 fi 202 fi
207} 203}
231 if [[ -n ${GIT_ECLASS} ]]; then 227 if [[ -n ${GIT_ECLASS} ]]; then
232 git_src_unpack 228 git_src_unpack
233 else 229 else
234 unpack ${A} 230 unpack ${A}
235 fi 231 fi
236 cd ${S} 232 cd "${S}"
237 233
238 if [[ -n ${FONT_OPTIONS} ]]; then 234 if [[ -n ${FONT_OPTIONS} ]]; then
239 einfo "Detected font directory: ${FONT_DIR}" 235 einfo "Detected font directory: ${FONT_DIR}"
240 fi 236 fi
241} 237}
359 x-modular_debug_setup 355 x-modular_debug_setup
360 356
361# @VARIABLE: CONFIGURE_OPTIONS 357# @VARIABLE: CONFIGURE_OPTIONS
362# @DESCRIPTION: 358# @DESCRIPTION:
363# Any options to pass to configure 359# Any options to pass to configure
364[[ -n ${CONFIGURE_OPTIONTS} ]] 360[[ -n ${CONFIGURE_OPTIONS} ]]
365 361
366 # If prefix isn't set here, .pc files cause problems 362 # If prefix isn't set here, .pc files cause problems
367 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then 363 if [[ -x ${ECONF_SOURCE:-.}/configure ]]; then
368 econf --prefix=${XDIR} \ 364 econf --prefix=${XDIR} \
369 --datadir=${XDIR}/share \ 365 --datadir=${XDIR}/share \
397# Creates a ChangeLog from git if using live ebuilds. 393# Creates a ChangeLog from git if using live ebuilds.
398x-modular_src_install() { 394x-modular_src_install() {
399 # Install everything to ${XDIR} 395 # Install everything to ${XDIR}
400 make \ 396 make \
401 DESTDIR="${D}" \ 397 DESTDIR="${D}" \
402 install 398 install \
399 || die
403# Shouldn't be necessary in XDIR=/usr 400# Shouldn't be necessary in XDIR=/usr
404# einstall forces datadir, so we need to re-force it 401# einstall forces datadir, so we need to re-force it
405# datadir=${XDIR}/share \ 402# datadir=${XDIR}/share \
406# mandir=${XDIR}/share/man \ 403# mandir=${XDIR}/share/man \
407 404
410 git log ${GIT_TREE} > "${S}"/ChangeLog 407 git log ${GIT_TREE} > "${S}"/ChangeLog
411 popd 408 popd
412 fi 409 fi
413 410
414 if [[ -e ${S}/ChangeLog ]]; then 411 if [[ -e ${S}/ChangeLog ]]; then
415 dodoc ${S}/ChangeLog 412 dodoc "${S}"/ChangeLog
416 fi 413 fi
417# @VARIABLE: DOCS 414# @VARIABLE: DOCS
418# @DESCRIPTION: 415# @DESCRIPTION:
419# Any documentation to install 416# Any documentation to install
420 [[ -n ${DOCS} ]] && dodoc ${DOCS} 417 [[ -n ${DOCS} ]] && dodoc ${DOCS}
421 418
422 # Make sure docs get compressed
423 prepalldocs
424
425 # Don't install libtool archives for server modules 419 # Don't install libtool archives for server modules
426 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then 420 if [[ -e ${D}/usr/$(get_libdir)/xorg/modules ]]; then
427 find ${D}/usr/$(get_libdir)/xorg/modules -name '*.la' \ 421 find "${D}"/usr/$(get_libdir)/xorg/modules -name '*.la' \
428 | xargs rm -f 422 | xargs rm -f
429 fi 423 fi
430 424
431 if [[ -n "${FONT}" ]]; then 425 if [[ -n "${FONT}" ]]; then
432 remove_font_metadata 426 remove_font_metadata
535 for DIR in ${FONT_DIR}; do 529 for DIR in ${FONT_DIR}; do
536 if [[ "${DIR}" != "Speedo" ]] && \ 530 if [[ "${DIR}" != "Speedo" ]] && \
537 [[ "${DIR}" != "CID" ]] ; then 531 [[ "${DIR}" != "CID" ]] ; then
538 # Delete font metadata files 532 # Delete font metadata files
539 # fonts.scale, fonts.dir, fonts.cache-1 533 # fonts.scale, fonts.dir, fonts.cache-1
540 rm -f ${D}/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1} 534 rm -f "${D}"/usr/share/fonts/${DIR}/fonts.{scale,dir,cache-1}
541 fi 535 fi
542 done 536 done
543} 537}
544 538
545# @FUNCTION: install_driver_hwdata 539# @FUNCTION: install_driver_hwdata
584 # NOTE: There is no way to regenerate Speedo/CID fonts.scale 578 # NOTE: There is no way to regenerate Speedo/CID fonts.scale
585 # <dberkholz@gentoo.org> 2 August 2004 579 # <dberkholz@gentoo.org> 2 August 2004
586 if [[ "${x/encodings}" = "${x}" ]] \ 580 if [[ "${x/encodings}" = "${x}" ]] \
587 && [[ -n "$(find ${x} -iname '*.[pot][ft][abcf]' -print)" ]]; then 581 && [[ -n "$(find ${x} -iname '*.[pot][ft][abcf]' -print)" ]]; then
588 mkfontscale \ 582 mkfontscale \
589 -a ${ROOT}/usr/share/fonts/encodings/encodings.dir \ 583 -a "${ROOT}"/usr/share/fonts/encodings/encodings.dir \
590 -- ${x} 584 -- ${x}
591 fi 585 fi
592 done 586 done
593 eend 0 587 eend 0
594} 588}
604 [[ -z "$(ls ${x}/)" ]] && continue 598 [[ -z "$(ls ${x}/)" ]] && continue
605 [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue 599 [[ "$(ls ${x}/)" = "fonts.cache-1" ]] && continue
606 600
607 if [[ "${x/encodings}" = "${x}" ]]; then 601 if [[ "${x/encodings}" = "${x}" ]]; then
608 mkfontdir \ 602 mkfontdir \
609 -e ${ROOT}/usr/share/fonts/encodings \ 603 -e "${ROOT}"/usr/share/fonts/encodings \
610 -e ${ROOT}/usr/share/fonts/encodings/large \ 604 -e "${ROOT}"/usr/share/fonts/encodings/large \
611 -- ${x} 605 -- ${x}
612 fi 606 fi
613 done 607 done
614 eend 0 608 eend 0
615} 609}
619# @DESCRIPTION: 613# @DESCRIPTION:
620# Font files should have 644 permissions. Ensure this is the case. 614# Font files should have 644 permissions. Ensure this is the case.
621fix_font_permissions() { 615fix_font_permissions() {
622 ebegin "Fixing permissions" 616 ebegin "Fixing permissions"
623 for DIR in ${FONT_DIR}; do 617 for DIR in ${FONT_DIR}; do
624 find ${ROOT}/usr/share/fonts/${DIR} -type f -name 'font.*' \ 618 find "${ROOT}"/usr/share/fonts/${DIR} -type f -name 'font.*' \
625 -exec chmod 0644 {} \; 619 -exec chmod 0644 {} \;
626 done 620 done
627 eend 0 621 eend 0
628} 622}
629 623

Legend:
Removed from v.1.97  
changed lines
  Added in v.1.105

  ViewVC Help
Powered by ViewVC 1.1.20