[libcamera-devel,9/9] libcamera: Add a check for the yaml module

Message ID 20200923151522.56778-10-ricardo@ribalda.com
State Superseded
Headers show
Series
  • Fix README.rst
Related show

Commit Message

Ricardo Ribalda Sept. 23, 2020, 3:15 p.m. UTC
Yaml is not installed by default, so it needs to be checked during
configuration for its presence.

At this point we are aiming for meson_version >= 0.47, and the python
module detection has been introduced in 0.51, so the fix is added in a
comment under FIXME.

Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
---
 src/libcamera/meson.build | 3 +++
 1 file changed, 3 insertions(+)

Comments

Kieran Bingham Sept. 23, 2020, 8:18 p.m. UTC | #1
On 23/09/2020 16:15, Ricardo Ribalda wrote:
> Yaml is not installed by default, so it needs to be checked during
> configuration for its presence.
> 
> At this point we are aiming for meson_version >= 0.47, and the python
> module detection has been introduced in 0.51, so the fix is added in a
> comment under FIXME.
> 
> Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
> ---
>  src/libcamera/meson.build | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> index 0e6ecf5..43a5fde 100644
> --- a/src/libcamera/meson.build
> +++ b/src/libcamera/meson.build
> @@ -77,6 +77,9 @@ if libudev.found()
>      ])
>  endif
>  
> +#FIXME to be added if we force meson version >= 0.51.0
> +#py = import('python').find_installation('python3', modules : ['yaml'])
> +

Indeed, this came up in a previous discussion somewhere.

Having it as an explicitly disabled addition seems like a good idea to
me - but I'd change FIXME for TODO which is our usual style of stating
something needs to be done later.

With that, I think this is helpful to 'pre-add', and sometime soon I'm
sure we'll end up bumping the meson version.

I'm already working on a patch which would require an as yet unreleased
meson ;-)

So with TODO instead of FIXME:

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

>  gen_controls = files('gen-controls.py')
>  
>  control_sources = []
>
Laurent Pinchart Sept. 24, 2020, 3:01 a.m. UTC | #2
On Wed, Sep 23, 2020 at 09:18:32PM +0100, Kieran Bingham wrote:
> On 23/09/2020 16:15, Ricardo Ribalda wrote:
> > Yaml is not installed by default, so it needs to be checked during
> > configuration for its presence.
> > 
> > At this point we are aiming for meson_version >= 0.47, and the python
> > module detection has been introduced in 0.51, so the fix is added in a
> > comment under FIXME.
> > 
> > Signed-off-by: Ricardo Ribalda <ricardo@ribalda.com>
> > ---
> >  src/libcamera/meson.build | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> > index 0e6ecf5..43a5fde 100644
> > --- a/src/libcamera/meson.build
> > +++ b/src/libcamera/meson.build
> > @@ -77,6 +77,9 @@ if libudev.found()
> >      ])
> >  endif
> >  
> > +#FIXME to be added if we force meson version >= 0.51.0
> > +#py = import('python').find_installation('python3', modules : ['yaml'])
> > +
> 
> Indeed, this came up in a previous discussion somewhere.
> 
> Having it as an explicitly disabled addition seems like a good idea to
> me - but I'd change FIXME for TODO which is our usual style of stating
> something needs to be done later.
> 
> With that, I think this is helpful to 'pre-add', and sometime soon I'm
> sure we'll end up bumping the meson version.

I think we can switch to meson 0.51 already, as it's available in the
stable backports of Debian. I'd then propose merging Ezequiel's patch
that checks for the yaml module, as it has been posted a while ago.

> I'm already working on a patch which would require an as yet unreleased
> meson ;-)
> 
> So with TODO instead of FIXME:
> 
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
>
> >  gen_controls = files('gen-controls.py')
> >  
> >  control_sources = []

Patch

diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index 0e6ecf5..43a5fde 100644
--- a/src/libcamera/meson.build
+++ b/src/libcamera/meson.build
@@ -77,6 +77,9 @@  if libudev.found()
     ])
 endif
 
+#FIXME to be added if we force meson version >= 0.51.0
+#py = import('python').find_installation('python3', modules : ['yaml'])
+
 gen_controls = files('gen-controls.py')
 
 control_sources = []