[libcamera-devel] [RFC PATCH 1/8] meson: Simplify pkg_mod.generate

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Dec 1 17:50:38 CET 2020


Hi Kieran,

Thank you for the patch.

On Mon, Nov 23, 2020 at 04:43:12PM +0000, Kieran Bingham wrote:
> Later versions of meson allow for the first positional argument to
> specificy the defaults.  Specify the libcamera library as the first
> argument, and remove the filebase.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> ---
>  meson.build | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index 55cf36e15f57..ced4afa7d726 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -146,10 +146,9 @@ run_command('ln', '-fsT', meson.source_root(),
>  configure_file(output : 'config.h', configuration : config_h)
>  
>  pkg_mod = import('pkgconfig')
> -pkg_mod.generate(libraries : libcamera,
> +pkg_mod.generate(libcamera,
>                   version : '1.0',
>                   name : 'libcamera',
> -                 filebase : 'camera',
>                   description : 'Complex Camera Support Library',
>                   subdirs : 'libcamera')
>  

The documentation states

Since 0.46 a StaticLibrary or SharedLibrary object can optionally be
passed as first positional argument. If one is provided a default value
will be provided for all required fields of the pc file:

- install_dir is set to pkgconfig folder in the same location than the
  provided library.
- description is set to the project's name followed by the library's
  name.
- name is set to the library's name.


Is it the "name" argument that can be dropped, not "filebase" ? filebase
seems to default to name, so it would be set to "libcamera", not
"camera". If we drop the name argument then name will default to the
shared library name, which is "camera", and filebase will then default
to name. There thus seems to be a change of behaviour, which should be
documented in the commit message (and verified to ensure it's correct).

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list