/[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.10
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 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.10 2013/01/31 19:59:54 eva 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
140 GST_PLUGINS_LIST=$(sed -rn 's/^AG_GST_CHECK_FEATURE\((\w+),.*/ \1 /p' \ 140 GST_PLUGINS_LIST=$(sed -rn 's/^AG_GST_CHECK_FEATURE\((\w+),.*/ \1 /p' \
141 "${S}"/configure.* | tr '[:upper:]' '[:lower:]') 141 "${S}"/configure.* | tr '[:upper:]' '[:lower:]')
142} 142}
143 143
144# @FUNCTION: gst-plugins10_find_plugin_dir 144# @FUNCTION: gst-plugins10_find_plugin_dir
145# @USAGE: gst-plugins10_find_plugin_dir [<build_dir>]
145# @INTERNAL 146# @INTERNAL
146# @DESCRIPTION: 147# @DESCRIPTION:
147# Finds plugin build directory and cd to it. 148# Finds plugin build directory and cd to it.
149# Defaults to ${GST_PLUGINS_BUILD_DIR} if argument is not provided
148gst-plugins10_find_plugin_dir() { 150gst-plugins10_find_plugin_dir() {
149 if [[ ! -d ${S}/ext/${GST_PLUGINS_BUILD_DIR} ]]; then 151 local build_dir=${1:-${GST_PLUGINS_BUILD_DIR}}
150 if [[ ! -d ${S}/sys/${GST_PLUGINS_BUILD_DIR} ]]; then 152
153 if [[ ! -d ${S}/ext/${build_dir} ]]; then
154 if [[ ! -d ${S}/sys/${build_dir} ]]; then
151 ewarn "No such plugin directory" 155 ewarn "No such plugin directory"
152 die 156 die
153 fi 157 fi
154 einfo "Building system plugin ${GST_PLUGINS_BUILD_DIR} ..." 158 einfo "Building system plugin in ${build_dir}..."
155 cd "${S}"/sys/${GST_PLUGINS_BUILD_DIR} 159 cd "${S}"/sys/${build_dir}
156 else 160 else
157 einfo "Building external plugin ${GST_PLUGINS_BUILD_DIR} ..." 161 einfo "Building external plugin in ${build_dir}..."
158 cd "${S}"/ext/${GST_PLUGINS_BUILD_DIR} 162 cd "${S}"/ext/${build_dir}
159 fi 163 fi
160} 164}
161 165
162# @FUNCTION: gst-plugins10_system_link 166# @FUNCTION: gst-plugins10_system_link
163# @USAGE: gst-plugins10_system_link gst-libs/gst/audio:gstreamer-audio [...] 167# @USAGE: gst-plugins10_system_link gst-libs/gst/audio:gstreamer-audio [...]
169# pkgconfig. 173# pkgconfig.
170gst-plugins10_system_link() { 174gst-plugins10_system_link() {
171 local directory libs pkgconfig pc tuple 175 local directory libs pkgconfig pc tuple
172 pkgconfig=$(tc-getPKG_CONFIG) 176 pkgconfig=$(tc-getPKG_CONFIG)
173 177
178 for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do
174 gst-plugins10_find_plugin_dir 179 gst-plugins10_find_plugin_dir ${plugin_dir}
175 180
176 for tuple in $@ ; do 181 for tuple in $@ ; do
177 directory="$(echo ${tuple} | cut -f1 -d':')" 182 directory="$(echo ${tuple} | cut -f1 -d':')"
178 pc="$(echo ${tuple} | cut -f2 -d':')-${SLOT}" 183 pc="$(echo ${tuple} | cut -f2 -d':')-${SLOT}"
179 libs="$(${pkgconfig} --libs-only-l ${pc})" 184 libs="$(${pkgconfig} --libs-only-l ${pc})"
180
181 sed -e "s:\$(top_builddir)/${directory}/.*\.la:${libs}:" \ 185 sed -e "s:\$(top_builddir)/${directory}/.*\.la:${libs}:" \
182 -i Makefile.am Makefile.in || die 186 -i Makefile.am Makefile.in || die
187 done
183 done 188 done
184} 189}
185 190
186# @FUNCTION: gst-plugins10_remove_unversioned_binaries 191# @FUNCTION: gst-plugins10_remove_unversioned_binaries
187# @INTERNAL 192# @INTERNAL
251 256
252# @FUNCTION: gst-plugins10_src_compile 257# @FUNCTION: gst-plugins10_src_compile
253# @DESCRIPTION: 258# @DESCRIPTION:
254# Compiles requested gstreamer plugin. 259# Compiles requested gstreamer plugin.
255gst-plugins10_src_compile() { 260gst-plugins10_src_compile() {
261 local plugin_dir
262
256 has ${EAPI:-0} 0 1 && gst-plugins10_src_configure "$@" 263 has ${EAPI:-0} 0 1 && gst-plugins10_src_configure "$@"
257 264
265 for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do
258 gst-plugins10_find_plugin_dir 266 gst-plugins10_find_plugin_dir ${plugin_dir}
259 267
260 if has "${EAPI:-0}" 0 1 2 3 ; then 268 if has "${EAPI:-0}" 0 1 2 3 ; then
261 emake || die 269 emake || die
262 else 270 else
263 default 271 default
264 fi 272 fi
273 done
265} 274}
266 275
267# @FUNCTION: gst-plugins10_src_install 276# @FUNCTION: gst-plugins10_src_install
268# @DESCRIPTION: 277# @DESCRIPTION:
269# Installs requested gstreamer plugin. 278# Installs requested gstreamer plugin.
270gst-plugins10_src_install() { 279gst-plugins10_src_install() {
280 local plugin_dir
281
282 for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do
271 gst-plugins10_find_plugin_dir 283 gst-plugins10_find_plugin_dir ${plugin_dir}
272 284
273 if has "${EAPI:-0}" 0 1 2 3 ; then 285 if has "${EAPI:-0}" 0 1 2 3 ; then
274 emake install DESTDIR="${D}" || die 286 emake install DESTDIR="${D}" || die
275 [[ -e README ]] && dodoc README 287 [[ -e README ]] && dodoc README
276 else 288 else
277 default 289 default
278 fi 290 fi
291 done
279 292
280 [[ ${GST_LA_PUNT} = "yes" ]] && prune_libtool_files --modules 293 [[ ${GST_LA_PUNT} = "yes" ]] && prune_libtool_files --modules
281} 294}
282 295

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

  ViewVC Help
Powered by ViewVC 1.1.20