[libcamera-devel] py: Fix link generation to __init__.py
diff mbox series

Message ID 20220517171638.19164-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit 9f00e78bf5a6b311c6d0e72b7c79f793863ea942
Headers show
Series
  • [libcamera-devel] py: Fix link generation to __init__.py
Related show

Commit Message

Laurent Pinchart May 17, 2022, 5:16 p.m. UTC
The command to create a symlink to the __init__.py file in the source
directory uses a relative path from the build directory, which hardcodes
the assumption that the build directory is a direct child of the source
directory. This isn't always true. Fix it by using the files() function.

Fixes: 8aa02271fd71 ("Add Python bindings")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/py/libcamera/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 5efb6c8e2acdc2dc9edf1f22f6c2a5818062b69e

Comments

Kieran Bingham May 17, 2022, 5:23 p.m. UTC | #1
Quoting Laurent Pinchart via libcamera-devel (2022-05-17 18:16:38)
> The command to create a symlink to the __init__.py file in the source
> directory uses a relative path from the build directory, which hardcodes
> the assumption that the build directory is a direct child of the source
> directory. This isn't always true. Fix it by using the files() function.
> 
> Fixes: 8aa02271fd71 ("Add Python bindings")
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  src/py/libcamera/meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build
> index 0cd7c75bb86c..2fc2eaec1c82 100644
> --- a/src/py/libcamera/meson.build
> +++ b/src/py/libcamera/meson.build
> @@ -54,7 +54,7 @@ pycamera = shared_module('_libcamera',
>                           dependencies : pycamera_deps,
>                           cpp_args : pycamera_args)
>  
> -run_command('ln', '-fsT', '../../../../src/py/libcamera/__init__.py',
> +run_command('ln', '-fsT', files('__init__.py'),

eep.


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

>              meson.current_build_dir() / '__init__.py',
>              check: true)
>  
> 
> base-commit: 5efb6c8e2acdc2dc9edf1f22f6c2a5818062b69e
> -- 
> Regards,
> 
> Laurent Pinchart
>
Tomi Valkeinen May 17, 2022, 5:24 p.m. UTC | #2
On 17/05/2022 20:16, Laurent Pinchart wrote:
> The command to create a symlink to the __init__.py file in the source
> directory uses a relative path from the build directory, which hardcodes
> the assumption that the build directory is a direct child of the source
> directory. This isn't always true. Fix it by using the files() function.
> 
> Fixes: 8aa02271fd71 ("Add Python bindings")
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>   src/py/libcamera/meson.build | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build
> index 0cd7c75bb86c..2fc2eaec1c82 100644
> --- a/src/py/libcamera/meson.build
> +++ b/src/py/libcamera/meson.build
> @@ -54,7 +54,7 @@ pycamera = shared_module('_libcamera',
>                            dependencies : pycamera_deps,
>                            cpp_args : pycamera_args)
>   
> -run_command('ln', '-fsT', '../../../../src/py/libcamera/__init__.py',
> +run_command('ln', '-fsT', files('__init__.py'),
>               meson.current_build_dir() / '__init__.py',
>               check: true)
>   
> 
> base-commit: 5efb6c8e2acdc2dc9edf1f22f6c2a5818062b69e

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

  Tomi

Patch
diff mbox series

diff --git a/src/py/libcamera/meson.build b/src/py/libcamera/meson.build
index 0cd7c75bb86c..2fc2eaec1c82 100644
--- a/src/py/libcamera/meson.build
+++ b/src/py/libcamera/meson.build
@@ -54,7 +54,7 @@  pycamera = shared_module('_libcamera',
                          dependencies : pycamera_deps,
                          cpp_args : pycamera_args)
 
-run_command('ln', '-fsT', '../../../../src/py/libcamera/__init__.py',
+run_command('ln', '-fsT', files('__init__.py'),
             meson.current_build_dir() / '__init__.py',
             check: true)