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

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Dec 1 17:58:51 CET 2020


Hi Kieran,

On Tue, Dec 01, 2020 at 04:56:56PM +0000, Kieran Bingham wrote:
> On 01/12/2020 16:50, Laurent Pinchart wrote:
> > 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).
> 
> 
> I'll have to check, but this was a patch I had stuck around for ages,
> which I created upon a recommendation from one of the meson devs.
> 
> I haven't seen any change in behaviour, but I'll double check again
> later, meanwhile: an install from this build seems to show everything
> still correctly named 'libcamera' ...
> 
> /tmp/libcamera-build-prefix/usr/share/libcamera
> /tmp/libcamera-build-prefix/usr/share/doc/libcamera-0.0.11
> /tmp/libcamera-build-prefix/usr/lib/x86_64-linux-gnu/libcamera.so
> /tmp/libcamera-build-prefix/usr/include/libcamera/libcamera/version.h

I expect this patch to only affect the .pc file generation :-) Could you
diff its contents, and check if its name changes ?

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list