Gentoo Archives: gentoo-commits

From: "Matthias Schwarzott (zzam)" <zzam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: vdr-plugin.eclass
Date: Tue, 24 Mar 2009 21:10:15
Message-Id: E1LmDt0-0001xy-1R@stork.gentoo.org
1 zzam 09/03/24 21:10:14
2
3 Modified: vdr-plugin.eclass
4 Log:
5 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.
6
7 Revision Changes Path
8 1.69 eclass/vdr-plugin.eclass
9
10 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/vdr-plugin.eclass?rev=1.69&view=markup
11 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/vdr-plugin.eclass?rev=1.69&content-type=text/plain
12 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/vdr-plugin.eclass?r1=1.68&r2=1.69
13
14 Index: vdr-plugin.eclass
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v
17 retrieving revision 1.68
18 retrieving revision 1.69
19 diff -u -r1.68 -r1.69
20 --- vdr-plugin.eclass 6 Mar 2009 09:09:29 -0000 1.68
21 +++ vdr-plugin.eclass 24 Mar 2009 21:10:13 -0000 1.69
22 @@ -1,6 +1,6 @@
23 # Copyright 1999-2005 Gentoo Foundation
24 # Distributed under the terms of the GNU General Public License v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.68 2009/03/06 09:09:29 zzam Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/vdr-plugin.eclass,v 1.69 2009/03/24 21:10:13 zzam Exp $
27 #
28 # Author:
29 # Matthias Schwarzott <zzam@g.o>
30 @@ -80,6 +80,15 @@
31 RDEPEND="${COMMON_DEPEND}
32 >=app-admin/eselect-vdr-0.0.2"
33
34 +# this is a hack for ebuilds like vdr-xineliboutput that want to
35 +# conditionally install a vdr-plugin
36 +if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]]; then
37 + # make DEPEND conditional
38 + IUSE="${IUSE} vdr"
39 + DEPEND="vdr? ( ${DEPEND} )"
40 + RDEPEND="vdr? ( ${RDEPEND} )"
41 +fi
42 +
43 # New method of storing plugindb
44 # Called from src_install
45 # file maintained by normal portage-methods
46 @@ -357,6 +366,9 @@
47 elog
48 }
49
50 +has_vdr() {
51 + [[ -f "${VDR_INCLUDE_DIR}"/config.h ]]
52 +}
53
54 ## exported functions
55
56 @@ -379,6 +391,20 @@
57 TMP_LOCALE_DIR="${WORKDIR}/tmp-locale"
58 LOCDIR="/usr/share/vdr/locale"
59
60 + if ! has_vdr; then
61 + # set to invalid values to detect abuses
62 + VDRVERSION="eclass_no_vdr_installed"
63 + APIVERSION="eclass_no_vdr_installed"
64 +
65 + if [[ "${GENTOO_VDR_CONDITIONAL:-no}" = "yes" ]] && ! use vdr; then
66 + einfo "VDR not found!"
67 + else
68 + # if vdr is required
69 + die "VDR not found!"
70 + fi
71 + return
72 + fi
73 +
74 VDRVERSION=$(awk -F'"' '/define VDRVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
75 APIVERSION=$(awk -F'"' '/define APIVERSION/ {print $2}' "${VDR_INCLUDE_DIR}"/config.h)
76 [[ -z ${APIVERSION} ]] && APIVERSION="${VDRVERSION}"