public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] gst-plugins10.eclass support for multiple plugin build directory
@ 2013-01-23 23:04 Gilles Dartiguelongue
  0 siblings, 0 replies; only message in thread
From: Gilles Dartiguelongue @ 2013-01-23 23:04 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 449 bytes --]

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 <eva@gentoo.org>
Gentoo

[-- Attachment #1.2: gst-plugins10.eclass.patch --]
[-- Type: text/x-patch, Size: 5630 bytes --]

^[[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

[-- Attachment #1.3: gst-plugins-amr-1.0.5.ebuild --]
[-- Type: text/plain, Size: 450 bytes --]

# 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"

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-01-23 23:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-23 23:04 [gentoo-dev] [PATCH] gst-plugins10.eclass support for multiple plugin build directory Gilles Dartiguelongue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox