Gentoo Archives: gentoo-devhelp

From: Nathan Phillip Brink <binki@g.o>
To: gentoo-devhelp@l.g.o
Subject: Re: [gentoo-devhelp] What's the proper way to depend on gstreamer?
Date: Wed, 06 May 2015 03:34:28
Message-Id: 20150506033412.GI27270@ohnopublishing.net
In Reply to: [gentoo-devhelp] What's the proper way to depend on gstreamer? by Nikos Chantziaras
1 On Mon, May 04, 2015 at 08:10:12AM +0300, Nikos Chantziaras wrote:
2 > Currently, I have an ebuild for a project of mine that needs gstreamer
3 > (1.x) to play videos. I have these deps:
4 >
5 > RDEPEND="(media-libs/gst-plugins-good:1.0
6 > media-plugins/gst-plugins-libav)"
7 >
8 > DEPEND="media-libs/gst-plugins-base:1.0"
9 >
10 > During building, some headers from plugins-base are needed and libraries
11 > from that are linked directly, that's why that's in DEPEND and the
12 > others in RDEPEND.
13 >
14 > However, if the system has no gstreamer installation at all currently,
15 > then this will not install stuff like media-plugins/gst-plugins-pulse,
16 > which might be needed on a PulseAudio-enabled system.
17 >
18 > Should I also depend on media-plugins/gst-plugins-meta in order to make
19 > sure that this gets installed?
20 >
21 > Note that the project in question doesn't care at all about this
22 > low-level stuff. PulseAudio or ALSA for example doesn't matter. All the
23 > project knows about is the gstreamer API, plugins-good and plugins-base.
24 >
25 > Even plugins-libav is not used directly, but is a dep simply because
26 > that's the only way to get gstreamer to *hopefully* play all video
27 > formats correctly (assuming the user hasn't crippled libav by disabling
28 > USE flags in media-video/libav.) I wouldn't know how to prevent that
29 > from happening in the first place; for example, how do I make sure the
30 > ebuild can request all deps in a way that makes playback of H.264 or VC8
31 > or Theora video possible. Again through plugins-meta? That lacks an h264
32 > USE flag though (but does have an "ffmpeg" USE flag which pulls
33 > plugins-libav as a dep.)
34
35 I would just look for an example in the tree that does something with
36 gstreamer. net-im/pidgin-2.10.11 has the following in RDEPEND (which
37 is included in DEPEND). For something like pidgin, where it is known
38 in advance that particular codecs are needed to generally get voice
39 chat support with popular IM networks, it makes sense to force at
40 least support for those codecs.
41
42 gstreamer? ( =media-libs/gstreamer-0.10*
43 =media-libs/gst-plugins-good-0.10*
44 net-libs/farstream:0.1
45 media-plugins/gst-plugins-meta:0.10
46 media-plugins/gst-plugins-gconf:0.10 )
47
48 Mozillaish ebuilds (at least FireFox and SeaMonkey, through
49 mozconfig-v5.36.eclass) have in RDEPEND (which is fully included into
50 DEPEND). It looks like they force the libav plugin, probably it gets
51 support for the popular <video/>/<audio/> stuff through that?
52
53 gstreamer? (
54 >=media-libs/gstreamer-1.2.3:1.0
55 >=media-libs/gst-plugins-base-1.2.3:1.0
56 >=media-libs/gst-plugins-good-1.2.3:1.0
57 >=media-plugins/gst-plugins-libav-1.1.0_pre20130128-r1:1.0
58 )
59
60 If your project can only be useful to users if libav and plugins-good
61 is present, then the in-tree precedents I found suggest you should
62 just go ahead and depend on the codecs. I do like how you are doing
63 better than the tree by only putting the codecs in RDEPEND, I think in
64 rare cases that might give portage the wiggle-room it needs to handle
65 dependencies during world updates, though I’m not sure. It’s being
66 “more correct” and informative, at least ;-). However, be sure that
67 you at least have gst-plugins-base in RDEPEND—even though it is
68 implicitly there through an indirect dependency through
69 gst-plugins-good and gst-plugins-libav, your project *does* directly
70 use gst-plugins-base and should inform portage that it needs to be
71 kept installed.
72
73 However, if your project could conceivably be useful with a more
74 minimal set of gstreamer codecs, it might be nice to give the user
75 more power by putting the default set of codecs behind a
76 default-enabled useflag. Something like:
77
78 IUSE="+gstreamer-codecs"
79
80 COMMON_DEPEND="media-libs/gst-plugins-base:1.0"
81 RDEPEND="${COMMON_DEPEND}
82 gstreamer-codecs? ( media-libs/gst-plugins-good:1.0
83 media-plugins/gst-plugins-libav )"
84 DEPEND="${COMMON_DEPEND}"
85
86 This would enable power users to choose what gstreamer codecs to
87 build, especially if they are targeting something like an embedded
88 system.
89
90 Hopefully I said something wrong that will trigger someone else to
91 provide actual useful information ;-).
92
93 --
94 binki
95
96 Look out for missing or extraneous apostrophes!