Gentoo Archives: gentoo-commits

From: "Gilles Dartiguelongue (eva)" <eva@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog gst-plugins10.eclass
Date: Thu, 31 Jan 2013 19:59:59
Message-Id: 20130131195955.19DCC2171C@flycatcher.gentoo.org
1 eva 13/01/31 19:59:55
2
3 Modified: ChangeLog gst-plugins10.eclass
4 Log:
5 Allow build of multiple plugins in different directories. Make variables more easily override-able.
6
7 Revision Changes Path
8 1.657 eclass/ChangeLog
9
10 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.657&view=markup
11 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.657&content-type=text/plain
12 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.656&r2=1.657
13
14 Index: ChangeLog
15 ===================================================================
16 RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
17 retrieving revision 1.656
18 retrieving revision 1.657
19 diff -u -r1.656 -r1.657
20 --- ChangeLog 31 Jan 2013 14:12:12 -0000 1.656
21 +++ ChangeLog 31 Jan 2013 19:59:54 -0000 1.657
22 @@ -1,6 +1,10 @@
23 # ChangeLog for eclass directory
24 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
25 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.656 2013/01/31 14:12:12 chithanh Exp $
26 +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.657 2013/01/31 19:59:54 eva Exp $
27 +
28 + 31 Jan 2013; Gilles Dartiguelongue <eva@g.o> gst-plugins10.eclass:
29 + Allow build of multiple plugins in different directories. Make variables more
30 + easily override-able.
31
32 31 Jan 2013; Chí-Thanh Christopher Nguyễn <chithanh@g.o>
33 xorg-2.eclass:
34
35
36
37 1.10 eclass/gst-plugins10.eclass
38
39 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/gst-plugins10.eclass?rev=1.10&view=markup
40 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/gst-plugins10.eclass?rev=1.10&content-type=text/plain
41 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/gst-plugins10.eclass?r1=1.9&r2=1.10
42
43 Index: gst-plugins10.eclass
44 ===================================================================
45 RCS file: /var/cvsroot/gentoo-x86/eclass/gst-plugins10.eclass,v
46 retrieving revision 1.9
47 retrieving revision 1.10
48 diff -u -r1.9 -r1.10
49 --- gst-plugins10.eclass 16 Jan 2013 22:52:37 -0000 1.9
50 +++ gst-plugins10.eclass 31 Jan 2013 19:59:54 -0000 1.10
51 @@ -1,6 +1,6 @@
52 # Copyright 1999-2013 Gentoo Foundation
53 # Distributed under the terms of the GNU General Public License v2
54 -# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins10.eclass,v 1.9 2013/01/16 22:52:37 eva Exp $
55 +# $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins10.eclass,v 1.10 2013/01/31 19:59:54 eva Exp $
56
57 # @ECLASS: gst-plugins10.eclass
58 # @MAINTAINER:
59 @@ -58,13 +58,13 @@
60 # Defines the plugins to be built.
61 # May be set by an ebuild and contain more than one indentifier, space
62 # seperated (only src_configure can handle mutiple plugins at this time).
63 -GST_PLUGINS_BUILD=${PN/gst-plugins-/}
64 +: ${GST_PLUGINS_BUILD:=${PN/gst-plugins-/}}
65
66 # @ECLASS-VARIABLE: GST_PLUGINS_BUILD_DIR
67 # @DESCRIPTION:
68 # Actual build directory of the plugin.
69 # Most often the same as the configure switch name.
70 -GST_PLUGINS_BUILD_DIR=${PN/gst-plugins-/}
71 +: ${GST_PLUGINS_BUILD_DIR:=${PN/gst-plugins-/}}
72
73 # @ECLASS-VARIABLE: GST_TARBALL_SUFFIX
74 # @DESCRIPTION:
75 @@ -142,20 +142,24 @@
76 }
77
78 # @FUNCTION: gst-plugins10_find_plugin_dir
79 +# @USAGE: gst-plugins10_find_plugin_dir [<build_dir>]
80 # @INTERNAL
81 # @DESCRIPTION:
82 # Finds plugin build directory and cd to it.
83 +# Defaults to ${GST_PLUGINS_BUILD_DIR} if argument is not provided
84 gst-plugins10_find_plugin_dir() {
85 - if [[ ! -d ${S}/ext/${GST_PLUGINS_BUILD_DIR} ]]; then
86 - if [[ ! -d ${S}/sys/${GST_PLUGINS_BUILD_DIR} ]]; then
87 + local build_dir=${1:-${GST_PLUGINS_BUILD_DIR}}
88 +
89 + if [[ ! -d ${S}/ext/${build_dir} ]]; then
90 + if [[ ! -d ${S}/sys/${build_dir} ]]; then
91 ewarn "No such plugin directory"
92 die
93 fi
94 - einfo "Building system plugin ${GST_PLUGINS_BUILD_DIR} ..."
95 - cd "${S}"/sys/${GST_PLUGINS_BUILD_DIR}
96 + einfo "Building system plugin in ${build_dir}..."
97 + cd "${S}"/sys/${build_dir}
98 else
99 - einfo "Building external plugin ${GST_PLUGINS_BUILD_DIR} ..."
100 - cd "${S}"/ext/${GST_PLUGINS_BUILD_DIR}
101 + einfo "Building external plugin in ${build_dir}..."
102 + cd "${S}"/ext/${build_dir}
103 fi
104 }
105
106 @@ -171,15 +175,16 @@
107 local directory libs pkgconfig pc tuple
108 pkgconfig=$(tc-getPKG_CONFIG)
109
110 - gst-plugins10_find_plugin_dir
111 -
112 - for tuple in $@ ; do
113 - directory="$(echo ${tuple} | cut -f1 -d':')"
114 - pc="$(echo ${tuple} | cut -f2 -d':')-${SLOT}"
115 - libs="$(${pkgconfig} --libs-only-l ${pc})"
116 + for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do
117 + gst-plugins10_find_plugin_dir ${plugin_dir}
118
119 - sed -e "s:\$(top_builddir)/${directory}/.*\.la:${libs}:" \
120 - -i Makefile.am Makefile.in || die
121 + for tuple in $@ ; do
122 + directory="$(echo ${tuple} | cut -f1 -d':')"
123 + pc="$(echo ${tuple} | cut -f2 -d':')-${SLOT}"
124 + libs="$(${pkgconfig} --libs-only-l ${pc})"
125 + sed -e "s:\$(top_builddir)/${directory}/.*\.la:${libs}:" \
126 + -i Makefile.am Makefile.in || die
127 + done
128 done
129 }
130
131 @@ -253,29 +258,37 @@
132 # @DESCRIPTION:
133 # Compiles requested gstreamer plugin.
134 gst-plugins10_src_compile() {
135 + local plugin_dir
136 +
137 has ${EAPI:-0} 0 1 && gst-plugins10_src_configure "$@"
138
139 - gst-plugins10_find_plugin_dir
140 + for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do
141 + gst-plugins10_find_plugin_dir ${plugin_dir}
142
143 - if has "${EAPI:-0}" 0 1 2 3 ; then
144 - emake || die
145 - else
146 - default
147 - fi
148 + if has "${EAPI:-0}" 0 1 2 3 ; then
149 + emake || die
150 + else
151 + default
152 + fi
153 + done
154 }
155
156 # @FUNCTION: gst-plugins10_src_install
157 # @DESCRIPTION:
158 # Installs requested gstreamer plugin.
159 gst-plugins10_src_install() {
160 - gst-plugins10_find_plugin_dir
161 -
162 - if has "${EAPI:-0}" 0 1 2 3 ; then
163 - emake install DESTDIR="${D}" || die
164 - [[ -e README ]] && dodoc README
165 - else
166 - default
167 - fi
168 + local plugin_dir
169 +
170 + for plugin_dir in ${GST_PLUGINS_BUILD_DIR} ; do
171 + gst-plugins10_find_plugin_dir ${plugin_dir}
172 +
173 + if has "${EAPI:-0}" 0 1 2 3 ; then
174 + emake install DESTDIR="${D}" || die
175 + [[ -e README ]] && dodoc README
176 + else
177 + default
178 + fi
179 + done
180
181 [[ ${GST_LA_PUNT} = "yes" ]] && prune_libtool_files --modules
182 }