[libcamera-devel,RFC,4/8] src: meson: Define system paths
diff mbox series

Message ID 20201123164319.152742-5-kieran.bingham@ideasonboard.com
State Changes Requested
Headers show
Series
  • Configuration files and parsing
Related show

Commit Message

Kieran Bingham Nov. 23, 2020, 4:43 p.m. UTC
Define libcamera specific system paths for use within the library code
base. These can be used to identify system configuration files and
shared data.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/meson.build | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Jacopo Mondi Nov. 24, 2020, 9:26 p.m. UTC | #1
Hi Kieran,

On Mon, Nov 23, 2020 at 04:43:15PM +0000, Kieran Bingham wrote:
> Define libcamera specific system paths for use within the library code
> base. These can be used to identify system configuration files and
> shared data.
>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Looking at this and the following patch, all the here defined
libcamera_$something variables are always used in conjunction with
'prefix'.

Is it worth defining them in that way already ?

> ---
>  src/meson.build | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/src/meson.build b/src/meson.build
> index 8c7449f9b8a0..b1b3514f6ed7 100644
> --- a/src/meson.build
> +++ b/src/meson.build
> @@ -1,5 +1,17 @@
>  # SPDX-License-Identifier: CC0-1.0
>
> +# Handle system paths
> +datadir = get_option('datadir')
> +prefix = get_option('prefix')
> +sysconfdir = get_option('sysconfdir')
> +
> +libcamera_datadir = datadir / 'libcamera'
> +libcamera_sysconfdir = sysconfdir / 'libcamera'
libcamera_datadir = prefix / datadir / 'libcamera'
libcamera_sysconfdir = prefix / sysconfdir / 'libcamera'

same for the libcamera_libdir introduced in the next patch

Anyway, this is better than what we have
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
   j

> +
> +config_h.set('LIBCAMERA_SYSCONF_DIR', '"' + prefix / libcamera_sysconfdir + '"')
> +config_h.set('LIBCAMERA_DATA_DIR', '"' + prefix / libcamera_datadir + '"')
> +
> +# Module Signing
>  openssl = find_program('openssl', required : true)
>  if openssl.found()
>      ipa_priv_key = custom_target('ipa-priv-key',
> --
> 2.25.1
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Kieran Bingham Nov. 25, 2020, 8:47 a.m. UTC | #2
Hi Jacopo,

On 24/11/2020 21:26, Jacopo Mondi wrote:
> Hi Kieran,
> 
> On Mon, Nov 23, 2020 at 04:43:15PM +0000, Kieran Bingham wrote:
>> Define libcamera specific system paths for use within the library code
>> base. These can be used to identify system configuration files and
>> shared data.
>>
>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> Looking at this and the following patch, all the here defined
> libcamera_$something variables are always used in conjunction with
> 'prefix'.
> 
> Is it worth defining them in that way already ?

I would have preferred that, but unfortunately not all uses are with
'prefix'.


in src/ipa/meson.build, the ipa_sign_module part uses ipa_names which
doesn't have prefix ....

AAAAAannndd now I've gone back to re-look at that - I bet that's a bug
anyway ;-) In fact I'm almost certain it is. The install script should
be installing from the installed path.

And if it is - then I can fix that, and them make all the variables
incorporate the prefix directly.

I'll need to run some checks/tests to validate it all though.

Thanks

Kieran


> 
>> ---
>>  src/meson.build | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/src/meson.build b/src/meson.build
>> index 8c7449f9b8a0..b1b3514f6ed7 100644
>> --- a/src/meson.build
>> +++ b/src/meson.build
>> @@ -1,5 +1,17 @@
>>  # SPDX-License-Identifier: CC0-1.0
>>
>> +# Handle system paths
>> +datadir = get_option('datadir')
>> +prefix = get_option('prefix')
>> +sysconfdir = get_option('sysconfdir')
>> +
>> +libcamera_datadir = datadir / 'libcamera'
>> +libcamera_sysconfdir = sysconfdir / 'libcamera'
> libcamera_datadir = prefix / datadir / 'libcamera'
> libcamera_sysconfdir = prefix / sysconfdir / 'libcamera'
> 
> same for the libcamera_libdir introduced in the next patch
> 
> Anyway, this is better than what we have
> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
> 
> Thanks
>    j
> 
>> +
>> +config_h.set('LIBCAMERA_SYSCONF_DIR', '"' + prefix / libcamera_sysconfdir + '"')
>> +config_h.set('LIBCAMERA_DATA_DIR', '"' + prefix / libcamera_datadir + '"')
>> +
>> +# Module Signing
>>  openssl = find_program('openssl', required : true)
>>  if openssl.found()
>>      ipa_priv_key = custom_target('ipa-priv-key',
>> --
>> 2.25.1
>>
>> _______________________________________________
>> libcamera-devel mailing list
>> libcamera-devel@lists.libcamera.org
>> https://lists.libcamera.org/listinfo/libcamera-devel
Laurent Pinchart Dec. 1, 2020, 5:20 p.m. UTC | #3
Hi Kieran,

Thank you for the patch.

On Mon, Nov 23, 2020 at 04:43:15PM +0000, Kieran Bingham wrote:
> Define libcamera specific system paths for use within the library code
> base. These can be used to identify system configuration files and
> shared data.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Could you squash this with 5/8 ? It's harder to review them separately.

> ---
>  src/meson.build | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/src/meson.build b/src/meson.build
> index 8c7449f9b8a0..b1b3514f6ed7 100644
> --- a/src/meson.build
> +++ b/src/meson.build
> @@ -1,5 +1,17 @@
>  # SPDX-License-Identifier: CC0-1.0
>  
> +# Handle system paths
> +datadir = get_option('datadir')
> +prefix = get_option('prefix')
> +sysconfdir = get_option('sysconfdir')
> +
> +libcamera_datadir = datadir / 'libcamera'
> +libcamera_sysconfdir = sysconfdir / 'libcamera'
> +
> +config_h.set('LIBCAMERA_SYSCONF_DIR', '"' + prefix / libcamera_sysconfdir + '"')
> +config_h.set('LIBCAMERA_DATA_DIR', '"' + prefix / libcamera_datadir + '"')
> +
> +# Module Signing
>  openssl = find_program('openssl', required : true)
>  if openssl.found()
>      ipa_priv_key = custom_target('ipa-priv-key',

Patch
diff mbox series

diff --git a/src/meson.build b/src/meson.build
index 8c7449f9b8a0..b1b3514f6ed7 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,5 +1,17 @@ 
 # SPDX-License-Identifier: CC0-1.0
 
+# Handle system paths
+datadir = get_option('datadir')
+prefix = get_option('prefix')
+sysconfdir = get_option('sysconfdir')
+
+libcamera_datadir = datadir / 'libcamera'
+libcamera_sysconfdir = sysconfdir / 'libcamera'
+
+config_h.set('LIBCAMERA_SYSCONF_DIR', '"' + prefix / libcamera_sysconfdir + '"')
+config_h.set('LIBCAMERA_DATA_DIR', '"' + prefix / libcamera_datadir + '"')
+
+# Module Signing
 openssl = find_program('openssl', required : true)
 if openssl.found()
     ipa_priv_key = custom_target('ipa-priv-key',