From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 696731381F3 for ; Sun, 18 Nov 2012 19:08:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3B0CB21C10C; Sun, 18 Nov 2012 19:08:07 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D7F0D21C0FC for ; Sun, 18 Nov 2012 19:07:35 +0000 (UTC) Received: from [192.168.0.53] (nsg93-9-78-225-4-220.fbx.proxad.net [78.225.4.220]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: eva) by smtp.gentoo.org (Postfix) with ESMTPSA id 6A9C133D8AA for ; Sun, 18 Nov 2012 19:07:34 +0000 (UTC) Message-ID: <1353265590.23950.13.camel@kanae> Subject: [gentoo-dev] gstreamer eclass review From: Gilles Dartiguelongue To: gentoo-dev@lists.gentoo.org Date: Sun, 18 Nov 2012 20:06:30 +0100 Organization: Gentoo Content-Type: multipart/mixed; boundary="=-O3W7mTN1GRXDgZpPnQQ+" X-Mailer: Evolution 3.6.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 X-Archives-Salt: 9a878c66-603e-4f10-b1bb-1995f66c510a X-Archives-Hash: 03a336ee56bd48b71ed936ff78a1f015 --=-O3W7mTN1GRXDgZpPnQQ+ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Hi list, gstreamer-1 has been around for some time now and it is needed for gnome 3.6 to enter the tree. Since gstreamer devs have been a bit busy irl, a few guys from gnome herd decided to take a look at it and try to bump everything. I had an itch to scratch wrt current eclass writing so I decided to start with that and bump all plugins using these new eclasses to see how they fare. The results seems to be a lot more pleasant to read and easier to understand. Since this is basically a rewrite, I'll attach the full files for review and three ebuilds using it (one regular plugin, one plugin linking to installed gstreamer libs and one of the ebuilds with no external dependency. The goal of these new eclasses is mainly to drop all revision dependent code while maintaining (to some extent) backward compatibility with 0.10 slot ebuilds. We are currently not planning on dropping the mostly empty eclasses just in case there is a need for pack specific changes in the future. The eclasses were already overlooked by gstreamer herd but I'd like more eyes to go over them beforing pushing this to the tree. Since this is mostly privates eclasses, I'd like to proceed to tree inclusion by next week. There should be little to no breakage and this would help bump last 0.10 releases as well. -- Gilles Dartiguelongue Gentoo --=-O3W7mTN1GRXDgZpPnQQ+ Content-Disposition: attachment; filename="gst-plugins10.eclass" Content-Type: text/plain; name="gst-plugins10.eclass"; charset="UTF-8" Content-Transfer-Encoding: 7bit # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # @ECLASS: gst-plugins10.eclass # @MAINTAINER: # gstreamer@gentoo.org # @AUTHOR: # Gilles Dartiguelongue # Saleem Abdulrasool # foser # zaheerm # @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. # # GStreamer consuming applications should depend on the specific plugins they # need as defined in their source code. # # In case of spider usage, obtain recommended plugins to use from Gentoo # developers responsible for gstreamer or the application # developer. # XXX: what was GST_ORC intended for. Isn't it better to leave it to the # ebuild reponsability ? inherit eutils multilib toolchain-funcs versionator GST_EXPF="" case "${EAPI:-0}" in 1|2|3|4|5) GST_EXPF="${GST_EXPF} src_configure src_compile src_install" ;; 0) die "EAPI=\"${EAPI}\" is not supported anymore" ;; *) die "EAPI=\"${EAPI}\" is not supported yet" ;; esac EXPORT_FUNCTIONS ${GST_EXPF} # @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 # @ECLASS-VARIABLE: GST_ORC # @DESCRIPTION: # Ebuild supports dev-lang/orc. : ${GST_ORC:="no"} # @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-/} # @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-/} # @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}" if [[ ${PN} != ${GST_ORG_MODULE} ]]; then # Do not run test phase for invididual plugin ebuilds. RESTRICT="test" fi RDEPEND="${RDEPEND} >=dev-libs/glib-2.6:2 media-libs/gstreamer:${SLOT} " if [[ ${GST_ORC} = "yes" ]]; then IUSE="+orc" RDEPEND="${RDEPEND} orc? ( >=dev-lang/orc-0.4.6 )" #else # XXX: verify with old ebuilds. # DEPEND="${DEPEND} dev-libs/liboil" fi # added to remove circular deps # 6/2/2006 - zaheerm if [[ ${PN} != ${GST_ORG_MODULE} ]]; then RDEPEND="${RDEPEND} media-libs/${GST_ORG_MODULE}:${SLOT}" fi DEPEND="${RDEPEND} ${DEPEND} >=sys-apps/sed-4 >=sys-devel/gettext-0.17 virtual/pkgconfig " S="${WORKDIR}/${GST_ORG_MODULE}-${PV}" # @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" die fi einfo "Building system plugin ${GST_PLUGINS_BUILD_DIR} ..." cd "${S}"/sys/${GST_PLUGINS_BUILD_DIR} else einfo "Building external plugin ${GST_PLUGINS_BUILD_DIR} ..." cd "${S}"/ext/${GST_PLUGINS_BUILD_DIR} fi } # @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_find_plugin_dir 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 *-${SLOT} ; do [[ -e ${gst_bins} ]] || continue rm ${gst_bins/-${SLOT}/} einfo "Removed ${gst_bins/-${SLOT}/}" done } # @FUNCTION: gst-plugins10_src_configure gst-plugins10_src_configure() { local plugin gst_conf gst-plugins10_get_plugins for plugin in ${GST_PLUGINS_LIST} ; do gst_conf="${gst_conf} --disable-${plugin}" done for plugin in ${GST_PLUGINS_BUILD} ; do gst_conf="${gst_conf} --enable-${plugin}" done if grep -q "ORC_CHECK" configure.* ; then if [[ ${GST_ORC} = "yes" ]]; then gst_conf="${gst_conf} $(use_enable orc)" else gst_conf="${gst_conf} --disable-orc" fi else if [[ ${GST_ORC} = "yes" ]]; then eqawarn "This ebuild declares supporting USE=orc but does not." eqawarn "Please report this as a bug at http://bugs.gentoo.org/" 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 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() { 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 } --=-O3W7mTN1GRXDgZpPnQQ+ Content-Disposition: attachment; filename="gst-plugins-bad.eclass" Content-Type: text/plain; name="gst-plugins-bad.eclass"; charset="UTF-8" Content-Transfer-Encoding: 7bit # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # @ECLASS: gst-plugins10-bad.eclass # @MAINTAINER: # gstreamer@gentoo.org # @AUTHOR: # Gilles Dartiguelongue # Saleem Abdulrasool # foser # zaheerm # @BLURB: Manages build for invididual ebuild for gst-plugins-bad. # @DESCRIPTION: # See gst-plugins10.eclass documentation. GST_ORG_MODULE="gst-plugins-bad" 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 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 [[ ${SLOT} = "0.10" ]] && ! version_is_at_least "0.10.20"; then DEPEND="${DEPEND} >=dev-libs/liboil-0.3.8" fi fi --=-O3W7mTN1GRXDgZpPnQQ+ Content-Disposition: attachment; filename="gst-plugins-base.eclass" Content-Type: text/plain; name="gst-plugins-base.eclass"; charset="UTF-8" Content-Transfer-Encoding: 7bit # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # @ECLASS: gst-plugins-base.eclass # @MAINTAINER: # gstreamer@gentoo.org # @AUTHOR: # Gilles Dartiguelongue # Saleem Abdulrasool # foser # zaheerm # @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 --=-O3W7mTN1GRXDgZpPnQQ+ Content-Disposition: attachment; filename="gst-plugins-good.eclass" Content-Type: text/plain; name="gst-plugins-good.eclass"; charset="UTF-8" Content-Transfer-Encoding: 7bit # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # @ECLASS: gst-plugins-good.eclass # @MAINTAINER: # gstreamer@gentoo.org # @AUTHOR: # Gilles Dartiguelongue # Saleem Abdulrasool # foser # zaheerm # @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 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 [[ ${SLOT} = "0.10" ]] && ! version_is_at_least "0.10.24"; then DEPEND="${DEPEND} >=dev-libs/liboil-0.3.8" fi fi --=-O3W7mTN1GRXDgZpPnQQ+ Content-Disposition: attachment; filename="gst-plugins-ugly.eclass" Content-Type: text/plain; name="gst-plugins-ugly.eclass"; charset="UTF-8" Content-Transfer-Encoding: 7bit # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ # @ECLASS: gst-plugins-ugly.eclass # @MAINTAINER: # gstreamer@gentoo.org # @AUTHOR: # Gilles Dartiguelongue # Saleem Abdulrasool # foser # zaheerm # @BLURB: Manages build for invididual ebuild for gst-plugins-ugly. # @DESCRIPTION: # See gst-plugins10.eclass documentation. GST_ORG_MODULE="gst-plugins-ugly" 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 --=-O3W7mTN1GRXDgZpPnQQ+ Content-Disposition: attachment; filename="gst-plugins-libvisual-1.0.2.ebuild" Content-Type: text/plain; name="gst-plugins-libvisual-1.0.2.ebuild"; charset="UTF-8" Content-Transfer-Encoding: 7bit # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="5" inherit gst-plugins-base gst-plugins10 KEYWORDS="~amd64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-fbsd" IUSE="" RDEPEND=">=media-libs/libvisual-0.4 >=media-plugins/libvisual-plugins-0.4" DEPEND="${RDEPEND}" src_prepare() { gst-plugins10_system_link \ gst-libs/gst/audio:gstreamer-audio \ gst-libs/gst/video:gstreamer-video } --=-O3W7mTN1GRXDgZpPnQQ+ Content-Disposition: attachment; filename="gst-plugins-flac-1.0.2.ebuild" Content-Type: text/plain; name="gst-plugins-flac-1.0.2.ebuild"; charset="UTF-8" Content-Transfer-Encoding: 7bit # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="5" inherit gst-plugins-good DESCRIPTION="GStreamer encoder/decoder/tagger for FLAC" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd" IUSE="" RDEPEND=">=media-libs/flac-1.1.4" DEPEND="${RDEPEND}" --=-O3W7mTN1GRXDgZpPnQQ+ Content-Disposition: attachment; filename="gst-plugins-ugly-1.0.2.ebuild" Content-Type: text/plain; name="gst-plugins-ugly-1.0.2.ebuild"; charset="UTF-8" Content-Transfer-Encoding: 7bit # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="5" # order is important, gnome2 after gst-plugins inherit eutils flag-o-matic gst-plugins-ugly gst-plugins10 DESCRIPTION="Basepack of plugins for gstreamer" HOMEPAGE="http://gstreamer.sourceforge.net" LICENSE="GPL-2" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd" IUSE="+orc" RDEPEND=" >=dev-libs/glib-2.32:2 orc? ( >=dev-lang/orc-0.4.16 ) " DEPEND="${RDEPEND} =media-libs/gst-plugins-base-${PV}:${SLOT} >=dev-util/gtk-doc-am-1.12 " DOCS="AUTHORS ChangeLog NEWS README RELEASE" GST_PLUGINS_BUILD="" src_configure() { # gst doesnt handle optimisations well strip-flags replace-flags "-O3" "-O2" filter-flags "-fprefetch-loop-arrays" # see bug 22249 gst-plugins10_src_configure } src_compile() { default } src_install() { default prune_libtool_files --modules } --=-O3W7mTN1GRXDgZpPnQQ+--