From patchwork Wed Nov 20 11:45:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 2342 Return-Path: Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9CAE160C33 for ; Wed, 20 Nov 2019 12:46:56 +0100 (CET) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id DE68229004A From: Ezequiel Garcia To: libcamera-devel@lists.libcamera.org Date: Wed, 20 Nov 2019 08:45:49 -0300 Message-Id: <20191120114549.28664-1-ezequiel@collabora.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2] meson: Define python3 and python3-yaml required dependencies X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Nov 2019 11:46:56 -0000 With this change, meson will complain specifically about missing python3 and missing python3-yaml. As specified by meson documentation: https://mesonbuild.com/Python-module.html, this change requires meson v0.51. Signed-off-by: Ezequiel Garcia --- v2: * Make it optional and rework how it's done. meson.build | 15 +++++++++++++++ src/libcamera/meson.build | 2 ++ 2 files changed, 17 insertions(+) diff --git a/meson.build b/meson.build index 72ad7c8b493b..b7cfbd072421 100644 --- a/meson.build +++ b/meson.build @@ -62,6 +62,11 @@ add_project_link_arguments(cpp_arguments, language : 'cpp') libcamera_includes = include_directories('include') +# Sub-directories fill py_modules with their +# dependencies. + +py_modules = [] + subdir('include') subdir('src') subdir('utils') @@ -85,3 +90,13 @@ pkg_mod.generate(libraries : libcamera, name : 'libcamera', filebase : 'camera', description : 'Complex Camera Support Library') + +# Check for python installation and modules. +# +# This feature requires v0.51, but since we don't +# want to force users to upgrade to meson v0.51+, +# let's do this optionally. +if meson.version().version_compare('>=0.51') + py_mod = import('python') + py_mod.find_installation('python3', modules: py_modules) +endif diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index afbca76968f9..02f5157b7975 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -61,6 +61,8 @@ if libudev.found() ]) endif +py_modules += ['yaml'] + gen_controls = files('gen-controls.py') control_ids_cpp = custom_target('control_ids_cpp',