diff options
author | Gilles Dartiguelongue <eva@gentoo.org> | 2012-12-02 17:16:20 +0000 |
---|---|---|
committer | Gilles Dartiguelongue <eva@gentoo.org> | 2012-12-02 17:16:20 +0000 |
commit | ae593c73e1a6a01e654caf01d5ae2507f589cc2b (patch) | |
tree | 0d901fc7694441059a30fc084c63b7446ed1d3fe /eclass | |
parent | Pin gstreamer dependencies. (diff) | |
download | historical-ae593c73e1a6a01e654caf01d5ae2507f589cc2b.tar.gz historical-ae593c73e1a6a01e654caf01d5ae2507f589cc2b.tar.bz2 historical-ae593c73e1a6a01e654caf01d5ae2507f589cc2b.zip |
Commit new gstreamer eclasses as reviewed on gentoo-dev mailing list with a few more fixes, most notably EAPI=1 support fixes. For a more detailed changelog, please see gnome overlay git log.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/ChangeLog | 9 | ||||
-rw-r--r-- | eclass/gst-plugins-bad.eclass | 174 | ||||
-rw-r--r-- | eclass/gst-plugins-base.eclass | 174 | ||||
-rw-r--r-- | eclass/gst-plugins-good.eclass | 184 | ||||
-rw-r--r-- | eclass/gst-plugins-ugly.eclass | 151 | ||||
-rw-r--r-- | eclass/gst-plugins10.eclass | 273 |
6 files changed, 352 insertions, 613 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog index 363a3bb391cc..33cf6ec6b09d 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for eclass directory # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.540 2012/12/02 11:26:07 pacho Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.541 2012/12/02 17:16:20 eva Exp $ + + 02 Dec 2012; Gilles Dartiguelongue <eva@gentoo.org> gst-plugins-bad.eclass, + gst-plugins-base.eclass, gst-plugins-good.eclass, gst-plugins-ugly.eclass, + gst-plugins10.eclass: + Commit new gstreamer eclasses as reviewed on gentoo-dev mailing list with a + few more fixes, most notably EAPI=1 support fixes. For a more detailed + changelog, please see gnome overlay git log. 02 Dec 2012; Pacho Ramos <pacho@gentoo.org> vala.eclass: making vala_src_prepare() into a no-op in the diff --git a/eclass/gst-plugins-bad.eclass b/eclass/gst-plugins-bad.eclass index 80007ee48d64..1ff961d0f08f 100644 --- a/eclass/gst-plugins-bad.eclass +++ b/eclass/gst-plugins-bad.eclass @@ -1,155 +1,43 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins-bad.eclass,v 1.45 2012/09/27 16:35:41 axs Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins-bad.eclass,v 1.46 2012/12/02 17:16:20 eva Exp $ -# -# Original Author: Saleem Abdulrasool <compnerd@gentoo.org> -# Based on the work of foser <foser@gentoo.org> and zaheerm <zaheerm@gentoo.org> -# Purpose: This elcass is designed to help package external gst-plugins per -# plugin rather than in a single package. -# +# @ECLASS: gst-plugins10-bad.eclass +# @MAINTAINER: +# gstreamer@gentoo.org +# @AUTHOR: +# Gilles Dartiguelongue <eva@gentoo.org> +# Saleem Abdulrasool <compnerd@gentoo.org> +# foser <foser@gentoo.org> +# zaheerm <zaheerm@gentoo.org> +# @BLURB: Manages build for invididual ebuild for gst-plugins-bad. +# @DESCRIPTION: +# See gst-plugins10.eclass documentation. -inherit eutils multilib versionator gst-plugins10 +GST_ORG_MODULE="gst-plugins-bad" + +inherit eutils gst-plugins10 -GSTBAD_EXPF="src_unpack src_compile src_install" case "${EAPI:-0}" in - 2|3|4|5) GSTBAD_EXPF+=" src_prepare src_configure" ;; - 0|1) ;; - *) die "EAPI=\"${EAPI}\" is not supported yet" ;; + 1|2|3|4|5) + ;; + 0) + die "EAPI=\"${EAPI}\" is not supported anymore" + ;; + *) + die "EAPI=\"${EAPI}\" is not supported yet" + ;; esac -EXPORT_FUNCTIONS ${GSTBAD_EXPF} - -# This list is current for gst-plugins-bad-0.10.21. -my_gst_plugins_bad="directsound directdraw osx_video quicktime vcd -assrender amrwb apexsink bz2 cdaudio celt cog dc1394 directfb dirac dts divx -faac faad fbdev flite gsm jp2k kate ladspa lv2 libmms -modplug mimic mpeg2enc mplex musepack musicbrainz mythtv nas neon ofa rsvg -timidity wildmidi sdl sdltest sndfile soundtouch spc gme swfdec xvid -dvb wininet acm vdpau schro zbar resindvd vp8" - -# When adding conditionals like below, be careful about having leading spaces - -# Changes in 0.10.22: -# New curlsink element in a new curl plugin -# New Blackmagic Decklink source and sink -# New Linear Systems SDI plugin -if version_is_at_least "0.10.22"; then - my_gst_plugins_bad+=" curl decklink linsys" -fi - -# Unused ancient theora decoder, better one in -base long ago -if ! version_is_at_least "0.10.22"; then - my_gst_plugins_bad+=" theoradec" -fi - -# Changes in 0.10.21: -# New opencv and apple_media plugins -if version_is_at_least "0.10.21"; then - my_gst_plugins_bad+=" opencv apple_media" -fi - -# exif for a specific jifmux tests purpose only. -# Made automagic in 0.10.22, which is fine as a non-installed test -if [ ${PV} == "0.10.21" ]; then - my_gst_plugins_bad+=" exif" -fi - -# jack moved to -good, metadata removed (functionality in base classes) -# alsaspdif gone (gst-plugins-alsa from -base can do spdif on its own long ago) -if ! version_is_at_least "0.10.21"; then - my_gst_plugins_bad+=" jack metadata alsa" -fi - -# Changes in 0.10.20: -# New split plugins rtmp, gsettings and shm -if version_is_at_least "0.10.20"; then - my_gst_plugins_bad+=" rtmp gsettings shm" -fi - -MY_PN="gst-plugins-bad" -MY_P=${MY_PN}-${PV} - -SRC_URI="http://gstreamer.freedesktop.org/src/gst-plugins-bad/${MY_P}.tar.bz2" - -# added to remove circular deps -# 6/2/2006 - zaheerm -if [ "${PN}" != "${MY_PN}" ]; then -RDEPEND="=media-libs/gstreamer-0.10* - =media-libs/gst-plugins-base-0.10* - >=dev-libs/glib-2.6" -DEPEND="${RDEPEND} - sys-apps/sed - virtual/pkgconfig - sys-devel/gettext" - +if [[ ${PN} != ${GST_ORG_MODULE} ]]; then # -bad-0.10.20 uses orc optionally instead of liboil unconditionally. -# While <0.10.20 configure always check for liboil, it is used only by non-split -# plugins in gst/ (legacyresample and mpegdemux), so we only builddep for all -# old packages, and have a RDEPEND in old versions of media-libs/gst-plugins-bad -if ! version_is_at_least "0.10.20"; then -DEPEND="${DEPEND} >=dev-libs/liboil-0.3.8" +# While <0.10.20 configure always check for liboil, it is used only by +# non-split plugins in gst/ (legacyresample and mpegdemux), so we only +# builddep for all old packages, and have a RDEPEND in old versions of +# media-libs/gst-plugins-bad + if [[ ${SLOT} = "0.10" ]] && ! version_is_at_least "0.10.20"; then + DEPEND="${DEPEND} >=dev-libs/liboil-0.3.8" + fi fi -RESTRICT=test -fi -S=${WORKDIR}/${MY_P} - -gst-plugins-bad_src_unpack() { -# local makefiles - - unpack ${A} - has src_prepare ${GSTBAD_EXPF} || gst-plugins-bad_src_prepare -} - -gst-plugins-bad_src_prepare() { - # Link with the syswide installed gst-libs if needed - gst-plugins10_find_plugin_dir - sed -e "s:\$(top_builddir)/gst-libs/gst/interfaces/libgstphotography:${ROOT}/usr/$(get_libdir)/libgstphotography:" \ - -e "s:\$(top_builddir)/gst-libs/gst/signalprocessor/libgstsignalprocessor:${ROOT}/usr/$(get_libdir)/libgstsignalprocessor:" \ - -e "s:\$(top_builddir)/gst-libs/gst/video/libgstbasevideo:${ROOT}/usr/$(get_libdir)/libgstbasevideo:" \ - -e "s:\$(top_builddir)/gst-libs/gst/basecamerabinsrc/libgstbasecamerabinsrc:${ROOT}/usr/$(get_libdir)/libgstbasecamerabinsrc:" \ - -i Makefile.in - - # Remove generation of any other Makefiles except the plugin's Makefile -# if [[ -d "${S}/sys/${GST_PLUGINS_BUILD_DIR}" ]] ; then -# makefiles="Makefile sys/Makefile sys/${GST_PLUGINS_BUILD_DIR}/Makefile" -# elif [[ -d "${S}/ext/${GST_PLUGINS_BUILD_DIR}" ]] ; then -# makefiles="Makefile ext/Makefile ext/${GST_PLUGINS_BUILD_DIR}/Makefile" -# fi - -# sed -e "s:ac_config_files=.*:ac_config_files='${makefiles}':" \ -# -i ${S}/configure -} - -gst-plugins-bad_src_configure() { - local plugin gst_conf - - einfo "Configuring to build ${GST_PLUGINS_BUILD} plugin(s) ..." - - for plugin in ${my_gst_plugins_bad} ; do - gst_conf+=" --disable-${plugin}" - done - - for plugin in ${GST_PLUGINS_BUILD} ; do - gst_conf+=" --enable-${plugin}" - done - - cd ${S} - econf ${@} --with-package-name="Gentoo GStreamer Ebuild" --with-package-origin="http://www.gentoo.org" ${gst_conf} -} - -gst-plugins-bad_src_compile() { - has src_configure ${GSTBAD_EXPF} || gst-plugins-bad_src_configure ${@} - - gst-plugins10_find_plugin_dir - emake || die "compile failure" -} - -gst-plugins-bad_src_install() { - gst-plugins10_find_plugin_dir - einstall || die "install failed" - - [[ -e README ]] && dodoc README -} diff --git a/eclass/gst-plugins-base.eclass b/eclass/gst-plugins-base.eclass index fa4a54b0811b..506c0572a997 100644 --- a/eclass/gst-plugins-base.eclass +++ b/eclass/gst-plugins-base.eclass @@ -1,151 +1,31 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins-base.eclass,v 1.24 2012/10/23 08:09:35 tetromino Exp $ - -# Author : foser <foser@gentoo.org> - -# gst-plugins eclass -# -# eclass to make external gst-plugins emergable on a per-plugin basis -# to solve the problem with gst-plugins generating far too much unneeded deps -# -# 3rd party applications using gstreamer now should depend on a set of plugins as -# defined in the source, in case of spider usage obtain recommended plugins to use from -# Gentoo developers responsible for gstreamer <gnome@gentoo.org>, the application developer -# or the gstreamer team. - -inherit eutils gst-plugins10 multilib - -GST_EXPF="src_unpack src_compile src_install" -GST_TARBALL_SUFFIX="bz2" -GST_LA_PUNT="no" -case ${EAPI:-0} in - 4) GST_EXPF="${GST_EXPF} src_prepare src_configure" - GST_TARBALL_SUFFIX="xz" - GST_LA_PUNT="yes" ;; - 2|3) GST_EXPF="${GST_EXPF} src_prepare src_configure" ;; - 1|0) ;; - *) die "Unknown EAPI" ;; +# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins-base.eclass,v 1.25 2012/12/02 17:16:20 eva Exp $ + +# @ECLASS: gst-plugins-base.eclass +# @MAINTAINER: +# gstreamer@gentoo.org +# @AUTHOR: +# Gilles Dartiguelongue <eva@gentoo.org> +# Saleem Abdulrasool <compnerd@gentoo.org> +# foser <foser@gentoo.org> +# zaheerm <zaheerm@gentoo.org> +# @BLURB: Manages build for invididual ebuild for gst-plugins-base. +# @DESCRIPTION: +# See gst-plugins10.eclass documentation. + +GST_ORG_MODULE="gst-plugins-base" + +inherit gst-plugins10 + +case "${EAPI:-0}" in + 1|2|3|4|5) + ;; + 0) + die "EAPI=\"${EAPI}\" is not supported anymore" + ;; + *) + die "EAPI=\"${EAPI}\" is not supported yet" + ;; esac -EXPORT_FUNCTIONS ${GST_EXPF} - -### -# variable declarations -### - -MY_PN=gst-plugins-base -MY_P=${MY_PN}-${PV} -# All relevant configure options for gst-plugins -# need a better way to extract these -# gst-plugins-base 0.9 -my_gst_plugins_base="x xvideo xshm gst_v4l alsa cdparanoia gnome_vfs -gio libvisual ogg oggtest theora ivorbis vorbis vorbistest examples -freetypetest pango" - -#SRC_URI="mirror://gnome/sources/gst-plugins/${PV_MAJ_MIN}/${MY_P}.tar.bz2" -SRC_URI="http://gstreamer.freedesktop.org/src/gst-plugins-base/${MY_P}.tar.${GST_TARBALL_SUFFIX}" -[[ ${GST_TARBALL_SUFFIX} = "xz" ]] && DEPEND="${DEPEND} app-arch/xz-utils" - -S=${WORKDIR}/${MY_P} - -# added to remove circular deps -# 6/2/2006 - zaheerm -if [ "${PN}" != "${MY_PN}" ]; then -RDEPEND=">=media-libs/gst-plugins-base-${PV}" -DEPEND="${RDEPEND} - ${DEPEND} - ~media-libs/gst-plugins-base-${PV} - >=sys-apps/sed-4 - virtual/pkgconfig" -RESTRICT=test -fi - -### -# public functions -### - -gst-plugins-base_src_configure() { - - # disable any external plugin besides the plugin we want - local plugin gst_conf - - einfo "Configuring to build ${GST_PLUGINS_BUILD} plugin(s) ..." - - for plugin in ${my_gst_plugins_base}; do - gst_conf="${gst_conf} --disable-${plugin} " - done - - for plugin in ${GST_PLUGINS_BUILD}; do - gst_conf="${gst_conf} --enable-${plugin} " - done - - cd "${S}" - econf ${@} --with-package-name="Gentoo GStreamer Ebuild" --with-package-origin="http://www.gentoo.org" ${gst_conf} - -} - -### -# public inheritable functions -### - -gst-plugins-base_src_unpack() { - - unpack ${A} - - cd "${S}" - has src_prepare ${GST_EXPF} || gst-plugins-base_src_prepare - -} - -gst-plugins-base_src_prepare() { - - # Link with the syswide installed gst-libs if needed - gst-plugins10_find_plugin_dir - sed -e "s:\$(top_builddir)/gst-libs/gst/interfaces/libgstinterfaces:${ROOT}/usr/$(get_libdir)/libgstinterfaces:" \ - -e "s:\${top_builddir}/gst-libs/gst/interfaces/libgstinterfaces:${ROOT}/usr/$(get_libdir)/libgstinterfaces:" \ - -e "s:\$(top_builddir)/gst-libs/gst/audio/libgstaudio:${ROOT}/usr/$(get_libdir)/libgstaudio:" \ - -e "s:\${top_builddir}/gst-libs/gst/audio/libgstaudio:${ROOT}/usr/$(get_libdir)/libgstaudio:" \ - -e "s:\$(top_builddir)/gst-libs/gst/cdda/libgstcdda:${ROOT}/usr/$(get_libdir)/libgstcdda:" \ - -e "s:\${top_builddir}/gst-libs/gst/cdda/libgstcdda:${ROOT}/usr/$(get_libdir)/libgstcdda:" \ - -e "s:\$(top_builddir)/gst-libs/gst/riff/libgstriff:${ROOT}/usr/$(get_libdir)/libgstriff:" \ - -e "s:\${top_builddir}/gst-libs/gst/riff/libgstriff:${ROOT}/usr/$(get_libdir)/libgstriff:" \ - -e "s:\$(top_builddir)/gst-libs/gst/tag/libgsttag:${ROOT}/usr/$(get_libdir)/libgsttag:" \ - -e "s:\${top_builddir}/gst-libs/gst/tag/libgsttag:${ROOT}/usr/$(get_libdir)/libgsttag:" \ - -e "s:\$(top_builddir)/gst-libs/gst/video/libgstvideo:${ROOT}/usr/$(get_libdir)/libgstvideo:" \ - -e "s:\${top_builddir}/gst-libs/gst/video/libgstvideo:${ROOT}/usr/$(get_libdir)/libgstvideo:" \ - -e "s:\$(top_builddir)/gst-libs/gst/netbuffer/libgstnetbuffer:${ROOT}/usr/$(get_libdir)/libgstnetbuffer:" \ - -e "s:\${top_builddir}/gst-libs/gst/netbuffer/libgstnetbuffer:${ROOT}/usr/$(get_libdir)/libgstnetbuffer:" \ - -e "s:\$(top_builddir)/gst-libs/gst/rtp/libgstrtp:${ROOT}/usr/$(get_libdir)/libgstrtp:" \ - -e "s:\${top_builddir}/gst-libs/gst/rtp/libgstrtp:${ROOT}/usr/$(get_libdir)/libgstrtp:" \ - -i Makefile.in -# cd ${S} - - # Remove generation of any other Makefiles except the plugin's Makefile -# if [ -d "${S}/sys/${GST_PLUGINS_BUILD_DIR}" ]; then -# makefiles="Makefile sys/Makefile sys/${GST_PLUGINS_BUILD_DIR}/Makefile" -# elif [ -d "${S}/ext/${GST_PLUGINS_BUILD_DIR}" ]; then -# makefiles="Makefile ext/Makefile ext/${GST_PLUGINS_BUILD_DIR}/Makefile" -# fi -# sed -e "s:ac_config_files=.*:ac_config_files='${makefiles}':" \ -# -i ${S}/configure - -} - - - -gst-plugins-base_src_compile() { - - has src_configure ${GST_EXPF} || gst-plugins-base_src_configure ${@} - gst-plugins10_find_plugin_dir - emake || die "compile failure" - -} - -gst-plugins-base_src_install() { - - gst-plugins10_find_plugin_dir - einstall || die - [[ ${GST_LA_PUNT} = "yes" ]] && prune_libtool_files --modules - [[ -e README ]] && dodoc README -} diff --git a/eclass/gst-plugins-good.eclass b/eclass/gst-plugins-good.eclass index f2bff6180771..08b98a291bc9 100644 --- a/eclass/gst-plugins-good.eclass +++ b/eclass/gst-plugins-good.eclass @@ -1,158 +1,42 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins-good.eclass,v 1.28 2012/10/23 07:54:38 tetromino Exp $ - -# Author : foser <foser@gentoo.org>, zaheerm <zaheerm@gentoo.org> - -# gst-plugins-good eclass -# -# eclass to make external gst-plugins emergable on a per-plugin basis -# to solve the problem with gst-plugins generating far too much unneeded deps -# -# 3rd party applications using gstreamer now should depend on a set of plugins as -# defined in the source, obtain recommended plugins to use from -# Gentoo developers responsible for gstreamer <gnome@gentoo.org>, the application developer -# or the gstreamer team. - -inherit eutils versionator gst-plugins10 - -GST_EXPF="src_unpack src_compile src_install" -GST_TARBALL_SUFFIX="bz2" -GST_LA_PUNT="no" -case ${EAPI:-0} in - 4) GST_EXPF="${GST_EXPF} src_configure" - GST_TARBALL_SUFFIX="xz" - GST_LA_PUNT="yes" ;; - 2|3) GST_EXPF="${GST_EXPF} src_configure" ;; - 1|0) ;; - *) die "Unknown EAPI" ;; +# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins-good.eclass,v 1.29 2012/12/02 17:16:20 eva Exp $ + +# @ECLASS: gst-plugins-good.eclass +# @MAINTAINER: +# gstreamer@gentoo.org +# @AUTHOR: +# Gilles Dartiguelongue <eva@gentoo.org> +# Saleem Abdulrasool <compnerd@gentoo.org> +# foser <foser@gentoo.org> +# zaheerm <zaheerm@gentoo.org> +# @BLURB: Manages build for invididual ebuild for gst-plugins-good. +# @DESCRIPTION: +# See gst-plugins10.eclass documentation. + +GST_ORG_MODULE="gst-plugins-good" + +inherit eutils gst-plugins10 + +case "${EAPI:-0}" in + 1|2|3|4|5) + ;; + 0) + die "EAPI=\"${EAPI}\" is not supported anymore" + ;; + *) + die "EAPI=\"${EAPI}\" is not supported yet" + ;; esac -EXPORT_FUNCTIONS ${GST_EXPF} - -### -# variable declarations -### -MY_PN=gst-plugins-good -MY_P=${MY_PN}-${PV} -# All relevant configure options for gst-plugins -# need a better way to extract these - -# First line for non-plugin build related configure options; second line for -# sys/ plugins; rest is split plugin options in order of ./configure --help output. -# Good ways of validation are seeing diff of old and new configure.ac, and ./configure --help -# -# This list is current to gst-plugins-good-0.10.31: -my_gst_plugins_good="gconftool zlib bz2 -directsound oss oss4 sunaudio osx_audio osx_video gst_v4l2 x xshm xvideo -aalib aalibtest annodex cairo esd esdtest flac gconf gdk_pixbuf hal jpeg -libcaca libdv libpng pulse dv1394 shout2 soup speex taglib wavpack" - -# When adding conditionals like below, be careful about having leading spaces in concat - -# --enable-shout2test option was removed in 0.10.31 -if ! version_is_at_least "0.10.31"; then - my_gst_plugins_good+=" shout2test" -fi - -# cairooverlay added to the cairo plugin under cairo_gobject -if version_is_at_least "0.10.29"; then - my_gst_plugins_good+=" cairo_gobject" -fi - -# ext/jack moved here since 0.10.27 -if version_is_at_least "0.10.27"; then - my_gst_plugins_good+=" jack" -fi - -#SRC_URI="mirror://gnome/sources/gst-plugins/${PV_MAJ_MIN}/${MY_P}.tar.bz2" -SRC_URI="http://gstreamer.freedesktop.org/src/gst-plugins-good/${MY_P}.tar.${GST_TARBALL_SUFFIX}" -[[ ${GST_TARBALL_SUFFIX} = "xz" ]] && DEPEND="${DEPEND} app-arch/xz-utils" - -S=${WORKDIR}/${MY_P} -# added to remove circular deps -# 6/2/2006 - zaheerm -if [ "${PN}" != "${MY_PN}" ]; then -RDEPEND="=media-libs/gst-plugins-base-0.10*" -DEPEND="${RDEPEND} - ${DEPEND} - >=sys-apps/sed-4 - virtual/pkgconfig" +if [[ ${PN} != ${GST_ORG_MODULE} ]]; then # -good-0.10.24 uses orc optionally instead of liboil unconditionally. -# While <0.10.24 configure always checks for liboil, it is linked to only by non-split -# plugins in gst/, so we only builddep for all old packages, and have a RDEPEND in old -# versions of media-libs/gst-plugins-good -if ! version_is_at_least "0.10.24"; then -DEPEND="${DEPEND} >=dev-libs/liboil-0.3.8" +# While <0.10.24 configure always checks for liboil, it is linked to only by +# non-split plugins in gst/, so we only builddep for all old packages, and have +# a RDEPEND in old versions of media-libs/gst-plugins-good + if [[ ${SLOT} = "0.10" ]] && ! version_is_at_least "0.10.24"; then + DEPEND="${DEPEND} >=dev-libs/liboil-0.3.8" + fi fi -RESTRICT=test -fi - -### -# public functions -### - -gst-plugins-good_src_configure() { - - # disable any external plugin besides the plugin we want - local plugin gst_conf - - einfo "Configuring to build ${GST_PLUGINS_BUILD} plugin(s) ..." - - for plugin in ${my_gst_plugins_good}; do - gst_conf="${gst_conf} --disable-${plugin} " - done - - for plugin in ${GST_PLUGINS_BUILD}; do - gst_conf="${gst_conf} --enable-${plugin} " - done - - cd ${S} - econf ${@} --with-package-name="Gentoo GStreamer Ebuild" --with-package-origin="http://www.gentoo.org" ${gst_conf} || die "./configure failure" - -} - -### -# public inheritable functions -### - -gst-plugins-good_src_unpack() { - -# local makefiles - - unpack ${A} - - # Link with the syswide installed gst-libs if needed -# gst-plugins10_find_plugin_dir -# cd ${S} - - # Remove generation of any other Makefiles except the plugin's Makefile -# if [ -d "${S}/sys/${GST_PLUGINS_BUILD_DIR}" ]; then -# makefiles="Makefile sys/Makefile sys/${GST_PLUGINS_BUILD_DIR}/Makefile" -# elif [ -d "${S}/ext/${GST_PLUGINS_BUILD_DIR}" ]; then -# makefiles="Makefile ext/Makefile ext/${GST_PLUGINS_BUILD_DIR}/Makefile" -# fi -# sed -e "s:ac_config_files=.*:ac_config_files='${makefiles}':" \ -# -i ${S}/configure - -} - -gst-plugins-good_src_compile() { - - has src_configure ${GST_EXPF} || gst-plugins-good_src_configure ${@} - - gst-plugins10_find_plugin_dir - emake || die "compile failure" - -} - -gst-plugins-good_src_install() { - - gst-plugins10_find_plugin_dir - einstall || die - [[ ${GST_LA_PUNT} = "yes" ]] && prune_libtool_files --modules - - [[ -e README ]] && dodoc README -} diff --git a/eclass/gst-plugins-ugly.eclass b/eclass/gst-plugins-ugly.eclass index fed1fc905c4d..1a2e9c884b26 100644 --- a/eclass/gst-plugins-ugly.eclass +++ b/eclass/gst-plugins-ugly.eclass @@ -1,146 +1,31 @@ # Copyright 1999-2012 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.24 2012/05/02 18:31:42 jdhore Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins-ugly.eclass,v 1.25 2012/12/02 17:16:20 eva Exp $ -# Author : foser <foser@gentoo.org> +# @ECLASS: gst-plugins-ugly.eclass +# @MAINTAINER: +# gstreamer@gentoo.org +# @AUTHOR: +# Gilles Dartiguelongue <eva@gentoo.org> +# Saleem Abdulrasool <compnerd@gentoo.org> +# foser <foser@gentoo.org> +# zaheerm <zaheerm@gentoo.org> +# @BLURB: Manages build for invididual ebuild for gst-plugins-ugly. +# @DESCRIPTION: +# See gst-plugins10.eclass documentation. -# gst-plugins-ugly eclass -# -# eclass to make external gst-plugins emergable on a per-plugin basis -# to solve the problem with gst-plugins generating far too much unneeded deps -# -# 3rd party applications using gstreamer now should depend on a set of plugins as -# defined in the source, in case of spider usage obtain recommended plugins to use from -# Gentoo developers responsible for gstreamer <gstreamer@gentoo.org>. +GST_ORG_MODULE="gst-plugins-ugly" -inherit eutils versionator gst-plugins10 - - -### -# variable declarations -### - -MY_PN=gst-plugins-ugly -MY_P=${MY_PN}-${PV} - -# All relevant configure options for gst-plugins-ugly -# need a better way to extract these. -my_gst_plugins_ugly="a52dec amrnb amrwb cdio dvdread lame mad mpeg2dec sidplay -twolame x264" - -GST_UGLY_EXPORTED_FUNCTIONS="src_unpack src_compile src_install" +inherit gst-plugins10 case "${EAPI:-0}" in - 0) - if [[ -n ${GST_ORC} ]]; then - die "Usage of IUSE=+orc implying GST_ORC variable without EAPI-1" - fi + 1|2|3|4|5) ;; - 1) + 0) + die "EAPI=\"${EAPI}\" is not supported anymore" ;; *) - die "Unsupported EAPI ${EAPI}" + die "EAPI=\"${EAPI}\" is not supported yet" ;; esac -# exports must be ALWAYS after inherit -EXPORT_FUNCTIONS ${GST_UGLY_EXPORTED_FUNCTIONS} - -# Ensure GST_ORC is set to a default. -GST_ORC=${GST_ORC:-"no"} -if [[ ${GST_ORC} == "yes" ]]; then - IUSE="+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.6 )" - DEPEND="${RDEPEND}" -fi - -# added to remove circular deps -# 6/2/2006 - zaheerm -if [ "${PN}" != "${MY_PN}" ]; then -RDEPEND="${RDEPEND} - =media-libs/gst-plugins-base-0.10*" -DEPEND="${RDEPEND} - >=sys-apps/sed-4 - virtual/pkgconfig" - -RESTRICT=test -fi - -### -# public functions -### - -gst-plugins-ugly_src_configure() { - - # disable any external plugin besides the plugin we want - local plugin gst_conf gst_orc_conf - - einfo "Configuring to build ${GST_PLUGINS_BUILD} plugin(s) ..." - - for plugin in ${my_gst_plugins_ugly}; do - gst_conf="${gst_conf} --disable-${plugin} " - done - - for plugin in ${GST_PLUGINS_BUILD}; do - gst_conf="${gst_conf} --enable-${plugin} " - done - - gst_orc_conf="--disable-orc" - if [[ ${GST_ORC} == "yes" ]]; then - gst_orc_conf="$(use_enable orc)" - fi - - cd ${S} - econf ${gst_orc_conf} ${@} --with-package-name="Gentoo GStreamer Ebuild" --with-package-origin="http://www.gentoo.org" ${gst_conf} || die "./configure failure" - -} - -### -# public inheritable functions -### - -gst-plugins-ugly_src_unpack() { - -# local makefiles - - unpack ${A} - - # Link with the syswide installed gst-libs if needed -# gst-plugins10_find_plugin_dir -# cd ${S} - - # Remove generation of any other Makefiles except the plugin's Makefile -# if [ -d "${S}/sys/${GST_PLUGINS_BUILD_DIR}" ]; then -# makefiles="Makefile sys/Makefile sys/${GST_PLUGINS_BUILD_DIR}/Makefile" -# elif [ -d "${S}/ext/${GST_PLUGINS_BUILD_DIR}" ]; then -# makefiles="Makefile ext/Makefile ext/${GST_PLUGINS_BUILD_DIR}/Makefile" -# fi -# sed -e "s:ac_config_files=.*:ac_config_files='${makefiles}':" \ -# -i ${S}/configure - -} - -gst-plugins-ugly_src_compile() { - - gst-plugins-ugly_src_configure ${@} - - gst-plugins10_find_plugin_dir - emake || die "compile failure" - -} - -gst-plugins-ugly_src_install() { - - gst-plugins10_find_plugin_dir - einstall || die - - [[ -e README ]] && dodoc README -} diff --git a/eclass/gst-plugins10.eclass b/eclass/gst-plugins10.eclass index 42029d3cb285..6e020a80d92f 100644 --- a/eclass/gst-plugins10.eclass +++ b/eclass/gst-plugins10.eclass @@ -1,52 +1,150 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins10.eclass,v 1.7 2012/10/31 01:51:52 tetromino Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins10.eclass,v 1.8 2012/12/02 17:16:20 eva Exp $ -# Author : foser <foser@gentoo.org> - -# gst-plugins eclass +# @ECLASS: gst-plugins10.eclass +# @MAINTAINER: +# gstreamer@gentoo.org +# @AUTHOR: +# Gilles Dartiguelongue <eva@gentoo.org> +# Saleem Abdulrasool <compnerd@gentoo.org> +# foser <foser@gentoo.org> +# zaheerm <zaheerm@gentoo.org> +# @BLURB: Manages build for invididual ebuild for gst-plugins. +# @DESCRIPTION: +# Eclass to make external gst-plugins emergable on a per-plugin basis and +# to solve the problem with gst-plugins generating far too much unneeded +# dependancies. # -# eclass to make external gst-plugins emergable on a per-plugin basis -# to solve the problem with gst-plugins generating far too much unneeded deps +# GStreamer consuming applications should depend on the specific plugins they +# need as defined in their source code. # -# 3rd party applications using gstreamer now should depend on a set of plugins as -# defined in the source, in case of spider usage obtain recommended plugins to use from -# Gentoo developers responsible for gstreamer <gstreamer@gentoo.org> or the application +# In case of spider usage, obtain recommended plugins to use from Gentoo +# developers responsible for gstreamer <gstreamer@gentoo.org> or the application # developer. -inherit eutils versionator - +inherit eutils multilib toolchain-funcs versionator -### -# variable declarations -### +GST_EXPF="" +case "${EAPI:-0}" in + 2|3|4|5) + GST_EXPF="src_configure src_compile src_install" + ;; + 1) + GST_EXPF="src_compile src_install" + ;; + 0) + die "EAPI=\"${EAPI:-0}\" is not supported anymore" + ;; + *) + die "EAPI=\"${EAPI}\" is not supported yet" + ;; +esac +EXPORT_FUNCTIONS ${GST_EXPF} -# Create a major/minor combo for our SLOT and executables suffix -PVP=(${PV//[-\._]/ }) -#PV_MAJ_MIN=${PVP[0]}.${PVP[1]} -PV_MAJ_MIN=$(get_version_component_range '1-2') +# @ECLASS-VARIABLE: GST_LA_PUNT +# @DESCRIPTION: +# Should we delete all the .la files? +# NOT to be used without due consideration. +if has "${EAPI:-0}" 0 1 2 3; then + : ${GST_LA_PUNT:="no"} +else + : ${GST_LA_PUNT:="yes"} +fi -# Extract the plugin to build from the ebuild name -# May be set by an ebuild and contain more than one indentifier, space seperated -# (only src_configure can handle mutiple plugins at this time) +# @ECLASS-VARIABLE: GST_PLUGINS_BUILD +# @DESCRIPTION: +# Defines the plugins to be built. +# May be set by an ebuild and contain more than one indentifier, space +# seperated (only src_configure can handle mutiple plugins at this time). GST_PLUGINS_BUILD=${PN/gst-plugins-/} -# Actual build dir, is the same as the configure switch name most of the time +# @ECLASS-VARIABLE: GST_PLUGINS_BUILD_DIR +# @DESCRIPTION: +# Actual build directory of the plugin. +# Most often the same as the configure switch name. GST_PLUGINS_BUILD_DIR=${PN/gst-plugins-/} -# general common gst-plugins ebuild entries +# @ECLASS-VARIABLE: GST_TARBALL_SUFFIX +# @DESCRIPTION: +# Most projects hosted on gstreamer.freedesktop.org mirrors provide tarballs as +# tar.bz2 or tar.xz. This eclass defaults to bz2 for EAPI 0, 1, 2, 3 and +# defaults to xz for everything else. This is because the gstreamer mirrors +# are moving to only have xz tarballs for new releases. +if has "${EAPI:-0}" 0 1 2 3; then + : ${GST_TARBALL_SUFFIX:="bz2"} +else + : ${GST_TARBALL_SUFFIX:="xz"} +fi + +# Even though xz-utils are in @system, they must still be added to DEPEND; see +# http://archives.gentoo.org/gentoo-dev/msg_a0d4833eb314d1be5d5802a3b710e0a4.xml +if [[ ${GST_TARBALL_SUFFIX} == "xz" ]]; then + DEPEND="${DEPEND} app-arch/xz-utils" +fi + +# @ECLASS-VARIABLE: GST_ORG_MODULE +# @DESCRIPTION: +# Name of the module as hosted on gstreamer.freedesktop.org mirrors. +# Leave unset if package name matches module name. +: ${GST_ORG_MODULE:=$PN} + +# @ECLASS-VARIABLE: GST_ORG_PVP +# @INTERNAL +# @DESCRIPTION: +# Major and minor numbers of the version number. +: ${GST_ORG_PVP:=$(get_version_component_range 1-2)} + + DESCRIPTION="${BUILD_GST_PLUGINS} plugin for gstreamer" HOMEPAGE="http://gstreamer.freedesktop.org/" +SRC_URI="http://gstreamer.freedesktop.org/src/${GST_ORG_MODULE}/${GST_ORG_MODULE}-${PV}.tar.${GST_TARBALL_SUFFIX}" + LICENSE="GPL-2" +SLOT="${GST_ORG_PVP}" -#SRC_URI="mirror://gnome/sources/gst-plugins/${PV_MAJ_MIN}/${MY_P}.tar.bz2" -SLOT=${PV_MAJ_MIN} -### -# internal functions -### +S="${WORKDIR}/${GST_ORG_MODULE}-${PV}" -gst-plugins10_find_plugin_dir() { +RDEPEND=" + >=dev-libs/glib-2.6:2 + media-libs/gstreamer:${SLOT} +" +DEPEND=" + >=sys-apps/sed-4 + virtual/pkgconfig +" + +if [[ ${PN} != ${GST_ORG_MODULE} ]]; then + # Do not run test phase for invididual plugin ebuilds. + RESTRICT="test" + RDEPEND="${RDEPEND} >=media-libs/${GST_ORG_MODULE}-${PV}:${SLOT}" +else + IUSE="nls" + DEPEND="${DEPEND} nls? ( >=sys-devel/gettext-0.17 )" +fi + +#if [[ ${SLOT} == "0.10" ]]; then +# XXX: verify with old ebuilds. +# DEPEND="${DEPEND} dev-libs/liboil" +#fi + +DEPEND="${DEPEND} ${RDEPEND}" + +# @FUNCTION: gst-plugins10_get_plugins +# @INTERNAL +# @DESCRIPTION: +# Get the list of plugins requiring external dependencies. +gst-plugins10_get_plugins() { + # Must be called from src_prepare/src_configure + GST_PLUGINS_LIST=$(sed -rn 's/^AG_GST_CHECK_FEATURE\((\w+),.*/ \1 /p' \ + "${S}"/configure.* | tr '[:upper:]' '[:lower:]') +} +# @FUNCTION: gst-plugins10_find_plugin_dir +# @INTERNAL +# @DESCRIPTION: +# Finds plugin build directory and cd to it. +gst-plugins10_find_plugin_dir() { if [[ ! -d ${S}/ext/${GST_PLUGINS_BUILD_DIR} ]]; then if [[ ! -d ${S}/sys/${GST_PLUGINS_BUILD_DIR} ]]; then ewarn "No such plugin directory" @@ -58,24 +156,121 @@ gst-plugins10_find_plugin_dir() { einfo "Building external plugin ${GST_PLUGINS_BUILD_DIR} ..." cd "${S}"/ext/${GST_PLUGINS_BUILD_DIR} fi - } -### -# public functions -### +# @FUNCTION: gst-plugins10_system_link +# @USAGE: gst-plugins10_system_link gst-libs/gst/audio:gstreamer-audio [...] +# @DESCRIPTION: +# Walks through makefiles in order to make sure build will link against system +# librairies. +# Takes a list of path fragments and corresponding pkgconfig libraries +# separated by colon (:). Will replace the path fragment by the output of +# pkgconfig. +gst-plugins10_system_link() { + local directory libs pkgconfig pc tuple + pkgconfig=$(tc-getPKG_CONFIG) -gst-plugins10_remove_unversioned_binaries() { + gst-plugins10_find_plugin_dir - # remove the unversioned binaries gstreamer provide - # this is to prevent these binaries to be owned by several SLOTs + for tuple in $@ ; do + directory="$(echo ${tuple} | cut -f1 -d':')" + pc="$(echo ${tuple} | cut -f2 -d':')-${SLOT}" + libs="$(${pkgconfig} --libs-only-l ${pc})" + sed -e "s:\$(top_builddir)/${directory}/.*\.la:${libs}:" \ + -i Makefile.am Makefile.in || die + done +} + +# @FUNCTION: gst-plugins10_remove_unversioned_binaries +# @INTERNAL +# @DEPRECATED +# @DESCRIPTION: +# Remove the unversioned binaries gstreamer provides to prevent file collision +# with other slots. +gst-plugins10_remove_unversioned_binaries() { cd "${D}"/usr/bin local gst_bins - for gst_bins in *-${PV_MAJ_MIN}; do + for gst_bins in *-${SLOT} ; do [[ -e ${gst_bins} ]] || continue - rm ${gst_bins/-${PV_MAJ_MIN}/} - einfo "Removed ${gst_bins/-${PV_MAJ_MIN}/}" + rm ${gst_bins/-${SLOT}/} + einfo "Removed ${gst_bins/-${SLOT}/}" done +} + +# @FUNCTION: gst-plugins10_src_configure +gst-plugins10_src_configure() { + local plugin gst_conf + + if has ${EAPI:-0} 0 1 2 3 ; then + gst_conf="${gst_conf} --disable-dependency-tracking" + fi + + if has ${EAPI:-0} 0 1 2 3 4 ; then + gst_conf="${gst_conf} --disable-silent-rules" + fi + gst-plugins10_get_plugins + + for plugin in ${GST_PLUGINS_LIST} ; do + if has ${plugin} ${GST_PLUGINS_BUILD} ; then + gst_conf="${gst_conf} --enable-${plugin}" + else + gst_conf="${gst_conf} --disable-${plugin}" + fi + done + + if grep -q "ORC_CHECK" configure.* ; then + if in_iuse orc ; then + gst_conf="${gst_conf} $(use_enable orc)" + else + gst_conf="${gst_conf} --disable-orc" + fi + fi + + if grep -q "AM_MAINTAINER_MODE" configure.* ; then + gst_conf="${gst_conf} --disable-maintainer-mode" + fi + + if grep -q "disable-schemas-compile" configure ; then + gst_conf="${gst_conf} --disable-schemas-compile" + fi + + if [[ ${PN} == ${GST_ORG_MODULE} ]]; then + gst_conf="${gst_conf} $(use_enable nls)" + fi + + einfo "Configuring to build ${GST_PLUGINS_BUILD} plugin(s) ..." + econf \ + --with-package-name="Gentoo GStreamer ebuild" \ + --with-package-origin="http://www.gentoo.org" \ + ${gst_conf} $@ } + +# @FUNCTION: gst-plugins10_src_compile +gst-plugins10_src_compile() { + has ${EAPI:-0} 0 1 && gst-plugins10_src_configure "$@" + + gst-plugins10_find_plugin_dir + + if has "${EAPI:-0}" 0 1 2 3 ; then + emake || die + else + default + fi +} + +# @FUNCTION: gst-plugins10_src_install +gst-plugins10_src_install() { + gst-plugins10_find_plugin_dir + + if has "${EAPI:-0}" 0 1 2 3 ; then + emake install DESTDIR="${D}" || die + [[ -e README ]] && dodoc README + else + default + fi + + [[ ${GST_LA_PUNT} = "yes" ]] && prune_libtool_files --modules +} + |