[libcamera-devel,2/3] libcamera: Move Header generation utilities to utils

Message ID 20200909130559.1122914-3-kieran.bingham@ideasonboard.com
State Accepted
Headers show
Series
  • Unify utils locations
Related show

Commit Message

Kieran Bingham Sept. 9, 2020, 1:05 p.m. UTC
Move the GPL2 utilities which handle generation of controls, formats and
the top level libcamera header to the utils subtree.

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

Move the GPL2 utility library out of the libcamera source directory
and into the utils subdirectory.
---
 include/libcamera/meson.build               | 6 ------
 src/libcamera/meson.build                   | 2 --
 {src/libcamera => utils}/gen-controls.py    | 0
 {include/libcamera => utils}/gen-formats.py | 0
 {include/libcamera => utils}/gen-header.sh  | 0
 utils/meson.build                           | 9 +++++++++
 6 files changed, 9 insertions(+), 8 deletions(-)
 rename {src/libcamera => utils}/gen-controls.py (100%)
 rename {include/libcamera => utils}/gen-formats.py (100%)
 rename {include/libcamera => utils}/gen-header.sh (100%)

Comments

Laurent Pinchart Sept. 10, 2020, 4:39 a.m. UTC | #1
Hi Kieran,

Thank you for the patch.

On Wed, Sep 09, 2020 at 02:05:58PM +0100, Kieran Bingham wrote:
> Move the GPL2 utilities which handle generation of controls, formats and

s/GPL2/GPLv2/

> the top level libcamera header to the utils subtree.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> Move the GPL2 utility library out of the libcamera source directory
> and into the utils subdirectory.

I think you've mentioned this already :-)

