[{"id":3122,"web_url":"https://patchwork.libcamera.org/comment/3122/","msgid":"<20191121013728.GA4958@pendragon.ideasonboard.com>","date":"2019-11-21T01:37:28","subject":"Re: [libcamera-devel] [PATCH v2] meson: Define python3 and\n\tpython3-yaml required dependencies","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Ezequiel,\n\nThank you for the patch.\n\nOn Wed, Nov 20, 2019 at 08:45:49AM -0300, Ezequiel Garcia wrote:\n> With this change, meson will complain specifically about missing\n> python3 and missing python3-yaml. As specified by meson\n> documentation: https://mesonbuild.com/Python-module.html,\n> this change requires meson v0.51.\n> \n> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>\n> ---\n> v2:\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(+)\n> \n> diff --git a/meson.build b/meson.build\n> index 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\nI think this can fit on a single line. Apart from this, and a similar\ncomment below, the patch looked good to me, until I tried it:\n\nWARNING: Project targetting '>= 0.40' but tried to use feature introduced in '0.46.0': Python Module\nWARNING: Project targetting '>= 0.40' but tried to use feature introduced in '0.51.0': modules arg in python.find_installation\nProgram python3 (yaml) found: YES (/usr/bin/python3) modules: yaml\nBuild targets in project: 66\nWARNING: Project specifies a minimum meson_version '>= 0.40' but uses features which were added in newer versions:\n * 0.46.0: {'Python Module'}\n * 0.51.0: {'modules arg in python.find_installation'}\n\nDoes the issue not occur for you ?\n\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\n> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 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',","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E8BAF60BEA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 21 Nov 2019 02:37:40 +0100 (CET)","from pendragon.ideasonboard.com (unknown [124.219.31.93])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6200B311;\n\tThu, 21 Nov 2019 02:37:39 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1574300260;\n\tbh=eqaqNKNtv1c8Ljz643eoJLMsXWVcHpBTLIrsiTahfVI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=OI6sNY0C50dvXf1/VKG1q6SZv7I6zvslnCfggvbaqUp5RV0ILGovMhJVSW6FvRV8u\n\tZMgZMMbFfEB9sip3/sXvJgJAPRlk6l22DdvxhmQp5Xs1AlfiMkj99aqDSjBV/XWWIZ\n\t/QWijpKSSd1TDG+DpgtvBtm7saOq6wRRbL+N0KR0=","Date":"Thu, 21 Nov 2019 03:37:28 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Ezequiel Garcia <ezequiel@collabora.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20191121013728.GA4958@pendragon.ideasonboard.com>","References":"<20191120114549.28664-1-ezequiel@collabora.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20191120114549.28664-1-ezequiel@collabora.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH v2] meson: Define python3 and\n\tpython3-yaml required 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":"Thu, 21 Nov 2019 01:37:41 -0000"}}]