summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMatthias Schwarzott <zzam@gentoo.org>2009-03-24 21:10:13 +0000
committerMatthias Schwarzott <zzam@gentoo.org>2009-03-24 21:10:13 +0000
commit9238501d656a3fd8e80515a8bbd789116a0c1ea6 (patch)
treedd08d7b57b3b30ae07667e1ba9be1cb5f22bf4ab /eclass
parentAutomated update of use.local.desc (diff)
downloadhistorical-9238501d656a3fd8e80515a8bbd789116a0c1ea6.tar.gz
historical-9238501d656a3fd8e80515a8bbd789116a0c1ea6.tar.bz2
historical-9238501d656a3fd8e80515a8bbd789116a0c1ea6.zip
Make vdr conditional when GENTOO_VDR_CONDITIONAL=yes is set. This is for cases like vdr-xineliboutput which want to compile vdr-plugins based on useflag vdr.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/vdr-plugin.eclass28
1 files changed, 27 insertions, 1 deletions
diff --git a/eclass/vdr-plugin.eclass b/eclass/vdr-plugin.eclass
index 7ef22c2915b6..395eac10439c 100644
--- a/eclass/vdr-plugin.eclass
+++ b/eclass/vdr-plugin.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/vdr-plugin.eclass,v 1.68 2009/03/06 09:09:29 zzam Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.69 2009/03/24 21:10:13 zzam Exp $
#
# Author:
# Matthias Schwarzott <zzam@gentoo.org>
@@ -80,6 +80,15 @@ DEPEND="${COMMON_DEPEND}
RDEPEND="${COMMON_DEPEND}
>=app-admin/eselect-vdr-0.0.2"
+# this is a hack for ebuilds like vdr-xineliboutput that want to
+# conditionally install a vdr-plugin
+if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]]; then
+ # make DEPEND conditional
+ IUSE="${IUSE} vdr"
+ DEPEND="vdr? ( ${DEPEND} )"
+ RDEPEND="vdr? ( ${RDEPEND} )"
+fi
+
# New method of storing plugindb
# Called from src_install
# file maintained by normal portage-methods
@@ -357,6 +366,9 @@ vdr-plugin_print_enable_command() {
elog
}
+has_vdr() {
+ [[ -f "${VDR_INCLUDE_DIR}"/config.h ]]
+}
## exported functions
@@ -379,6 +391,20 @@ vdr-plugin_pkg_setup() {
TMP_LOCALE_DIR="${WORKDIR}/tmp-locale"
LOCDIR="/usr/share/vdr/locale"
+ if ! has_vdr; then
+ # set to invalid values to detect abuses
+ VDRVERSION="eclass_no_vdr_installed"
+ APIVERSION="eclass_no_vdr_installed"
+
+ if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]] && ! use vdr; then
+ einfo "VDR not found!"
+ else
+ # if vdr is required
+ die "VDR not found!"
+ fi
+ return
+ fi
+
VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
[[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}"