> ---
>  include/libcamera/meson.build               | 6 ------
>  src/libcamera/meson.build                   | 2 --
>  {src/libcamera => utils}/gen-controls.py    | 0
>  {include/libcamera => utils}/gen-formats.py | 0
>  {include/libcamera => utils}/gen-header.sh  | 0
>  utils/meson.build                           | 9 +++++++++
>  6 files changed, 9 insertions(+), 8 deletions(-)
>  rename {src/libcamera => utils}/gen-controls.py (100%)
>  rename {include/libcamera => utils}/gen-formats.py (100%)
>  rename {include/libcamera => utils}/gen-header.sh (100%)
> 
> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build
> index cdb8e0372e77..692931a5a639 100644
> --- a/include/libcamera/meson.build
> +++ b/include/libcamera/meson.build
> @@ -34,8 +34,6 @@ install_headers(libcamera_public_headers,
>  #
>  
>  # control_ids.h and property_ids.h
> -gen_controls = files('../../src/libcamera/gen-controls.py')
> -
>  control_source_files = [
>      'control_ids',
>      'property_ids',
> @@ -57,8 +55,6 @@ endforeach
>  libcamera_public_headers += control_headers
>  
>  # formats.h
> -gen_formats = files('gen-formats.py')
> -
>  formats_h = custom_target('formats_h',
>                            input : files(
>                                '../../src/libcamera/formats.yaml',
> @@ -72,8 +68,6 @@ formats_h = custom_target('formats_h',
>  libcamera_public_headers += formats_h
>  
>  # libcamera.h
> -gen_header = files('gen-header.sh')
> -
>  libcamera_h = custom_target('gen-header',
>                              input : 'meson.build',
>                              output : 'libcamera.h',
> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
> index af2f3d950be6..d54ee979418b 100644
> --- a/src/libcamera/meson.build
> +++ b/src/libcamera/meson.build
> @@ -77,8 +77,6 @@ if libudev.found()
>      ])
>  endif
>  
> -gen_controls = files('gen-controls.py')
> -
>  control_sources = []
>  
>  foreach source : control_source_files
> diff --git a/src/libcamera/gen-controls.py b/utils/gen-controls.py
> similarity index 100%
> rename from src/libcamera/gen-controls.py
> rename to utils/gen-controls.py
> diff --git a/include/libcamera/gen-formats.py b/utils/gen-formats.py
> similarity index 100%
> rename from include/libcamera/gen-formats.py
> rename to utils/gen-formats.py
> diff --git a/include/libcamera/gen-header.sh b/utils/gen-header.sh
> similarity index 100%
> rename from include/libcamera/gen-header.sh
> rename to utils/gen-header.sh
> diff --git a/utils/meson.build b/utils/meson.build
> index c3cd9d69f887..7689790eb1c1 100644
> --- a/utils/meson.build
> +++ b/utils/meson.build
> @@ -1,3 +1,12 @@
>  # SPDX-License-Identifier: CC0-1.0
>  
>  subdir('ipu3')
> +
> +## Generates control_ids.h and property_ids.h

Not just .h but also .cpp. I'm not sure we need to detail this, I would
have gone for

## Code generation
gen_controls = files('gen-controls.py')
gen_formats = files('gen-formats.py')
gen_header = files('gen-header.sh')

But I don't mind either way.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +gen_controls = files('gen-controls.py')
> +
> +## Generates formats.h
> +gen_formats = files('gen-formats.py')
> +
> +## Generates libcamera.h
> +gen_header = files('gen-header.sh')
Kieran Bingham Sept. 10, 2020, 10:39 a.m. UTC | #2
Hi Laurent,

On 10/09/2020 05:39, Laurent Pinchart wrote:
> Hi Kieran,
> 
> Thank you for the patch.
> 
> On Wed, Sep 09, 2020 at 02:05:58PM +0100, Kieran Bingham wrote:
>> Move the GPL2 utilities which handle generation of controls, formats and
> 
> s/GPL2/GPLv2/
> 
>> the top level libcamera header to the utils subtree.
>>
>> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
>>
>> Move the GPL2 utility library out of the libcamera source directory
>> and into the utils subdirectory.
> 
> I think you've mentioned this already :-)

Oops, this was a squash of three near identical patches, looks like I
missed removal of one of the commits messages.

Dropped.


> 
>> ---
>>  include/libcamera/meson.build               | 6 ------
>>  src/libcamera/meson.build                   | 2 --
>>  {src/libcamera => utils}/gen-controls.py    | 0
>>  {include/libcamera => utils}/gen-formats.py | 0
>>  {include/libcamera => utils}/gen-header.sh  | 0
>>  utils/meson.build                           | 9 +++++++++
>>  6 files changed, 9 insertions(+), 8 deletions(-)
>>  rename {src/libcamera => utils}/gen-controls.py (100%)
>>  rename {include/libcamera => utils}/gen-formats.py (100%)
>>  rename {include/libcamera => utils}/gen-header.sh (100%)
>>
>> diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build
>> index cdb8e0372e77..692931a5a639 100644
>> --- a/include/libcamera/meson.build
>> +++ b/include/libcamera/meson.build
>> @@ -34,8 +34,6 @@ install_headers(libcamera_public_headers,
>>  #
>>  
>>  # control_ids.h and property_ids.h
>> -gen_controls = files('../../src/libcamera/gen-controls.py')
>> -
>>  control_source_files = [
>>      'control_ids',
>>      'property_ids',
>> @@ -57,8 +55,6 @@ endforeach
>>  libcamera_public_headers += control_headers
>>  
>>  # formats.h
>> -gen_formats = files('gen-formats.py')
>> -
>>  formats_h = custom_target('formats_h',
>>                            input : files(
>>                                '../../src/libcamera/formats.yaml',
>> @@ -72,8 +68,6 @@ formats_h = custom_target('formats_h',
>>  libcamera_public_headers += formats_h
>>  
>>  # libcamera.h
>> -gen_header = files('gen-header.sh')
>> -
>>  libcamera_h = custom_target('gen-header',
>>                              input : 'meson.build',
>>                              output : 'libcamera.h',
>> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
>> index af2f3d950be6..d54ee979418b 100644
>> --- a/src/libcamera/meson.build
>> +++ b/src/libcamera/meson.build
>> @@ -77,8 +77,6 @@ if libudev.found()
>>      ])
>>  endif
>>  
>> -gen_controls = files('gen-controls.py')
>> -
>>  control_sources = []
>>  
>>  foreach source : control_source_files
>> diff --git a/src/libcamera/gen-controls.py b/utils/gen-controls.py
>> similarity index 100%
>> rename from src/libcamera/gen-controls.py
>> rename to utils/gen-controls.py
>> diff --git a/include/libcamera/gen-formats.py b/utils/gen-formats.py
>> similarity index 100%
>> rename from include/libcamera/gen-formats.py
>> rename to utils/gen-formats.py
>> diff --git a/include/libcamera/gen-header.sh b/utils/gen-header.sh
>> similarity index 100%
>> rename from include/libcamera/gen-header.sh
>> rename to utils/gen-header.sh
>> diff --git a/utils/meson.build b/utils/meson.build
>> index c3cd9d69f887..7689790eb1c1 100644
>> --- a/utils/meson.build
>> +++ b/utils/meson.build
>> @@ -1,3 +1,12 @@
>>  # SPDX-License-Identifier: CC0-1.0
>>  
>>  subdir('ipu3')
>> +
>> +## Generates control_ids.h and property_ids.h
> 
> Not just .h but also .cpp. I'm not sure we need to detail this, I would
> have gone for
> 
> ## Code generation
> gen_controls = files('gen-controls.py')
> gen_formats = files('gen-formats.py')
> gen_header = files('gen-header.sh')
> 
> But I don't mind either way.

I was trying to bring the comments that were adjacent to the original
locations forward with it, but I like your grouping better.

Will update to that.


> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Thanks

> 
>> +gen_controls = files('gen-controls.py')
>> +
>> +## Generates formats.h
>> +gen_formats = files('gen-formats.py')
>> +
>> +## Generates libcamera.h
>> +gen_header = files('gen-header.sh')
>

Patch

diff --git a/include/libcamera/meson.build b/include/libcamera/meson.build
index cdb8e0372e77..692931a5a639 100644
--- a/include/libcamera/meson.build
+++ b/include/libcamera/meson.build
@@ -34,8 +34,6 @@  install_headers(libcamera_public_headers,
 #
 
 # control_ids.h and property_ids.h
-gen_controls = files('../../src/libcamera/gen-controls.py')
-
 control_source_files = [
     'control_ids',
     'property_ids',
@@ -57,8 +55,6 @@  endforeach
 libcamera_public_headers += control_headers
 
 # formats.h
-gen_formats = files('gen-formats.py')
-
 formats_h = custom_target('formats_h',
                           input : files(
                               '../../src/libcamera/formats.yaml',
@@ -72,8 +68,6 @@  formats_h = custom_target('formats_h',
 libcamera_public_headers += formats_h
 
 # libcamera.h
-gen_header = files('gen-header.sh')
-
 libcamera_h = custom_target('gen-header',
                             input : 'meson.build',
                             output : 'libcamera.h',
diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build
index af2f3d950be6..d54ee979418b 100644
--- a/src/libcamera/meson.build
+++ b/src/libcamera/meson.build
@@ -77,8 +77,6 @@  if libudev.found()
     ])
 endif
 
-gen_controls = files('gen-controls.py')
-
 control_sources = []
 
 foreach source : control_source_files
diff --git a/src/libcamera/gen-controls.py b/utils/gen-controls.py
similarity index 100%
rename from src/libcamera/gen-controls.py
rename to utils/gen-controls.py
diff --git a/include/libcamera/gen-formats.py b/utils/gen-formats.py
similarity index 100%
rename from include/libcamera/gen-formats.py
rename to utils/gen-formats.py
diff --git a/include/libcamera/gen-header.sh b/utils/gen-header.sh
similarity index 100%
rename from include/libcamera/gen-header.sh
rename to utils/gen-header.sh
diff --git a/utils/meson.build b/utils/meson.build
index c3cd9d69f887..7689790eb1c1 100644
--- a/utils/meson.build
+++ b/utils/meson.build
@@ -1,3 +1,12 @@ 
 # SPDX-License-Identifier: CC0-1.0
 
 subdir('ipu3')
+
+## Generates control_ids.h and property_ids.h
+gen_controls = files('gen-controls.py')
+
+## Generates formats.h
+gen_formats = files('gen-formats.py')
+
+## Generates libcamera.h
+gen_header = files('gen-header.sh')