{"id":2342,"url":"https://patchwork.libcamera.org/api/1.1/patches/2342/?format=json","web_url":"https://patchwork.libcamera.org/patch/2342/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20191120114549.28664-1-ezequiel@collabora.com>","date":"2019-11-20T11:45:49","name":"[libcamera-devel,v2] meson: Define python3 and python3-yaml required dependencies","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"944d03a1d6b50d42a727be3987fecc1f880201cf","submitter":{"id":28,"url":"https://patchwork.libcamera.org/api/1.1/people/28/?format=json","name":"Ezequiel Garcia","email":"ezequiel@collabora.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/2342/mbox/","series":[{"id":573,"url":"https://patchwork.libcamera.org/api/1.1/series/573/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=573","date":"2019-11-20T11:45:49","name":"[libcamera-devel,v2] meson: Define python3 and python3-yaml required dependencies","version":2,"mbox":"https://patchwork.libcamera.org/series/573/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/2342/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/2342/checks/","tags":{},"headers":{"Return-Path":"<ezequiel@collabora.com>","Received":["from bhuna.collabora.co.uk (bhuna.collabora.co.uk\n\t[IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9CAE160C33\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 Nov 2019 12:46:56 +0100 (CET)","from [127.0.0.1] (localhost [127.0.0.1])\n\t(Authenticated sender: ezequiel) with ESMTPSA id DE68229004A"],"From":"Ezequiel Garcia <ezequiel@collabora.com>","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","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2] meson: Define python3 and python3-yaml\n\trequired dependencies","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Wed, 20 Nov 2019 11:46:56 -0000"},"content":"With this change, meson will complain specifically about missing\npython3 and missing python3-yaml. As specified by meson\ndocumentation: https://mesonbuild.com/Python-module.html,\nthis change requires meson v0.51.\n\nSigned-off-by: Ezequiel Garcia <ezequiel@collabora.com>\n---\nv2:\n* Make it optional and rework how it's done.\n\n meson.build               | 15 +++++++++++++++\n src/libcamera/meson.build |  2 ++\n 2 files changed, 17 insertions(+)","diff":"diff --git a/meson.build b/meson.build\nindex 72ad7c8b493b..b7cfbd072421 100644\n--- a/meson.build\n+++ b/meson.build\n@@ -62,6 +62,11 @@ add_project_link_arguments(cpp_arguments, language : 'cpp')\n \n libcamera_includes = include_directories('include')\n \n+# Sub-directories fill py_modules with their\n+# dependencies.\n+\n+py_modules = []\n+\n subdir('include')\n subdir('src')\n subdir('utils')\n@@ -85,3 +90,13 @@ pkg_mod.generate(libraries : libcamera,\n                  name : 'libcamera',\n                  filebase : 'camera',\n                  description : 'Complex Camera Support Library')\n+\n+# Check for python installation and modules.\n+#\n+# This feature requires v0.51, but since we don't\n+# want to force users to upgrade to meson v0.51+,\n+# let's do this optionally.\n+if meson.version().version_compare('>=0.51')\n+    py_mod = import('python')\n+    py_mod.find_installation('python3', modules: py_modules)\n+endif\ndiff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex afbca76968f9..02f5157b7975 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -61,6 +61,8 @@ if libudev.found()\n     ])\n endif\n \n+py_modules += ['yaml']\n+\n gen_controls = files('gen-controls.py')\n \n control_ids_cpp = custom_target('control_ids_cpp',\n","prefixes":["libcamera-devel","v2"]}