[libcamera-devel] [PATCH] v4l2: Add soversion to the V4L2 layer

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed May 3 14:37:37 CEST 2023


Hi Kieran,

Thank you for the patch.

On Wed, May 03, 2023 at 11:01:40AM +0100, Kieran Bingham via libcamera-devel wrote:
> There may be parallel installations of libcamera with separate
> instances of the v4l2-adaptation layer shared object.

For libcamera, absolutely, but for v4l2-compat.so, the use cases seem
less clear to me.

As discussed on IRC, versioning a library's SONAME is meant for two
purposes as far as I understand: ABI stability for applications linking
to the library, and installing multiple versions of the library side by
side. The first purpose doesn't apply to v4l2-compat.so as nothing will
link to it.

The second purpose could be applicable, but it seems that the use cases
would be a bit far-fetched. To support this properly, you would want to
also support installing multiple versions of libcamerify side by side.

This discussion and patch stem from a Fedora packaging rule that forbids
unversioned shared object libraries in $libdir/ for non -devel packages.
Maybe the patch you sent to move v4l2-compat.so to $libdir/libcamera
could be enough to satisfy the packaging rules, without needing to
version v4l2-compat.so ? Btw, Javier mentioned on IRC it should actually
go to $libexecdir/libcamera, but let's discuss that in the review of
your other patch.

> This shared library can be linked against a specific libcamera
> soversion so provide a soversioned V4L2 compatibility layer.
> 
> Suggested-by: Javier Martinez Canillas <javierm at redhat.com>
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> ---
>  src/v4l2/meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build
> index f132103cb503..48f201c5c3a0 100644
> --- a/src/v4l2/meson.build
> +++ b/src/v4l2/meson.build
> @@ -30,6 +30,7 @@ v4l2_compat_cpp_args = [
>  v4l2_compat = shared_library('v4l2-compat',
>                               v4l2_compat_sources,
>                               name_prefix : '',
> +                             soversion : libcamera_soversion,
>                               install : true,
>                               dependencies : [libcamera_private, libdl],
>                               cpp_args : v4l2_compat_cpp_args)

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list