| 1 | # Copyright 1999-2010 Gentoo Foundation |
1 | # Copyright 1999-2011 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/xorg-2.eclass,v 1.45 2011/05/17 07:59:02 mgorny Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/xorg-2.eclass,v 1.51 2011/11/01 13:51:05 chithanh Exp $ |
| 4 | # |
4 | |
| 5 | # @ECLASS: xorg-2.eclass |
5 | # @ECLASS: xorg-2.eclass |
| 6 | # @MAINTAINER: |
6 | # @MAINTAINER: |
| 7 | # x11@gentoo.org |
7 | # x11@gentoo.org |
|
|
8 | # @AUTHOR: |
|
|
9 | # Author: Tomáš Chvátal <scarabeus@gentoo.org> |
|
|
10 | # Author: Donnie Berkholz <dberkholz@gentoo.org> |
| 8 | # @BLURB: Reduces code duplication in the modularized X11 ebuilds. |
11 | # @BLURB: Reduces code duplication in the modularized X11 ebuilds. |
| 9 | # @DESCRIPTION: |
12 | # @DESCRIPTION: |
| 10 | # This eclass makes trivial X ebuilds possible for apps, fonts, drivers, |
13 | # This eclass makes trivial X ebuilds possible for apps, fonts, drivers, |
| 11 | # and more. Many things that would normally be done in various functions |
14 | # and more. Many things that would normally be done in various functions |
| 12 | # can be accessed by setting variables instead, such as patching, |
15 | # can be accessed by setting variables instead, such as patching, |
| … | |
… | |
| 14 | # |
17 | # |
| 15 | # All you need to do in a basic ebuild is inherit this eclass and set |
18 | # All you need to do in a basic ebuild is inherit this eclass and set |
| 16 | # DESCRIPTION, KEYWORDS and RDEPEND/DEPEND. If your package is hosted |
19 | # DESCRIPTION, KEYWORDS and RDEPEND/DEPEND. If your package is hosted |
| 17 | # with the other X packages, you don't need to set SRC_URI. Pretty much |
20 | # with the other X packages, you don't need to set SRC_URI. Pretty much |
| 18 | # everything else should be automatic. |
21 | # everything else should be automatic. |
| 19 | |
|
|
| 20 | # Author: Tomáš Chvátal <scarabeus@gentoo.org> |
|
|
| 21 | # Author: Donnie Berkholz <dberkholz@gentoo.org> |
|
|
| 22 | |
22 | |
| 23 | GIT_ECLASS="" |
23 | GIT_ECLASS="" |
| 24 | if [[ ${PV} == *9999* ]]; then |
24 | if [[ ${PV} == *9999* ]]; then |
| 25 | GIT_ECLASS="git-2" |
25 | GIT_ECLASS="git-2" |
| 26 | XORG_EAUTORECONF="yes" |
26 | XORG_EAUTORECONF="yes" |
| … | |
… | |
| 107 | XORG_EAUTORECONF_ARCHES="x86-interix ppc-aix x86-winnt" |
107 | XORG_EAUTORECONF_ARCHES="x86-interix ppc-aix x86-winnt" |
| 108 | EAUTORECONF_DEPEND+=" |
108 | EAUTORECONF_DEPEND+=" |
| 109 | >=sys-devel/libtool-2.2.6a |
109 | >=sys-devel/libtool-2.2.6a |
| 110 | sys-devel/m4" |
110 | sys-devel/m4" |
| 111 | if [[ ${PN} != util-macros ]] ; then |
111 | if [[ ${PN} != util-macros ]] ; then |
| 112 | EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.13.0" |
112 | EAUTORECONF_DEPEND+=" >=x11-misc/util-macros-1.15.0" |
| 113 | # Required even by xorg-server |
113 | # Required even by xorg-server |
| 114 | [[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.2.0" |
114 | [[ ${PN} == "font-util" ]] || EAUTORECONF_DEPEND+=" >=media-fonts/font-util-1.2.0" |
| 115 | fi |
115 | fi |
| 116 | WANT_AUTOCONF="latest" |
116 | WANT_AUTOCONF="latest" |
| 117 | WANT_AUTOMAKE="latest" |
117 | WANT_AUTOMAKE="latest" |
| … | |
… | |
| 408 | # @DESCRIPTION: |
408 | # @DESCRIPTION: |
| 409 | # Array of an additional options to pass to configure. |
409 | # Array of an additional options to pass to configure. |
| 410 | # @DEFAULT_UNSET |
410 | # @DEFAULT_UNSET |
| 411 | if [[ $(declare -p XORG_CONFIGURE_OPTIONS 2>&-) != "declare -a"* ]]; then |
411 | if [[ $(declare -p XORG_CONFIGURE_OPTIONS 2>&-) != "declare -a"* ]]; then |
| 412 | # fallback to CONFIGURE_OPTIONS, deprecated. |
412 | # fallback to CONFIGURE_OPTIONS, deprecated. |
| 413 | [[ -n "${CONFIGURE_OPTIONS}" ]] && \ |
413 | if [[ -n "${CONFIGURE_OPTIONS}" ]]; then |
| 414 | ewarn "QA: CONFIGURE_OPTIONS are deprecated. Please migrate to XORG_CONFIGURE_OPTIONS to preserve namespace." |
414 | eqawarn "CONFIGURE_OPTIONS are deprecated. Please migrate to XORG_CONFIGURE_OPTIONS" |
|
|
415 | eqawarn "to preserve namespace." |
|
|
416 | fi |
|
|
417 | |
| 415 | local xorgconfadd=(${CONFIGURE_OPTIONS}) |
418 | local xorgconfadd=(${CONFIGURE_OPTIONS}) |
| 416 | else |
419 | else |
| 417 | local xorgconfadd=("${XORG_CONFIGURE_OPTIONS[@]}") |
420 | local xorgconfadd=("${XORG_CONFIGURE_OPTIONS[@]}") |
| 418 | fi |
421 | fi |
| 419 | |
422 | |
| … | |
… | |
| 473 | # Run X-specific post-installation tasks on the live filesystem. The |
476 | # Run X-specific post-installation tasks on the live filesystem. The |
| 474 | # only task right now is some setup for font packages. |
477 | # only task right now is some setup for font packages. |
| 475 | xorg-2_pkg_postinst() { |
478 | xorg-2_pkg_postinst() { |
| 476 | debug-print-function ${FUNCNAME} "$@" |
479 | debug-print-function ${FUNCNAME} "$@" |
| 477 | |
480 | |
| 478 | [[ -n ${FONT} ]] && setup_fonts "$@" |
481 | if [[ -n ${FONT} ]]; then |
|
|
482 | create_fonts_scale |
|
|
483 | create_fonts_dir |
|
|
484 | font_pkg_postinst "$@" |
|
|
485 | fi |
| 479 | } |
486 | } |
| 480 | |
487 | |
| 481 | # @FUNCTION: xorg-2_pkg_postrm |
488 | # @FUNCTION: xorg-2_pkg_postrm |
| 482 | # @DESCRIPTION: |
489 | # @DESCRIPTION: |
| 483 | # Run X-specific post-removal tasks on the live filesystem. The only |
490 | # Run X-specific post-removal tasks on the live filesystem. The only |
| 484 | # task right now is some cleanup for font packages. |
491 | # task right now is some cleanup for font packages. |
| 485 | xorg-2_pkg_postrm() { |
492 | xorg-2_pkg_postrm() { |
| 486 | debug-print-function ${FUNCNAME} "$@" |
493 | debug-print-function ${FUNCNAME} "$@" |
| 487 | |
494 | |
| 488 | [[ -n ${FONT} ]] && font_pkg_postrm "$@" |
495 | if [[ -n ${FONT} ]]; then |
| 489 | } |
496 | # if we're doing an upgrade, postinst will do |
| 490 | |
497 | if [[ ${EAPI} -lt 4 || -z ${REPLACED_BY_VERSION} ]]; then |
| 491 | # @FUNCTION: setup_fonts |
|
|
| 492 | # @DESCRIPTION: |
|
|
| 493 | # Generates needed files for fonts and fixes font permissions |
|
|
| 494 | setup_fonts() { |
|
|
| 495 | debug-print-function ${FUNCNAME} "$@" |
|
|
| 496 | |
|
|
| 497 | create_fonts_scale |
498 | create_fonts_scale |
| 498 | create_fonts_dir |
499 | create_fonts_dir |
| 499 | font_pkg_postinst |
500 | font_pkg_postrm "$@" |
|
|
501 | fi |
|
|
502 | fi |
| 500 | } |
503 | } |
| 501 | |
504 | |
| 502 | # @FUNCTION: remove_font_metadata |
505 | # @FUNCTION: remove_font_metadata |
| 503 | # @DESCRIPTION: |
506 | # @DESCRIPTION: |
| 504 | # Don't let the package install generated font files that may overlap |
507 | # Don't let the package install generated font files that may overlap |
| … | |
… | |
| 517 | # Create fonts.scale file, used by the old server-side fonts subsystem. |
520 | # Create fonts.scale file, used by the old server-side fonts subsystem. |
| 518 | create_fonts_scale() { |
521 | create_fonts_scale() { |
| 519 | debug-print-function ${FUNCNAME} "$@" |
522 | debug-print-function ${FUNCNAME} "$@" |
| 520 | |
523 | |
| 521 | if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then |
524 | if [[ ${FONT_DIR} != Speedo && ${FONT_DIR} != CID ]]; then |
| 522 | ebegin "Generating font.scale" |
525 | ebegin "Generating fonts.scale" |
| 523 | mkfontscale \ |
526 | mkfontscale \ |
| 524 | -a "${EROOT}/usr/share/fonts/encodings/encodings.dir" \ |
527 | -a "${EROOT}/usr/share/fonts/encodings/encodings.dir" \ |
| 525 | -- "${EROOT}/usr/share/fonts/${FONT_DIR}" |
528 | -- "${EROOT}/usr/share/fonts/${FONT_DIR}" |
| 526 | eend $? |
529 | eend $? |
| 527 | fi |
530 | fi |