| 1 |
# Copyright 1999-2004 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins-good.eclass,v 1.10 2006/09/01 16:46:28 zaheerm Exp $ |
| 4 |
|
| 5 |
# Author : foser <foser@gentoo.org>, zaheerm <zaheerm@gentoo.org> |
| 6 |
|
| 7 |
# gst-plugins-good eclass |
| 8 |
# |
| 9 |
# eclass to make external gst-plugins emergable on a per-plugin basis |
| 10 |
# to solve the problem with gst-plugins generating far too much unneeded deps |
| 11 |
# |
| 12 |
# 3rd party applications using gstreamer now should depend on a set of plugins as |
| 13 |
# defined in the source, obtain recommended plugins to use from |
| 14 |
# Gentoo developers responsible for gstreamer <gnome@gentoo.org>, the application developer |
| 15 |
# or the gstreamer team. |
| 16 |
|
| 17 |
inherit eutils gst-plugins10 |
| 18 |
|
| 19 |
|
| 20 |
### |
| 21 |
# variable declarations |
| 22 |
### |
| 23 |
|
| 24 |
MY_PN=gst-plugins-good |
| 25 |
MY_P=${MY_PN}-${PV} |
| 26 |
# All relevant configure options for gst-plugins |
| 27 |
# need a better way to extract these |
| 28 |
# gst-plugins-base 0.9 |
| 29 |
my_gst_plugins_good="gconf gconftool oss aalib aalibtest cairo cdio esd esdtest flac jpeg ladspa libcaca libdv libpng dv1394 shout2 shout2test speex annodex hal x taglib gdk_pixbuf" |
| 30 |
|
| 31 |
#SRC_URI="mirror://gnome/sources/gst-plugins/${PV_MAJ_MIN}/${MY_P}.tar.bz2" |
| 32 |
SRC_URI="http://gstreamer.freedesktop.org/src/gst-plugins-good/${MY_P}.tar.bz2" |
| 33 |
|
| 34 |
S=${WORKDIR}/${MY_P} |
| 35 |
# added to remove circular deps |
| 36 |
# 6/2/2006 - zaheerm |
| 37 |
if [ "${PN}" != "${MY_PN}" ]; then |
| 38 |
RDEPEND="=media-libs/gst-plugins-base-0.10*" |
| 39 |
DEPEND="${RDEPEND} |
| 40 |
>=sys-apps/sed-4 |
| 41 |
dev-util/pkgconfig" |
| 42 |
fi |
| 43 |
|
| 44 |
### |
| 45 |
# public functions |
| 46 |
### |
| 47 |
|
| 48 |
gst-plugins-good_src_configure() { |
| 49 |
|
| 50 |
# disable any external plugin besides the plugin we want |
| 51 |
local plugin gst_conf |
| 52 |
|
| 53 |
einfo "Configuring to build ${GST_PLUGINS_BUILD} plugin(s) ..." |
| 54 |
|
| 55 |
for plugin in ${GST_PLUGINS_BUILD}; do |
| 56 |
my_gst_plugins_good=${my_gst_plugins_good/${plugin}/} |
| 57 |
done |
| 58 |
for plugin in ${my_gst_plugins_good}; do |
| 59 |
gst_conf="${gst_conf} --disable-${plugin} " |
| 60 |
done |
| 61 |
for plugin in ${GST_PLUGINS_BUILD}; do |
| 62 |
gst_conf="${gst_conf} --enable-${plugin} " |
| 63 |
done |
| 64 |
|
| 65 |
cd ${S} |
| 66 |
econf ${@} --with-package-name="Gentoo GStreamer Ebuild" --with-package-origin="http://www.gentoo.org" ${gst_conf} || die "./configure failure" |
| 67 |
|
| 68 |
} |
| 69 |
|
| 70 |
### |
| 71 |
# public inheritable functions |
| 72 |
### |
| 73 |
|
| 74 |
gst-plugins-good_src_unpack() { |
| 75 |
|
| 76 |
local makefiles |
| 77 |
|
| 78 |
unpack ${A} |
| 79 |
|
| 80 |
# Link with the syswide installed gst-libs if needed |
| 81 |
gst-plugins10_find_plugin_dir |
| 82 |
cd ${S} |
| 83 |
|
| 84 |
# Remove generation of any other Makefiles except the plugin's Makefile |
| 85 |
if [ -d "${S}/sys/${GST_PLUGINS_BUILD_DIR}" ]; then |
| 86 |
makefiles="Makefile sys/Makefile sys/${GST_PLUGINS_BUILD_DIR}/Makefile" |
| 87 |
elif [ -d "${S}/ext/${GST_PLUGINS_BUILD_DIR}" ]; then |
| 88 |
makefiles="Makefile ext/Makefile ext/${GST_PLUGINS_BUILD_DIR}/Makefile" |
| 89 |
fi |
| 90 |
sed -e "s:ac_config_files=.*:ac_config_files='${makefiles}':" \ |
| 91 |
-i ${S}/configure |
| 92 |
|
| 93 |
} |
| 94 |
|
| 95 |
gst-plugins-good_src_compile() { |
| 96 |
|
| 97 |
gst-plugins-good_src_configure ${@} |
| 98 |
|
| 99 |
gst-plugins10_find_plugin_dir |
| 100 |
emake || die "compile failure" |
| 101 |
|
| 102 |
} |
| 103 |
|
| 104 |
gst-plugins-good_src_install() { |
| 105 |
|
| 106 |
gst-plugins10_find_plugin_dir |
| 107 |
einstall || die |
| 108 |
|
| 109 |
dodoc README |
| 110 |
} |
| 111 |
|
| 112 |
EXPORT_FUNCTIONS src_unpack src_compile src_install |