/[gentoo-x86]/eclass/gst-plugins10.eclass
Gentoo

Diff of /eclass/gst-plugins10.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.9 Revision 1.12
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2014 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins10.eclass,v 1.9 2013/01/16 22:52:37 eva Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins10.eclass,v 1.12 2014/04/05 09:19:19 tetromino Exp $
4 4
5# @ECLASS: gst-plugins10.eclass 5# @ECLASS: gst-plugins10.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# gstreamer@gentoo.org 7# gstreamer@gentoo.org
8# @AUTHOR: 8# @AUTHOR:
56# @ECLASS-VARIABLE: GST_PLUGINS_BUILD 56# @ECLASS-VARIABLE: GST_PLUGINS_BUILD
57# @DESCRIPTION: 57# @DESCRIPTION:
58# Defines the plugins to be built. 58# Defines the plugins to be built.
59# May be set by an ebuild and contain more than one indentifier, space 59# May be set by an ebuild and contain more than one indentifier, space
60# seperated (only src_configure can handle mutiple plugins at this time). 60# seperated (only src_configure can handle mutiple plugins at this time).
61GST_PLUGINS_BUILD=${PN/gst-plugins-/} 61: ${GST_PLUGINS_BUILD:=${PN/gst-plugins-/}}
62 62
63# @ECLASS-VARIABLE: GST_PLUGINS_BUILD_DIR 63# @ECLASS-VARIABLE: GST_PLUGINS_BUILD_DIR
64# @DESCRIPTION: 64# @DESCRIPTION:
65# Actual build directory of the plugin. 65# Actual build directory of the plugin.
66# Most often the same as the configure switch name. 66# Most often the same as the configure switch name.
67GST_PLUGINS_BUILD_DIR=${PN/gst-plugins-/} 67: ${GST_PLUGINS_BUILD_DIR:=${PN/gst-plugins-/}}
68 68
69# @ECLASS-VARIABLE: GST_TARBALL_SUFFIX 69# @ECLASS-VARIABLE: GST_TARBALL_SUFFIX
70# @DESCRIPTION: 70# @DESCRIPTION:
71# Most projects hosted on gstreamer.freedesktop.org mirrors provide tarballs as 71# Most projects hosted on gstreamer.freedesktop.org mirrors provide tarballs as
72# tar.bz2 or tar.xz. This eclass defaults to bz2 for EAPI 0, 1, 2, 3 and 72# tar.bz2 or tar.xz. This eclass defaults to bz2 for EAPI 0, 1, 2, 3 and
100DESCRIPTION="${BUILD_GST_PLUGINS} plugin for gstreamer" 100DESCRIPTION="${BUILD_GST_PLUGINS} plugin for gstreamer"
101HOMEPAGE="http://gstreamer.freedesktop.org/" 101HOMEPAGE="http://gstreamer.freedesktop.org/"
102SRC_URI="http://gstreamer.freedesktop.org/src/${GST_ORG_MODULE}/${GST_ORG_MODULE}-${PV}.tar.${GST_TARBALL_SUFFIX}" 102SRC_URI="http://gstreamer.freedesktop.org/src/${GST_ORG_MODULE}/${GST_ORG_MODULE}-${PV}.tar.${GST_TARBALL_SUFFIX}"
103 103
104LICENSE="GPL-2" 104LICENSE="GPL-2"
105SLOT="${GST_ORG_PVP}" 105case ${GST_ORG_PVP} in
106 0.10) SLOT="0.10" ;;
107 1.*) SLOT="1.0" ;;
108 *) die "Unkown gstreamer release."
109esac
106 110
107S="${WORKDIR}/${GST_ORG_MODULE}-${PV}" 111S="${WORKDIR}/${GST_ORG_MODULE}-${PV}"
108 112
109RDEPEND=" 113RDEPEND="
110 >=dev-libs/glib-2.6:2 114 >=dev-libs/glib-2.6:2
136# @DESCRIPTION: 140# @DESCRIPTION:
137# Get the list of plugins requiring external dependencies. 141# Get the list of plugins requiring external dependencies.
138gst-plugins10_get_plugins() { 142gst-plugins10_get_plugins() {
139 # Must be called from src_prepare/src_configure 143 # Must be called from src_prepare/src_configure
140 GST_PLUGINS_LIST=$(sed -rn 's/^AG_GST_CHECK_FEATURE\((\w+),.*/ \1 /p' \ 144 GST_PLUGINS_LIST=$(sed -rn 's/^AG_GST_CHECK_FEATURE\((\w+),.*/ \1 /p' \
141 "${S}"/configure.* | tr '[:upper:]' '[:lower:]') 145 "${S}"/configure.* | LC_ALL='C' tr '[:upper:]' '[:lower:]')
142} 146}
143 147
144# @FUNCTION: gst-plugins10_find_plugin_dir 148# @FUNCTION: gst-plugins10_find_plugin_dir
149# @USAGE: gst-plugins10_find_plugin_dir [<build_dir>]
145# @INTERNAL 150# @INTERNAL
146# @DESCRIPTION: 151# @DESCRIPTION:
147# Finds plugin build directory and cd to it. 152# Finds plugin build directory and cd to it.
153# Defaults to ${GST_PLUGINS_BUILD_DIR} if argument is not provided
148gst-plugins10_find_plugin_dir() { 154gst-plugins10_find_plugin_dir() {
149 if [[ ! -d ${S}/ext/${GST_PLUGINS_BUILD_DIR} ]]; then 155 local build_dir=${1:-${GST_PLUGINS_BUILD_DIR}}
150 if [[ ! -d ${S}/sys/${GST_PLUGINS_BUILD_DIR} ]]; then 156
157 if [[ ! -d ${S}/ext/${build_dir} ]]; then
158 if [[ ! -d ${S}/sys/${build_dir} ]]; then
151 ewarn "No such plugin directory" 159 ewarn "No such plugin directory"
152 die 160 die
153 fi 161 fi
154 einfo "Building system plugin ${GST_PLUGINS_BUILD_DIR} ..." 162 einfo "Building system plugin in ${build_dir}..."
155 cd "${S}"/sys/${GST_PLUGINS_BUILD_DIR} 163 cd "${S}"/sys/${build_dir}
156 else 164 else
157 einfo "Building external plugin ${GST_PLUGINS_BUILD_DIR} ..." 165 einfo "Building external plugin in ${build_dir}..."
158 cd "${S}"/ext/${GST_PLUGINS_BUILD_DIR} 166 cd "${S}"/ext/${build_dir}
159 fi 167 fi
160} 168}
161 169
162# @FUNCTION: gst-plugins10_system_link 170# @FUNCTION: gst-plugins10_system_link
163# @USAGE: gst-plugins10_system_link gst-libs/gst/audio:gstreamer-audio [...] 171# @USAGE: gst-plugins10_system_link gst-libs/gst/audio:gstreamer-audio [...]
169# pkgconfig. 177# pkgconfig.
170gst-plugins10_system_link() { 178gst-plugins10_system_link() {
171 local directory libs pkgconfig pc tuple 179 local directory libs pkgconfig pc tuple
172 pkgconfig=$(tc-getPKG_CONFIG) 180 pkgconfig=$(tc-getPKG_CONFIG)
173 181
182 for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do
174 gst-plugins10_find_plugin_dir 183 gst-plugins10_find_plugin_dir ${plugin_dir}
175 184
176 for tuple in $@ ; do 185 for tuple in $@ ; do
177 directory="$(echo ${tuple} | cut -f1 -d':')" 186 directory="$(echo ${tuple} | cut -f1 -d':')"
178 pc="$(echo ${tuple} | cut -f2 -d':')-${SLOT}" 187 pc="$(echo ${tuple} | cut -f2 -d':')-${SLOT}"
179 libs="$(${pkgconfig} --libs-only-l ${pc})" 188 libs="$(${pkgconfig} --libs-only-l ${pc})"
180
181 sed -e "s:\$(top_builddir)/${directory}/.*\.la:${libs}:" \ 189 sed -e "s:\$(top_builddir)/${directory}/.*\.la:${libs}:" \
182 -i Makefile.am Makefile.in || die 190 -i Makefile.am Makefile.in || die
191 done
183 done 192 done
184} 193}
185 194
186# @FUNCTION: gst-plugins10_remove_unversioned_binaries 195# @FUNCTION: gst-plugins10_remove_unversioned_binaries
187# @INTERNAL 196# @INTERNAL
251 260
252# @FUNCTION: gst-plugins10_src_compile 261# @FUNCTION: gst-plugins10_src_compile
253# @DESCRIPTION: 262# @DESCRIPTION:
254# Compiles requested gstreamer plugin. 263# Compiles requested gstreamer plugin.
255gst-plugins10_src_compile() { 264gst-plugins10_src_compile() {
265 local plugin_dir
266
256 has ${EAPI:-0} 0 1 && gst-plugins10_src_configure "$@" 267 has ${EAPI:-0} 0 1 && gst-plugins10_src_configure "$@"
257 268
269 for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do
258 gst-plugins10_find_plugin_dir 270 gst-plugins10_find_plugin_dir ${plugin_dir}
259 271
260 if has "${EAPI:-0}" 0 1 2 3 ; then 272 if has "${EAPI:-0}" 0 1 2 3 ; then
261 emake || die 273 emake || die
262 else 274 else
263 default 275 default
264 fi 276 fi
277 done
265} 278}
266 279
267# @FUNCTION: gst-plugins10_src_install 280# @FUNCTION: gst-plugins10_src_install
268# @DESCRIPTION: 281# @DESCRIPTION:
269# Installs requested gstreamer plugin. 282# Installs requested gstreamer plugin.
270gst-plugins10_src_install() { 283gst-plugins10_src_install() {
284 local plugin_dir
285
286 for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do
271 gst-plugins10_find_plugin_dir 287 gst-plugins10_find_plugin_dir ${plugin_dir}
272 288
273 if has "${EAPI:-0}" 0 1 2 3 ; then 289 if has "${EAPI:-0}" 0 1 2 3 ; then
274 emake install DESTDIR="${D}" || die 290 emake install DESTDIR="${D}" || die
275 [[ -e README ]] && dodoc README 291 [[ -e README ]] && dodoc README
276 else 292 else
277 default 293 default
278 fi 294 fi
295 done
279 296
280 [[ ${GST_LA_PUNT} = "yes" ]] && prune_libtool_files --modules 297 [[ ${GST_LA_PUNT} = "yes" ]] && prune_libtool_files --modules
281} 298}
282 299

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.12

  ViewVC Help
Powered by ViewVC 1.1.20