Introducing gst-conan

Nicolas Dufresne nicolas at ndufresne.ca
Thu Oct 4 15:37:49 UTC 2018


Le jeudi 04 octobre 2018 à 08:25 -0700, David Ing a écrit :
> Oops ... In the prior email, I was talking about "ldconfig" where I meant to say "make install && ldconfig".
> 
> Just to elaborate on this some more:  I have some example projects which consume gst-editing-services.  In order to run the executable build output, I need to use a script which defines a few environment variables.  The script file is automatically generated by gst-conan:
> 
> #!/bin/bash
> 
> thisFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
> 
> export GST_PLUGIN_PATH=/home/ding/.conan/data/gst-editing-services/1.14.3/my_conan_user/my_conan_channel/package/fca34e783d0d7fe020f0afd08ea6cec145c5e7f8/plugins:/home/ding/.conan/data/gst-plugins-good/1.14.3/my_conan_user/my_conan_channel/package/fca34e783d0d7fe020f0afd08ea6cec145c5e7f8/plugins:/home/ding/.conan/data/gst-plugins-bad/1.14.3/my_conan_user/my_conan_channel/package/fca34e783d0d7fe020f0afd08ea6cec145c5e7f8/plugins:/home/ding/.conan/data/gst-plugins-ugly/1.14.3/my_conan_user/my_conan_channel/package/fca34e783d0d7fe020f0afd08ea6cec145c5e7f8/plugins:/home/ding/.conan/data/gst-libav/1.14.3/my_conan_user/my_conan_channel/package/fca34e783d0d7fe020f0afd08ea6cec145c5e7f8/plugins:/home/ding/.conan/data/gst-plugins-base/1.14.3/my_conan_user/my_conan_channel/package/1010277bd962c74fe8b33f2280b3c0af94266416/plugins:/home/ding/.conan/data/gstreamer/1.14.3/my_conan_user/my_conan_channel/package/69f10d1e6d78c1962fbe8fb80440f32b1fdf8423/plugins
> export GST_PLUGIN_SCANNER=/home/ding/.conan/data/gstreamer/1.14.3/my_conan_user/my_conan_channel/package/69f10d1e6d78c1962fbe8fb80440f32b1fdf8423/bin/gst-plugin-scanner
> export LD_LIBRARY_PATH=/home/ding/.conan/data/gst-editing-services/1.14.3/my_conan_user/my_conan_channel/package/fca34e783d0d7fe020f0afd08ea6cec145c5e7f8/lib:/home/ding/.conan/data/gst-plugins-good/1.14.3/my_conan_user/my_conan_channel/package/fca34e783d0d7fe020f0afd08ea6cec145c5e7f8/lib:/home/ding/.conan/data/gst-plugins-bad/1.14.3/my_conan_user/my_conan_channel/package/fca34e783d0d7fe020f0afd08ea6cec145c5e7f8/lib:/home/ding/.conan/data/gst-plugins-ugly/1.14.3/my_conan_user/my_conan_channel/package/fca34e783d0d7fe020f0afd08ea6cec145c5e7f8/lib:/home/ding/.conan/data/gst-libav/1.14.3/my_conan_user/my_conan_channel/package/fca34e783d0d7fe020f0afd08ea6cec145c5e7f8/lib:/home/ding/.conan/data/gst-plugins-base/1.14.3/my_conan_user/my_conan_channel/package/1010277bd962c74fe8b33f2280b3c0af94266416/lib:/home/ding/.conan/data/gstreamer/1.14.3/my_conan_user/my_conan_channel/package/69f10d1e6d78c1962fbe8fb80440f32b1fdf8423/lib:$LD_LIBRARY_PATH
> 
> exec $thisFolder/consume-ges "$@"

I see, so the run-time technique is different, as it assembled the
flavour you need at run-time. The env are closer to what gst-uninstall
would create (while gst-env in cerbero is static). Just for
clarification, Cerbero also supports CMAKE and MESON these days.
Though, clearly is not meant to be an echo-system, just an internal
tool we use to create and test builds with required deps.

I think it's interesting, as we can quickly see the differences between
two frameworks building GStreamer. As an example, a cerbero receipe is
much simplier then a conan scripts. But conan provides could storage
for pre-builds, and allow creating per configuration builds (rather
then per architecture like in cerbero).

Again, thanks for sharing this!

