diff options
author | Rémi Cardona <remi@gentoo.org> | 2009-05-14 12:40:55 +0000 |
---|---|---|
committer | Rémi Cardona <remi@gentoo.org> | 2009-05-14 12:40:55 +0000 |
commit | 946c58e51454b51ff77202a1b1e12f667277da5c (patch) | |
tree | ae7524f1f5df7f602336347f29f7667c3204ec77 /eclass/x-modular.eclass | |
parent | Fix stripping issue per bug #257297. Again big thanks to Victor Ostroga. (diff) | |
download | gentoo-2-946c58e51454b51ff77202a1b1e12f667277da5c.tar.gz gentoo-2-946c58e51454b51ff77202a1b1e12f667277da5c.tar.bz2 gentoo-2-946c58e51454b51ff77202a1b1e12f667277da5c.zip |
update the x-modular eclass to what was in the X11 overlay :
- EAPI=2 support
- regroup all the "inherit" logic near the top
- improved live git ebuild support
Diffstat (limited to 'eclass/x-modular.eclass')
-rw-r--r-- | eclass/x-modular.eclass | 80 |
1 files changed, 53 insertions, 27 deletions
diff --git a/eclass/x-modular.eclass b/eclass/x-modular.eclass index 8920c797b907..04e9a1c40ee4 100644 --- a/eclass/x-modular.eclass +++ b/eclass/x-modular.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.108 2009/03/06 21:00:00 dberkholz Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/x-modular.eclass,v 1.109 2009/05/14 12:40:55 remi Exp $ # # @ECLASS: x-modular.eclass # @MAINTAINER: @@ -17,6 +17,44 @@ # with the other X packages, you don't need to set SRC_URI. Pretty much # everything else should be automatic. +if [[ ${PV} = 9999* ]]; then + GIT_ECLASS="git" + SNAPSHOT="yes" + SRC_URI="" +fi + +# If we're a font package, but not the font.alias one +FONT_ECLASS="" +if [[ "${PN/#font-}" != "${PN}" ]] \ + && [[ "${CATEGORY}" = "media-fonts" ]] \ + && [[ "${PN}" != "font-alias" ]] \ + && [[ "${PN}" != "font-util" ]]; then + # Activate font code in the rest of the eclass + FONT="yes" + + # Whether to inherit the font eclass + FONT_ECLASS="font" +fi + +inherit eutils libtool multilib toolchain-funcs flag-o-matic autotools \ + ${FONT_ECLASS} ${GIT_ECLASS} + +EXPORTED_FUNCTIONS="src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm" + +case "${EAPI:-0}" in + 0|1) + ;; + 2) + EXPORTED_FUNCTIONS="${EXPORTED_FUNCTIONS} src_prepare src_configure" + ;; + *) + die "Unknown EAPI ${EAPI}" + ;; +esac + +# exports must be ALWAYS after inherit +EXPORT_FUNCTIONS ${EXPORTED_FUNCTIONS} + # @ECLASS-VARIABLE: XDIR # @DESCRIPTION: # Directory prefix to use for everything. If you want to install to a @@ -37,12 +75,6 @@ if [[ -z ${SNAPSHOT} ]]; then SNAPSHOT="no" fi -if [[ ${PV} = 9999* ]]; then - GIT_ECLASS="git" - SNAPSHOT="yes" - SRC_URI="" -fi - # Set up SRC_URI for individual modular releases BASE_INDIVIDUAL_URI="http://xorg.freedesktop.org/releases/individual" # @ECLASS-VARIABLE: MODULE @@ -86,18 +118,7 @@ if [[ -n "${SNAPSHOT}" ]]; then WANT_AUTOMAKE="latest" fi -# If we're a font package, but not the font.alias one -FONT_ECLASS="" -if [[ "${PN/#font-}" != "${PN}" ]] \ - && [[ "${CATEGORY}" = "media-fonts" ]] \ - && [[ "${PN}" != "font-alias" ]] \ - && [[ "${PN}" != "font-util" ]]; then - # Activate font code in the rest of the eclass - FONT="yes" - - # Whether to inherit the font eclass - FONT_ECLASS="font" - +if [[ -n "${FONT}" ]]; then RDEPEND="${RDEPEND} media-fonts/encodings x11-apps/mkfontscale @@ -170,9 +191,6 @@ RDEPEND="${RDEPEND} # Provides virtual/x11 for temporary use until packages are ported # x11-base/x11-env" -inherit eutils libtool multilib toolchain-funcs flag-o-matic autotools \ - ${FONT_ECLASS} ${GIT_ECLASS} - # @FUNCTION: x-modular_specs_check # @USAGE: # @DESCRIPTION: @@ -297,6 +315,17 @@ x-modular_reconf_source() { elibtoolize } +# @FUNCTION: x-modular_src_prepare +# @USAGE: +# @DESCRIPTION: +# Prepare a package after unpacking, performing all X-related tasks. +x-modular_src_prepare() { + [[ -n ${GIT_ECLASS} ]] && has src_prepare ${EXPORTED_FUNCTIONS} \ + && git_src_prepare + x-modular_patch_source + x-modular_reconf_source +} + # @FUNCTION: x-modular_src_unpack # @USAGE: # @DESCRIPTION: @@ -306,8 +335,7 @@ x-modular_src_unpack() { x-modular_server_supports_drivers_check x-modular_dri_check x-modular_unpack_source - x-modular_patch_source - x-modular_reconf_source + has src_prepare ${EXPORTED_FUNCTIONS} || x-modular_src_prepare } # @FUNCTION: x-modular_font_configure @@ -390,7 +418,7 @@ x-modular_src_make() { # @DESCRIPTION: # Compile a package, performing all X-related tasks. x-modular_src_compile() { - x-modular_src_configure + has src_configure ${EXPORTED_FUNCTIONS} || x-modular_src_configure x-modular_src_make } @@ -645,5 +673,3 @@ fix_font_permissions() { create_font_cache() { font_pkg_postinst } - -EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_postrm |