Introducing gst-conan

David Ing ding at panopto.com
Wed Oct 3 23:50:19 UTC 2018


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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20181003/816b789b/attachment.html>


More information about the gstreamer-devel mailing list