> 
> On Wed, Oct 3, 2018 at 4:50 PM David Ing <ding at panopto.com> wrote:
> > By the way, I am planning to record a video tutorial of Conan and gst-conan ... but we are a couple months away from that.  For now, I'll give you my long-winded analysis:
> > 
> > I think Cerbero uses AutoTools and perhaps ldconfig, whereas gst-conan and gst-build both both use Meson.
> > 
> > Cerbero is better than Gst-Conan in many important ways.
> > Cerbero can build for Windows and Mac (Gst-Conan is Linux only ... for now ... although Conan works on any platform)
> > Cerbero can do cross-compilation (Gst-Conan might be able to do this ... with some coaxing ... I'm not sure right now)
> > Cerbero can produce debian and rpm packages (Gst-Conan has a roadmap ... we might produce `snap` packages if we get around to it ... distant future)
> > But, gst-conan is special because it uses Conan to organize packages on any machine.  Conan behaves a bit like `ldconfig` in that sense, but Conan is more sophisticated (in my opinion).  For example, when I created the "gstreamer" package, I gave Conan a whole bunch of options which identify that package.
> > 
> > > name = gstreamer
> > > version = 1.14.3
> > > user = my_conan_user
> > > channel = my_conan_channel
> > > 
> > > os = linux
> > > arch = x86_64
> > > build_type = Debug
> > > compiler = gcc
> > > ... (you can define as many options as you want)
> > 
> > Conan stores the package on my system in a very specific location (where the first 4 options are explicitly part of the package path, and the remaining options are hashed):
> > 
> > > ~/.conan/data/gstreamer/1.14.3/my_conan_user/my_conan_channel/package/69f10d1e6d78c1962fbe8fb80440f32b1fdf8423
> > > 
> > 
> > Now that Conan has built the "gstreamer" package and installed it onto my system, I can simply reference the package from another project using the same identifying information (as given above).  I can even change one of the options (e.g. `compiler = clang`) and Conan will try to build the package from a recipe that it stored with the package.  My original recipe was here:  https://github.com/Panopto/gst-conan/blob/master/packages/gstreamer/conanfile.py
> > 
> > But Conan remembers the recipe in a specific location ...
> > 
> > > ~/.conan/data/gstreamer/1.14.3/my_conan_user/my_conan_channel/export/conanfile.py
> > 
> > ... and so it can try to rebuild the package using different options.
> > 
> > There are also common conan packages (e.g. zlib, openssl, boost, poco, ffmpeg, etc ...) that people have built packages for already.  Conan will automatically search https://bintray.com/ for those recipes so you don't even need to worry about building them yourself.
> > 
> > Now I can create my own project (or Meson, AutoTools, whatever) and Conan will expose the dependencies into that build system.
> > cmake example:  https://github.com/Panopto/gst-conan/tree/master/examples/consume-ges-cmake
> > meson example:  https://github.com/Panopto/gst-conan/tree/master/examples/consume-ges-meson
> > If you look at the "conanfile.py" in each example, you will notice that it contains this:
> > > # This is how we declare our dependencies to Conan.  GES will come with transitive dependencies.
> > > # We also need to handle the pkg_config_paths in the `build(self)` method.
> > > requires = ( f"gst-editing-services/{GST_CONAN_VERSION}@{GST_CONAN_USER}/{GST_CONAN_CHANNEL}",
> > >                  f"gst-plugins-good/{GST_CONAN_VERSION}@{GST_CONAN_USER}/{GST_CONAN_CHANNEL}",
> > >                   f"gst-plugins-bad/{GST_CONAN_VERSION}@{GST_CONAN_USER}/{GST_CONAN_CHANNEL}",
> > >                  f"gst-plugins-ugly/{GST_CONAN_VERSION}@{GST_CONAN_USER}/{GST_CONAN_CHANNEL}",
> > >                         f"gst-libav/{GST_CONAN_VERSION}@{GST_CONAN_USER}/{GST_CONAN_CHANNEL}")
> > 
> > Unlike with ldconfig, Conan is suported by https://bintray.com/ ... so packages can be easily fetched from the internet as needed.  (This is similar to Maven and NuGet.)  This makes it easy to integrate with other packages (e.g. zlib, boost, etc.).  Although Cerbero does a beautiful job of defining recipes (allowing 1-off patches and everything), it doesn't have the support of bintray, and it doesn't offer the same elegant model for package management (as described above).
> > 
> > I would love to see the Cerbero folks take an interest in Conan.  I am happy to help in any way I can.
> > 
> > On Wed, Oct 3, 2018 at 3:42 PM Nicolas Dufresne <nicolas at ndufresne.ca> wrote:
> > > 
> > > Le mer. 3 oct. 2018 17 h 57, David Ing <ding at panopto.com> a écrit :
> > > > Gstreamer Community,
> > > > 
> > > > I am pleased to present you with a new open-source project:
> > > > 
> > > > > https://github.com/Panopto/gst-conan
> > > > 
> > > > It is basically a set of Python scripts for creating Conan packages for Gstreamer.
> > > > 
> > > > If you have never heard of Conan before, I think of it as `Maven` or `pip` for native code (https://conan.io/).  We have been using Conan at my company for a couple years and we are very impressed with it.
> > > 
> > > That seems nice. Maybe you could give a brief comparison between Conan and let's say Cerbero ? Obviously it's not the same, but it does a similar task.
> > > 
> > > 
> > > > _______________________________________________
> > > > gstreamer-devel mailing list
> > > > gstreamer-devel at lists.freedesktop.org
> > > > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> > > 
> > > _______________________________________________
> > > gstreamer-devel mailing list
> > > gstreamer-devel at lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> 
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20181004/20bcf3c8/attachment.sig>


More information about the gstreamer-devel mailing list