summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMart Raudsepp <leio@gentoo.org>2010-12-27 03:49:34 +0000
committerMart Raudsepp <leio@gentoo.org>2010-12-27 03:49:34 +0000
commitc5c11d8c1d1b470a0783316198800cb55f0334ca (patch)
treebc36b53ec88653345c548af857cfe53d88c93f96 /eclass
parentVersion bump (diff)
downloadgentoo-2-c5c11d8c1d1b470a0783316198800cb55f0334ca.tar.gz
gentoo-2-c5c11d8c1d1b470a0783316198800cb55f0334ca.tar.bz2
gentoo-2-c5c11d8c1d1b470a0783316198800cb55f0334ca.zip
Add support for easy handling of orc dependencies in the eclass. This way the ebuild only needs to set EAPI=1 and GST_ORC=yes to get all the orc stuff handled, if said package builds things that have orc optimizations. The main purpose of this is to avoid the USE flag (and extraneous deps, though harmless, as indirectly orc will be needed anyway) in case the split plugin does not have any orc usage yet at all (many will never do, as they just wrap some external library without anything to really optimize). This code will become much simpler once older versions go away from tree and they do not need to be coped for. Also move EXPORT_FUNCTIONS handling around the new EAPI check block, in preparation of future EAPI-2+ support.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/gst-plugins-ugly.eclass56
1 files changed, 49 insertions, 7 deletions
diff --git a/eclass/gst-plugins-ugly.eclass b/eclass/gst-plugins-ugly.eclass
index 28e3df152db2..ed31dd72281a 100644
--- a/eclass/gst-plugins-ugly.eclass
+++ b/eclass/gst-plugins-ugly.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins-ugly.eclass,v 1.20 2010/12/26 04:38:12 leio Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins-ugly.eclass,v 1.21 2010/12/27 03:49:34 leio Exp $
# Author : foser <foser@gentoo.org>
@@ -33,15 +33,50 @@ if ! version_is_at_least "0.10.13"; then
my_gst_plugins_bad+=" dvdnav id3tag"
fi
+GST_UGLY_EXPORTED_FUNCTIONS="src_unpack src_compile src_install"
+
+case "${EAPI:-0}" in
+ 0)
+ if [[ -n ${GST_ORC} ]]; then
+ die "Usage of IUSE=+orc implying GST_ORC variable without EAPI-1"
+ fi
+ ;;
+ 1)
+ ;;
+ *)
+ die "Unsupported EAPI ${EAPI}"
+ ;;
+esac
+
+# exports must be ALWAYS after inherit
+EXPORT_FUNCTIONS ${GST_UGLY_EXPORTED_FUNCTIONS}
+
+if version_is_at_least "0.10.16"; then
+ # Ensure GST_ORC is set to a default. This fact is also relied on in
+ # gst-plugins-ugly_src_configure, signalling it's >=0.10.16 and has orc options
+ GST_ORC=${GST_ORC:-"no"}
+ if [[ ${GST_ORC} == "yes" ]]; then
+ IUSE="+orc"
+ fi
+else
+ unset GST_ORC
+fi
+
#SRC_URI="mirror://gnome/sources/gst-plugins/${PV_MAJ_MIN}/${MY_P}.tar.bz2"
SRC_URI="http://gstreamer.freedesktop.org/src/gst-plugins-ugly/${MY_P}.tar.bz2"
S=${WORKDIR}/${MY_P}
+if [[ ${GST_ORC} == "yes" ]]; then
+ RDEPEND="orc? ( >=dev-lang/orc-0.4.5 )"
+ DEPEND="${RDEPEND}"
+fi
+
# added to remove circular deps
# 6/2/2006 - zaheerm
if [ "${PN}" != "${MY_PN}" ]; then
-RDEPEND="=media-libs/gst-plugins-base-0.10*"
+RDEPEND="${RDEPEND}
+ =media-libs/gst-plugins-base-0.10*"
DEPEND="${RDEPEND}
>=sys-apps/sed-4
dev-util/pkgconfig"
@@ -63,7 +98,7 @@ fi
gst-plugins-ugly_src_configure() {
# disable any external plugin besides the plugin we want
- local plugin gst_conf
+ local plugin gst_conf gst_orc_conf
einfo "Configuring to build ${GST_PLUGINS_BUILD} plugin(s) ..."
@@ -75,8 +110,18 @@ gst-plugins-ugly_src_configure() {
gst_conf="${gst_conf} --enable-${plugin} "
done
+ gst_orc_conf=""
+ if [[ -n ${GST_ORC} ]]; then
+ if [[ ${GST_ORC} == "yes" ]]; then
+ gst_orc_conf="$(use_enable orc)"
+ else
+ gst_orc_conf="--disable-orc"
+ fi
+ fi
+ #else leave gst_orc_conf empty, as $PV is less than 0.10.16, so no --enable/disable-orc yet
+
cd ${S}
- econf ${@} --with-package-name="Gentoo GStreamer Ebuild" --with-package-origin="http://www.gentoo.org" ${gst_conf} || die "./configure failure"
+ econf ${gst_orc_conf} ${@} --with-package-name="Gentoo GStreamer Ebuild" --with-package-origin="http://www.gentoo.org" ${gst_conf} || die "./configure failure"
}
@@ -121,6 +166,3 @@ gst-plugins-ugly_src_install() {
[[ -e README ]] && dodoc README
}
-
-
-EXPORT_FUNCTIONS src_unpack src_compile src_install