[libcamera-devel] [PATCH v3] meson: Set a SONAME version in the libcamera libraries

Javier Martinez Canillas javierm at redhat.com
Tue Sep 28 08:15:18 CEST 2021


The libcamera and libcamera-base libraries are currently unversioned, but
donwstream users expect these to have a proper SONAME version in order to
package them.

A stable release has not yet happened because the project is still under
development and the API/ABI might change. But having a versioned SONAME
would allow distributions to package libcamera, without the need to add
any downstream patch to set the version.

Since the "0.0.0" version is already used in different places, let's also
use that as the library version. The meson build system will use the first
part of the version ("0") as the SONAME version, which is aligned with the
convention used by other projects:

$ ls /lib64/libcamera*so* -1
/lib64/libcamera-base.so
/lib64/libcamera-base.so.0
/lib64/libcamera-base.so.0.0.0
/lib64/libcamera.so
/lib64/libcamera.so.0
/lib64/libcamera.so.0.0.0

$ objdump -p /lib64/libcamera.so.0.0.0 | grep SONAME
  SONAME               libcamera.so.0

Signed-off-by: Javier Martinez Canillas <javierm at redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---

Changes in v3:
- Drop soversion since meson has a good default as suggested by Laurent
  and reword commit message accordingly.
- Add Laurent Reviewed-by tag.

Changes in v2:
- Drop the RFC prefix since other folks agree with the approach.
- Fix wording in commit message as pointed out by Paul Elder.
- Add Kieran and Paul Reviewed-by tags.

 src/libcamera/base/meson.build | 1 +
 src/libcamera/meson.build      | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/libcamera/base/meson.build b/src/libcamera/base/meson.build
index 8e125744d82..d17249a023e 100644
--- a/src/libcamera/base/meson.build
+++ b/src/libcamera/base/meson.build
@@ -29,6 +29,7 @@ libcamera_base_args = [ '-DLIBCAMERA_BASE_PRIVATE' ]
 
 libcamera_base_lib = shared_library('libcamera-base',
                                     [libcamera_base_sources, libcamera_base_headers],
+                                    version : libcamera_version,
                                     name_prefix : '',
                                     install : true,
                                     cpp_args : libcamera_base_args,
diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index bf82d38be75..243dd3c180e 100644
--- a/src/libcamera/meson.build
+++ b/src/libcamera/meson.build
@@ -128,6 +128,7 @@ libcamera_deps = [
 
 libcamera = shared_library('libcamera',
                            libcamera_sources,
+                           version : libcamera_version,
                            name_prefix : '',
                            install : true,
                            include_directories : includes,
-- 
2.31.1



More information about the libcamera-devel mailing list