Hi all, this patch adds support for building plugins in different directory.
This has been a long TODO item but there is now a need for it since the amrnb and amrwb codecs both depend on the same lib and I see no reason to not have them under the same ebuild. I am attaching the sample ebuild with it. AMR* ebuild request is here: https://bugs.gentoo.org/show_bug.cgi?id=306855 -- Gilles Dartiguelongue <e...@gentoo.org> Gentoo
[1;32mIndex: gst-plugins10.eclass[0;0m [1;32m===================================================================[0;0m [1;32mRCS file: /var/cvsroot/gentoo-x86/eclass/gst-plugins10.eclass,v[0;0m [1;32mretrieving revision 1.9[0;0m [1;32mdiff -u -B -r1.9 gst-plugins10.eclass[0;0m [1;31m--- gst-plugins10.eclass 16 Jan 2013 22:52:37 -0000 1.9[0;0m [1;34m+++ gst-plugins10.eclass 23 Jan 2013 22:56:06 -0000[0;0m [1;35m@@ -58,13 +58,13 @@[0;0m [0;0m # Defines the plugins to be built.[0;0m [0;0m # May be set by an ebuild and contain more than one indentifier, space[0;0m [0;0m # seperated (only src_configure can handle mutiple plugins at this time).[0;0m [1;31m-GST_PLUGINS_BUILD=${PN/gst-plugins-/}[0;0m [1;34m+: ${GST_PLUGINS_BUILD:=${PN/gst-plugins-/}}[0;0m [0;0m [0;0m [0;0m # @ECLASS-VARIABLE: GST_PLUGINS_BUILD_DIR[0;0m [0;0m # @DESCRIPTION:[0;0m [0;0m # Actual build directory of the plugin.[0;0m [0;0m # Most often the same as the configure switch name.[0;0m [1;31m-GST_PLUGINS_BUILD_DIR=${PN/gst-plugins-/}[0;0m [1;34m+: ${GST_PLUGINS_BUILD_DIR:=${PN/gst-plugins-/}}[0;0m [0;0m [0;0m [0;0m # @ECLASS-VARIABLE: GST_TARBALL_SUFFIX[0;0m [0;0m # @DESCRIPTION:[0;0m [1;35m@@ -142,20 +142,24 @@[0;0m [0;0m }[0;0m [0;0m [0;0m [0;0m # @FUNCTION: gst-plugins10_find_plugin_dir[0;0m [1;34m+# @USAGE: gst-plugins10_find_plugin_dir [<build_dir>][0;0m [0;0m # @INTERNAL[0;0m [0;0m # @DESCRIPTION:[0;0m [0;0m # Finds plugin build directory and cd to it.[0;0m [1;34m+# Defaults to ${GST_PLUGINS_BUILD_DIR} if argument is not provided[0;0m [0;0m gst-plugins10_find_plugin_dir() {[0;0m [1;31m- if [[ ! -d ${S}/ext/${GST_PLUGINS_BUILD_DIR} ]]; then[0;0m [1;31m- if [[ ! -d ${S}/sys/${GST_PLUGINS_BUILD_DIR} ]]; then[0;0m [1;34m+ local build_dir=${1:-${GST_PLUGINS_BUILD_DIR}}[0;0m [1;34m+[0;0m [1;34m+ if [[ ! -d ${S}/ext/${build_dir} ]]; then[0;0m [1;34m+ if [[ ! -d ${S}/sys/${build_dir} ]]; then[0;0m [0;0m ewarn "No such plugin directory"[0;0m [0;0m die[0;0m [0;0m fi[0;0m [1;31m- einfo "Building system plugin ${GST_PLUGINS_BUILD_DIR} ..."[0;0m [1;31m- cd "${S}"/sys/${GST_PLUGINS_BUILD_DIR}[0;0m [1;34m+ einfo "Building system plugin in ${build_dir}..."[0;0m [1;34m+ cd "${S}"/sys/${build_dir}[0;0m [0;0m else[0;0m [1;31m- einfo "Building external plugin ${GST_PLUGINS_BUILD_DIR} ..."[0;0m [1;31m- cd "${S}"/ext/${GST_PLUGINS_BUILD_DIR}[0;0m [1;34m+ einfo "Building external plugin in ${build_dir}..."[0;0m [1;34m+ cd "${S}"/ext/${build_dir}[0;0m [0;0m fi[0;0m [0;0m }[0;0m [0;0m [0;0m [1;35m@@ -171,15 +175,16 @@[0;0m [0;0m local directory libs pkgconfig pc tuple[0;0m [0;0m pkgconfig=$(tc-getPKG_CONFIG)[0;0m [0;0m [0;0m [1;31m- gst-plugins10_find_plugin_dir[0;0m [1;31m-[0;0m [1;31m- for tuple in $@ ; do[0;0m [1;31m- directory="$(echo ${tuple} | cut -f1 -d':')"[0;0m [1;31m- pc="$(echo ${tuple} | cut -f2 -d':')-${SLOT}"[0;0m [1;31m- libs="$(${pkgconfig} --libs-only-l ${pc})"[0;0m [1;34m+ for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do[0;0m [1;34m+ gst-plugins10_find_plugin_dir ${plugin_dir}[0;0m [0;0m [0;0m [1;31m- sed -e "s:\$(top_builddir)/${directory}/.*\.la:${libs}:" \[0;0m [1;31m- -i Makefile.am Makefile.in || die[0;0m [1;34m+ for tuple in $@ ; do[0;0m [1;34m+ directory="$(echo ${tuple} | cut -f1 -d':')"[0;0m [1;34m+ pc="$(echo ${tuple} | cut -f2 -d':')-${SLOT}"[0;0m [1;34m+ libs="$(${pkgconfig} --libs-only-l ${pc})"[0;0m [1;34m+ sed -e "s:\$(top_builddir)/${directory}/.*\.la:${libs}:" \[0;0m [1;34m+ -i Makefile.am Makefile.in || die[0;0m [1;34m+ done[0;0m [0;0m done[0;0m [0;0m }[0;0m [0;0m [0;0m [1;35m@@ -253,29 +258,37 @@[0;0m [0;0m # @DESCRIPTION:[0;0m [0;0m # Compiles requested gstreamer plugin.[0;0m [0;0m gst-plugins10_src_compile() {[0;0m [1;34m+ local plugin_dir[0;0m [1;34m+ [0;0m [0;0m has ${EAPI:-0} 0 1 && gst-plugins10_src_configure "$@"[0;0m [0;0m [0;0m [1;31m- gst-plugins10_find_plugin_dir[0;0m [1;34m+ for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do[0;0m [1;34m+ gst-plugins10_find_plugin_dir ${plugin_dir}[0;0m [0;0m [0;0m [1;31m- if has "${EAPI:-0}" 0 1 2 3 ; then[0;0m [1;31m- emake || die[0;0m [1;31m- else[0;0m [1;31m- default[0;0m [1;31m- fi[0;0m [1;34m+ if has "${EAPI:-0}" 0 1 2 3 ; then[0;0m [1;34m+ emake || die[0;0m [1;34m+ else[0;0m [1;34m+ default[0;0m [1;34m+ fi[0;0m [1;34m+ done[0;0m [0;0m }[0;0m [0;0m [0;0m [0;0m # @FUNCTION: gst-plugins10_src_install[0;0m [0;0m # @DESCRIPTION:[0;0m [0;0m # Installs requested gstreamer plugin.[0;0m [0;0m gst-plugins10_src_install() {[0;0m [1;31m- gst-plugins10_find_plugin_dir[0;0m [1;31m-[0;0m [1;31m- if has "${EAPI:-0}" 0 1 2 3 ; then[0;0m [1;31m- emake install DESTDIR="${D}" || die[0;0m [1;31m- [[ -e README ]] && dodoc README[0;0m [1;31m- else[0;0m [1;31m- default[0;0m [1;31m- fi[0;0m [1;34m+ local plugin_dir[0;0m [1;34m+ [0;0m [1;34m+ for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do[0;0m [1;34m+ gst-plugins10_find_plugin_dir ${plugin_dir}[0;0m [1;34m+[0;0m [1;34m+ if has "${EAPI:-0}" 0 1 2 3 ; then[0;0m [1;34m+ emake install DESTDIR="${D}" || die[0;0m [1;34m+ [[ -e README ]] && dodoc README[0;0m [1;34m+ else[0;0m [1;34m+ default[0;0m [1;34m+ fi[0;0m [1;34m+ done[0;0m [0;0m [0;0m [0;0m [[ ${GST_LA_PUNT} = "yes" ]] && prune_libtool_files --modules[0;0m [0;0m }[0;0m
# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="5" inherit gst-plugins-ugly DESCRIPTION="GStreamer plugin for AMRNB/AMRWB codec" HOMEPAGE="http://gstreamer.freedesktop.org/" LICENSE="GPL-2" KEYWORDS="~amd64 ~x86" IUSE="" RDEPEND="media-libs/opencore-amr" DEPEND="${RDEPEND}" GST_PLUGINS_BUILD="amrnb amrwb" GST_PLUGINS_BUILD_DIR="amrnb amrwbdec"
signature.asc
Description: This is a digitally signed message part