[{"id":14107,"web_url":"https://patchwork.libcamera.org/comment/14107/","msgid":"<X85/LZEJYLq7HhfQ@pendragon.ideasonboard.com>","date":"2020-12-07T19:14:53","subject":"Re: [libcamera-devel] [PATCH 3/4] src: meson: Define system paths","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Mon, Dec 07, 2020 at 03:07:36PM +0000, Kieran Bingham wrote:\n> Define libcamera specific system paths for use within the library code\n> base. These can be used to identify system configuration files and\n> shared data.\n> \n> Also, make use of the new system path variables and map the ipa paths\n> upon the libcamera system path, making use of the new shorter syntax for\n> join_paths().\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> ---\n> v2:\n>  - Add comments explaining why we can't use prefix throughout\n>  - Squash src/meson and src/ipa/meson changes together\n> \n>  src/ipa/meson.build | 19 ++++++++++---------\n>  src/meson.build     | 14 ++++++++++++++\n>  2 files changed, 24 insertions(+), 9 deletions(-)\n> \n> diff --git a/src/ipa/meson.build b/src/ipa/meson.build\n> index 5a5de267c147..41625ed471bc 100644\n> --- a/src/ipa/meson.build\n> +++ b/src/ipa/meson.build\n> @@ -1,19 +1,17 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>  \n> -ipa_install_dir = join_paths(get_option('libdir'), 'libcamera')\n> -ipa_data_dir = join_paths(get_option('datadir'), 'libcamera', 'ipa')\n> -ipa_sysconf_dir = join_paths(get_option('sysconfdir'), 'libcamera', 'ipa')\n> -\n>  ipa_includes = [\n>      libcamera_includes,\n>  ]\n>  \n> -config_h.set('IPA_CONFIG_DIR',\n> -             '\"' + join_paths(get_option('prefix'), ipa_sysconf_dir) +\n> -             ':' + join_paths(get_option('prefix'), ipa_data_dir) + '\"')\n> +ipa_install_dir = libcamera_libdir\n> +ipa_data_dir = libcamera_datadir / 'ipa'\n> +ipa_sysconf_dir = libcamera_sysconfdir / 'ipa'\n> +\n> +config_h.set('IPA_CONFIG_DIR', '\"' + prefix / ipa_sysconf_dir +\n> +                               ':' + prefix / ipa_data_dir + '\"')\n>  \n> -config_h.set('IPA_MODULE_DIR',\n> -             '\"' + join_paths(get_option('prefix'), ipa_install_dir) + '\"')\n> +config_h.set('IPA_MODULE_DIR', '\"' + prefix / ipa_install_dir + '\"')\n>  subdir('libipa')\n>  \n> @@ -22,6 +20,9 @@ ipa_sign = files('ipa-sign.sh')\n>  ipas = ['raspberrypi', 'rkisp1', 'vimc']\n>  ipa_names = []\n>  \n> +# The ipa-sign-install.sh script which uses the ipa_names variable will itself\n> +# prepend MESON_INSTALL_DESTDIR_PREFIX to each ipa module name, therefore we\n> +# must not include the prefix string here.\n>  foreach pipeline : get_option('pipelines')\n>      if ipas.contains(pipeline)\n>          subdir(pipeline)\n> diff --git a/src/meson.build b/src/meson.build\n> index 4b75f05878bc..f98fcede203b 100644\n> --- a/src/meson.build\n> +++ b/src/meson.build\n> @@ -1,5 +1,19 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>  \n> +# Handle system paths\n> +datadir = get_option('datadir')\n> +libdir = get_option('libdir')\n> +prefix = get_option('prefix')\n> +sysconfdir = get_option('sysconfdir')\n> +\n> +libcamera_datadir = datadir / 'libcamera'\n> +libcamera_libdir = libdir / 'libcamera'\n> +libcamera_sysconfdir = sysconfdir / 'libcamera'\n\nWe could write this\n\nlibcamera_datadir = get_option('datadir') / 'libcamera'\nlibcamera_libdir = get_option('libdir') / 'libcamera'\nlibcamera_sysconfdir = get_option('sysconfdir') / 'libcamera'\n\nto avoid the datadir, libdir and sysconfdir variables that are fairly\ngeneric and could result in namespace clashes later.\n\n> +\n> +config_h.set('LIBCAMERA_DATA_DIR', '\"' + prefix / libcamera_datadir + '\"')\n> +config_h.set('LIBCAMERA_SYSCONF_DIR', '\"' + prefix / libcamera_sysconfdir + '\"')\n\nThose two variables are not used in this patch series, I believe they\nwere introduced to support the configuration file parser. Should they be\nleft out for now ?\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +\n> +# Module Signing\n>  openssl = find_program('openssl', required : true)\n>  if openssl.found()\n>      ipa_priv_key = custom_target('ipa-priv-key',","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 30E38BDB1F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Dec 2020 19:14:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 90F0467E6A;\n\tMon,  7 Dec 2020 20:14:57 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7D1E5635A0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Dec 2020 20:14:56 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DA8188D;\n\tMon,  7 Dec 2020 20:14:55 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"KUEIzvYV\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1607368496;\n\tbh=1P0CGHyQn9K8vYs1yvW631Cz6dFcPhDoT9H5CgJqW0M=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=KUEIzvYVH6NmCfWfM8GlRMKzjim4UFetrHgqtUdmxYDLmH4PyE/vaREk9wd71qMjg\n\tC1qvwXpDYXduuDlm6SFK8U8Bm13kp7WH1mJk4pdP7ruILMjHKqFRVnHt5vDDzKiQr2\n\tVCJHs1qcSZiReVOsuIOtd88RfZYwFNWcVFdWQCEI=","Date":"Mon, 7 Dec 2020 21:14:53 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<X85/LZEJYLq7HhfQ@pendragon.ideasonboard.com>","References":"<20201207150737.307692-1-kieran.bingham@ideasonboard.com>\n\t<20201207150737.307692-4-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20201207150737.307692-4-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 3/4] src: meson: Define system paths","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]