/[gentoo-x86]/eclass/gst-plugins-ugly.eclass
Gentoo

Contents of /eclass/gst-plugins-ugly.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.21 - (hide annotations) (download)
Mon Dec 27 03:49:34 2010 UTC (3 years, 8 months ago) by leio
Branch: MAIN
Changes since 1.20: +49 -7 lines
Add support for easy handling of orc dependencies in the eclass. This way the ebuild only needs to set EAPI=1 and GST_ORC=yes to get all the orc stuff handled, if said package builds things that have orc optimizations. The main purpose of this is to avoid the USE flag (and extraneous deps, though harmless, as indirectly orc will be needed anyway) in case the split plugin does not have any orc usage yet at all (many will never do, as they just wrap some external library without anything to really optimize). This code will become much simpler once older versions go away from tree and they do not need to be coped for. Also move EXPORT_FUNCTIONS handling around the new EAPI check block, in preparation of future EAPI-2+ support.

1 zaheerm 1.1 # Copyright 1999-2004 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 leio 1.21 # $Header: /var/cvsroot/gentoo-x86/eclass/gst-plugins-ugly.eclass,v 1.20 2010/12/26 04:38:12 leio Exp $
4 zaheerm 1.1
5     # Author : foser <foser@gentoo.org>
6    
7     # gst-plugins-ugly 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 swegener 1.4 # 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 zaheerm 1.1 # or the gstreamer team.
16    
17 leio 1.19 inherit eutils versionator gst-plugins10
18 zaheerm 1.1
19    
20     ###
21     # variable declarations
22     ###
23    
24     MY_PN=gst-plugins-ugly
25     MY_P=${MY_PN}-${PV}
26 leio 1.17 # All relevant configure options for gst-plugins-ugly
27     # need a better way to extract these.
28 leio 1.19 my_gst_plugins_ugly="a52dec amrnb amrwb cdio dvdread lame mad mpeg2dec sidplay
29     twolame x264"
30    
31     # dvdnav and id3tag disabled/removed since -ugly-0.10.13
32     if ! version_is_at_least "0.10.13"; then
33     my_gst_plugins_bad+=" dvdnav id3tag"
34     fi
35 zaheerm 1.1
36 leio 1.21 GST_UGLY_EXPORTED_FUNCTIONS="src_unpack src_compile src_install"
37    
38     case "${EAPI:-0}" in
39     0)
40     if [[ -n ${GST_ORC} ]]; then
41     die "Usage of IUSE=+orc implying GST_ORC variable without EAPI-1"
42     fi
43     ;;
44     1)
45     ;;
46     *)
47     die "Unsupported EAPI ${EAPI}"
48     ;;
49     esac
50    
51     # exports must be ALWAYS after inherit
52     EXPORT_FUNCTIONS ${GST_UGLY_EXPORTED_FUNCTIONS}
53    
54     if version_is_at_least "0.10.16"; then
55     # Ensure GST_ORC is set to a default. This fact is also relied on in
56     # gst-plugins-ugly_src_configure, signalling it's >=0.10.16 and has orc options
57     GST_ORC=${GST_ORC:-"no"}
58     if [[ ${GST_ORC} == "yes" ]]; then
59     IUSE="+orc"
60     fi
61     else
62     unset GST_ORC
63     fi
64    
65 zaheerm 1.1 #SRC_URI="mirror://gnome/sources/gst-plugins/${PV_MAJ_MIN}/${MY_P}.tar.bz2"
66 zaheerm 1.2 SRC_URI="http://gstreamer.freedesktop.org/src/gst-plugins-ugly/${MY_P}.tar.bz2"
67 zaheerm 1.1
68     S=${WORKDIR}/${MY_P}
69    
70 leio 1.21 if [[ ${GST_ORC} == "yes" ]]; then
71     RDEPEND="orc? ( >=dev-lang/orc-0.4.5 )"
72     DEPEND="${RDEPEND}"
73     fi
74    
75 zaheerm 1.5 # added to remove circular deps
76     # 6/2/2006 - zaheerm
77     if [ "${PN}" != "${MY_PN}" ]; then
78 leio 1.21 RDEPEND="${RDEPEND}
79     =media-libs/gst-plugins-base-0.10*"
80 zaheerm 1.1 DEPEND="${RDEPEND}
81 zaheerm 1.7 >=sys-apps/sed-4
82     dev-util/pkgconfig"
83 leio 1.20
84     # -ugly-0.10.16 uses orc optionally instead of liboil unconditionally.
85     # While <0.10.16 configure always checks for liboil, it is linked to only by a52dec,
86     # so we only builddep for all packages, and have a RDEPEND in old gst-plugins-a52dec
87     if ! version_is_at_least "0.10.16"; then
88     DEPEND="${DEPEND} >=dev-libs/liboil-0.3.8"
89     fi
90    
91 tester 1.14 RESTRICT=test
92 zaheerm 1.5 fi
93 zaheerm 1.1
94     ###
95     # public functions
96     ###
97    
98     gst-plugins-ugly_src_configure() {
99 swegener 1.4
100 zaheerm 1.1 # disable any external plugin besides the plugin we want
101 leio 1.21 local plugin gst_conf gst_orc_conf
102 zaheerm 1.1
103     einfo "Configuring to build ${GST_PLUGINS_BUILD} plugin(s) ..."
104    
105 zaheerm 1.2 for plugin in ${my_gst_plugins_ugly}; do
106 zaheerm 1.1 gst_conf="${gst_conf} --disable-${plugin} "
107     done
108 leio 1.18
109 zaheerm 1.1 for plugin in ${GST_PLUGINS_BUILD}; do
110     gst_conf="${gst_conf} --enable-${plugin} "
111     done
112    
113 leio 1.21 gst_orc_conf=""
114     if [[ -n ${GST_ORC} ]]; then
115     if [[ ${GST_ORC} == "yes" ]]; then
116     gst_orc_conf="$(use_enable orc)"
117     else
118     gst_orc_conf="--disable-orc"
119     fi
120     fi
121     #else leave gst_orc_conf empty, as $PV is less than 0.10.16, so no --enable/disable-orc yet
122    
123 zaheerm 1.1 cd ${S}
124 leio 1.21 econf ${gst_orc_conf} ${@} --with-package-name="Gentoo GStreamer Ebuild" --with-package-origin="http://www.gentoo.org" ${gst_conf} || die "./configure failure"
125 zaheerm 1.1
126     }
127    
128     ###
129     # public inheritable functions
130     ###
131    
132     gst-plugins-ugly_src_unpack() {
133    
134 tester 1.13 # local makefiles
135 zaheerm 1.1
136     unpack ${A}
137    
138     # Link with the syswide installed gst-libs if needed
139 tester 1.13 # gst-plugins10_find_plugin_dir
140     # cd ${S}
141 zaheerm 1.1
142     # Remove generation of any other Makefiles except the plugin's Makefile
143 tester 1.13 # if [ -d "${S}/sys/${GST_PLUGINS_BUILD_DIR}" ]; then
144     # makefiles="Makefile sys/Makefile sys/${GST_PLUGINS_BUILD_DIR}/Makefile"
145     # elif [ -d "${S}/ext/${GST_PLUGINS_BUILD_DIR}" ]; then
146     # makefiles="Makefile ext/Makefile ext/${GST_PLUGINS_BUILD_DIR}/Makefile"
147     # fi
148     # sed -e "s:ac_config_files=.*:ac_config_files='${makefiles}':" \
149     # -i ${S}/configure
150 zaheerm 1.1
151     }
152    
153     gst-plugins-ugly_src_compile() {
154    
155     gst-plugins-ugly_src_configure ${@}
156    
157     gst-plugins10_find_plugin_dir
158     emake || die "compile failure"
159    
160     }
161    
162     gst-plugins-ugly_src_install() {
163    
164     gst-plugins10_find_plugin_dir
165     einstall || die
166    
167 drac 1.10 [[ -e README ]] && dodoc README
168 zaheerm 1.1 }

  ViewVC Help
Powered by ViewVC 1.1.20