summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorPacho Ramos <pacho@gentoo.org>2012-12-02 11:26:07 +0000
committerPacho Ramos <pacho@gentoo.org>2012-12-02 11:26:07 +0000
commitba197c3b6b7cabd5803a4978eaa65f298611e327 (patch)
tree9cd64072244f1975e6dc84c4363232c7f49ba3c4 /eclass
parentwhitespace (diff)
downloadgentoo-2-ba197c3b6b7cabd5803a4978eaa65f298611e327.tar.gz
gentoo-2-ba197c3b6b7cabd5803a4978eaa65f298611e327.tar.bz2
gentoo-2-ba197c3b6b7cabd5803a4978eaa65f298611e327.zip
making vala_src_prepare() into a no-op in the
common situation where vala is in IUSE and USE=-vala as discussed with the team via mail. Thanks a lot to Alexandre Rostovtsev for the work.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog7
-rw-r--r--eclass/vala.eclass34
2 files changed, 31 insertions, 10 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 5bee6441e714..363a3bb391cc 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for eclass directory
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.539 2012/12/02 11:07:09 pacho Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.540 2012/12/02 11:26:07 pacho Exp $
+
+ 02 Dec 2012; Pacho Ramos <pacho@gentoo.org> vala.eclass:
+ making vala_src_prepare() into a no-op in the
+ common situation where vala is in IUSE and USE=-vala as discussed with the
+ team via mail. Thanks a lot to Alexandre Rostovtsev for the work.
02 Dec 2012; Pacho Ramos <pacho@gentoo.org> gnome2.eclass:
Always pass --disable-gtk-doc for eapi >= 5 as we don't want docs to get
diff --git a/eclass/vala.eclass b/eclass/vala.eclass
index 59af8b5cc371..9f457356e04e 100644
--- a/eclass/vala.eclass
+++ b/eclass/vala.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/vala.eclass,v 1.4 2012/09/20 04:48:26 tetromino Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/vala.eclass,v 1.5 2012/12/02 11:26:07 pacho Exp $
# @ECLASS: vala.eclass
# @MAINTAINER:
@@ -16,7 +16,7 @@
#
# This eclass provides one phase function: src_prepare.
-inherit multilib
+inherit eutils multilib
case "${EAPI:-0}" in
0) die "EAPI=0 is not supported" ;;
@@ -75,20 +75,36 @@ vala_best_api_version() {
}
# @FUNCTION: vala_src_prepare
-# @USAGE: [--vala-api-version api_version]
+# @USAGE: [--ignore-use] [--vala-api-version api_version]
# @DESCRIPTION:
# Sets up the environment variables and pkgconfig files for the
# specified API version, or, if no version is specified, for the
# highest installed vala API version satisfying
# VALA_MAX_API_VERSION, VALA_MIN_API_VERSION, and VALA_USE_DEPEND.
-# Dies if called without --vala-api-version and no suitable vala
-# version is found.
+# Is a no-op if called without --ignore-use when USE=-vala.
+# Dies if the USE check is passed (or ignored) and a suitable vala
+# version is not available.
vala_src_prepare() {
- local p d valafoo version
+ local p d valafoo version ignore_use
+
+ while [[ $1 ]]; do
+ case $1 in
+ "--ignore-use" )
+ ignore_use=1 ;;
+ "--vala-api-version" )
+ shift
+ version=$1
+ [[ ${version} ]] || die "'--vala-api-version' option requires API version parameter."
+ esac
+ shift
+ done
+
+ if [[ -z ${ignore_use} ]]; then
+ in_iuse vala && ! use vala && return 0
+ fi
- if [[ $1 = "--vala-api-version" ]]; then
- version=$2
- [[ ${version} ]] || die "'--vala-api-version' option requires API version parameter."
+ if [[ ${version} ]]; then
+ has_version "dev-lang/vala:${version}" || die "No installed vala:${version}"
else
version=$(vala_best_api_version)
[[ ${version} ]] || die "No installed vala in $(vala_depend)"