/[gentoo-alt]/trunk/prefix/eclass/gst-plugins.eclass
Gentoo

Contents of /trunk/prefix/eclass/gst-plugins.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 982 - (show annotations) (download)
Thu Feb 2 04:20:17 2006 UTC (13 years, 2 months ago) by kito
File size: 5417 byte(s)
Initial eclass import from gentoo-x86
1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins.eclass,v 1.31 2005/09/09 13:09:28 swegener Exp $
4
5 # Author : foser <foser@gentoo.org>
6
7 # gst-plugins eclass
8 #
9 # eclass to make external gst-plugins emergable on a per-plugin basis
10 # to solve the problem with gst-plugins generating far too much unneeded deps
11 #
12 # 3rd party applications using gstreamer now should depend on a set of plugins as
13 # defined in the source, in case of spider usage obtain recommended plugins to use from
14 # Gentoo developers responsible for gstreamer <gnome@gentoo.org>, the application developer
15 # or the gstreamer team.
16
17 inherit eutils libtool autotools
18
19
20 ###
21 # variable declarations
22 ###
23
24 # Create a major/minor combo for our SLOT and executables suffix
25 PVP=(${PV//[-\._]/ })
26 PV_MAJ_MIN=${PVP[0]}.${PVP[1]}
27
28 MY_P=gst-plugins-${PV}
29
30 # All relevant configure options for gst-plugins
31 # need a better way to extract these
32 # gstreamer 0.6
33 my_gst_plugins="dxr3 oss qcam v4l v4l2 vcd vga cdrom xvideo a52dec aalib aalibtest alsa arts artstest artsc audiofile avifile cdparanoia dvdread dvdnav esd esdtest flac ffmpeg gnome_vfs gsm hermes http jack jpeg ladspa lame lcs libdv libfame libfametest libpng mad mikmod libmikmodtest mjpegtools mpeg2dec openquicktime raw1394 rtp sdl sdltest shout shout2 shout2test sidplay smoothwave snapshot swfdec tarkin vorbis vorbistest xmms libmmx atomic tests examples"
34 # gstreamer 0.8
35 my_gst_plugins="${my_gst_plugins} divx faad gdk_pixbuf ogg sndfile x pango speex xvid mpeg2enc mplex musicbrainz nas librfb libcaca ivorbis faac theora kio osx_audio osx_video sunaudio artsc dts libvisual dirac libmng opengl gst_v4l gst_v4l2 libmms musepack directfb polyp cairo spc wavpack cdio amrnb x264 raw1394"
36
37 # Extract the plugin to build from the ebuild name
38 # May be set by an ebuild and contain more than one indentifier, space seperated
39 # (only src_configure can handle mutiple plugins at this time)
40 GST_PLUGINS_BUILD=${PN/gst-plugins-/}
41
42 # Actual build dir, is the same as the configure switch name most of the time
43 GST_PLUGINS_BUILD_DIR=${PN/gst-plugins-/}
44
45 # general common gst-plugins ebuild entries
46 DESCRIPTION="${BUILD_GST_PLUGINS} plugin for gstreamer"
47 HOMEPAGE="http://gstreamer.freedesktop.org/modules/gst-plugins.html"
48 LICENSE="GPL-2"
49
50 SRC_URI="mirror://gnome/sources/gst-plugins/${PV_MAJ_MIN}/${MY_P}.tar.bz2"
51 SLOT=${PV_MAJ_MIN}
52
53 S=${WORKDIR}/${MY_P}
54
55 RDEPEND="=media-libs/${MY_P}*"
56
57 DEPEND="${RDEPEND}
58 >=sys-apps/sed-4"
59
60 ###
61 # internal functions
62 ###
63
64 gst-plugins_find_plugin_dir() {
65
66 if [ ! -d ${S}/ext/${GST_PLUGINS_BUILD_DIR} ]; then
67 if [ ! -d ${S}/sys/${GST_PLUGINS_BUILD_DIR} ]; then
68 ewarn "No such plugin directory"
69 die
70 fi
71 einfo "Building system plugin ..."
72 cd ${S}/sys/${GST_PLUGINS_BUILD_DIR}
73 else
74 einfo "Building external plugin ..."
75 cd ${S}/ext/${GST_PLUGINS_BUILD_DIR}
76 fi
77
78 }
79
80 ###
81 # public functions
82 ###
83
84 gst-plugins_src_configure() {
85
86 # disable any external plugin besides the plugin we want
87 local plugin gst_conf
88
89 einfo "Configuring to build ${GST_PLUGINS_BUILD} plugin(s) ..."
90
91 for plugin in ${GST_PLUGINS_BUILD}; do
92 my_gst_plugins=${my_gst_plugins/${plugin}/}
93 done
94 for plugin in ${my_gst_plugins}; do
95 gst_conf="${gst_conf} --disable-${plugin} "
96 done
97 for plugin in ${GST_PLUGINS_BUILD}; do
98 gst_conf="${gst_conf} --enable-${plugin} "
99 done
100
101 cd ${S}
102 econf ${@} ${gst_conf} || die "./configure failure"
103
104 }
105
106 gst-plugins_update_registry() {
107
108 einfo "Updating gstreamer plugins registry for gstreamer ${SLOT} ..."
109 gst-register-${SLOT}
110
111 }
112
113 gst-plugins_remove_unversioned_binaries() {
114
115 # remove the unversioned binaries gstreamer provide
116 # this is to prevent these binaries to be owned by several SLOTs
117
118 cd ${D}/usr/bin
119 for gst_bins in `ls *-${PV_MAJ_MIN}`
120 do
121 rm ${gst_bins/-${PV_MAJ_MIN}/}
122 einfo "Removed ${gst_bins/-${PV_MAJ_MIN}/}"
123 done
124
125 }
126
127 ###
128 # public inheritable functions
129 ###
130
131 gst-plugins_src_unpack() {
132
133 local makefiles
134
135 unpack ${A}
136
137 # apply patch to fix broken configure in 0.8.11
138 cd ${S}
139 if [ ${PV} == "0.8.11" ]; then
140 epatch ${FILESDIR}/../../../media-libs/gst-plugins/files/gst-plugins-0.8.11-conffix.patch
141 AT_M4DIR="-I m4 -I common/m4"
142 eautoreconf
143 elibtoolize
144 fi
145
146 # Link with the syswide installed interfaces if needed
147 gst-plugins_find_plugin_dir
148 sed -e "s:\$(top_builddir)/gst-libs/gst/libgstinterfaces:/usr/$(get_libdir)/libgstinterfaces:" \
149 -e "s:\${top_builddir}/gst-libs/gst/libgstinterfaces:/usr/$(get_libdir)/libgstinterfaces:" \
150 -i Makefile.in
151 cd ${S}
152
153 # Remove generation of any other Makefiles except the plugin's Makefile
154 if [ -d "${S}/sys/${GST_PLUGINS_BUILD_DIR}" ]; then
155 makefiles="Makefile sys/Makefile sys/${GST_PLUGINS_BUILD_DIR}/Makefile"
156 elif [ -d "${S}/ext/${GST_PLUGINS_BUILD_DIR}" ]; then
157 makefiles="Makefile ext/Makefile ext/${GST_PLUGINS_BUILD_DIR}/Makefile"
158 fi
159 sed -e "s:ac_config_files=.*:ac_config_files='${makefiles}':" \
160 -i ${S}/configure
161
162 }
163
164 gst-plugins_src_compile() {
165
166 gst-plugins_src_configure ${@}
167
168 gst-plugins_find_plugin_dir
169 emake || die "compile failure"
170
171 }
172
173 gst-plugins_src_install() {
174
175 gst-plugins_find_plugin_dir
176 einstall || die
177
178 dodoc README
179 }
180
181
182 gst-plugins_pkg_postinst() {
183
184 gst-plugins_update_registry
185
186 }
187
188 gst-plugins_pkg_postrm() {
189
190 gst-plugins_update_registry
191
192 }
193
194 EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst pkg_postrm

  ViewVC Help
Powered by ViewVC 1.1.20