[{"id":33325,"web_url":"https://patchwork.libcamera.org/comment/33325/","msgid":"<20250210114751.GA8531@pendragon.ideasonboard.com>","date":"2025-02-10T11:47:51","subject":"Re: [PATCH v2] libcamera: meson: Fix libyuv detection","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 Fri, Feb 07, 2025 at 01:50:35PM +0000, Kieran Bingham wrote:\n> From: Dylan Aïssi <dylan.aissi@collabora.com>\n> \n> We already fall back to a subproject to support the libyuv package when\n> it can not be discovered through the usual dependency() mechanism.\n> \n> Unfortunately libyuv may be packaged without any corresponding\n> pkg-config support as can be seen at [0], so further extend the\n> dependency search by using an explicit cxx.find_library() call.\n> \n> [0] https://packages.debian.org/bookworm/amd64/libyuv-dev/filelist\n> \n> Signed-off-by: Dylan Aïssi <dylan.aissi@collabora.com>\n> Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> ---\n> v2:\n> Handle review/suggestion from Barnabás:\n>  - include yuv.h explicitly as a header check\n>  - support the force_fallback_for option.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n>  src/meson.build | 18 ++++++++++++++----\n>  1 file changed, 14 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/meson.build b/src/meson.build\n> index 76198e9535db..b664448699aa 100644\n> --- a/src/meson.build\n> +++ b/src/meson.build\n> @@ -27,10 +27,20 @@ else\n>      ipa_sign_module = false\n>  endif\n>  \n> -# libyuv, used by the Android adaptation layer and the virtual pipeline handler.\n> -# Fallback to a subproject if libyuv isn't found, as it's typically not provided\n> -# by distributions.\n> -libyuv_dep = dependency('libyuv', required : false)\n> +# libyuv, used by the Android adaptation layer and the virtual pipeline\n> +# handler. Fallback to a subproject if libyuv isn't found, as it's typically\n\nNitpicking, no need to reflow the first two lines.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> +# not provided by distributions. Where libyuv is provided by a distribution, it\n> +# may not always supply a pkg-config implementation, requiring cxx.find_library()\n> +# to search for it.\n> +if not get_option('force_fallback_for').contains('libyuv')\n> +    libyuv_dep = dependency('libyuv', required : false)\n> +    if not libyuv_dep.found()\n> +        libyuv_dep = cxx.find_library('yuv', has_headers : 'libyuv.h',\n> +                                      required : false)\n> +    endif\n> +else\n> +    libyuv_dep = dependency('', required : false)\n> +endif\n>  \n>  if (pipelines.contains('virtual') or get_option('android').allowed()) and \\\n>     not libyuv_dep.found()","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 E004EC32F5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 10 Feb 2025 11:48:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B1F4C68615;\n\tMon, 10 Feb 2025 12:48:03 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 40243685CD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 10 Feb 2025 12:48:01 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 81898352;\n\tMon, 10 Feb 2025 12:46:44 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"mfXJyfZi\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1739188004;\n\tbh=AwcksJefLiD2vf6FvjPAVWM1MN2y+3AoL+UCtmxAUgo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=mfXJyfZiA35ncQnRwur4CXHMLay5D/cFfmpUKMwh+1TKZ+a0XbDoML4RoJfSfX8nZ\n\tbvhvYR/C8ThOXAFfBmIiOX9yG+MobeEbNbH9G5VxL5+ZGkcXzhOsneuwcG+SH3k0d9\n\t8N2UfykOV4+0C5t393Tzkf1oUbG2GSSFjSe0/3tA=","Date":"Mon, 10 Feb 2025 13:47:51 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>, Dylan\n\t=?utf-8?b?QcOvc3Np?= <dylan.aissi@collabora.com>","Subject":"Re: [PATCH v2] libcamera: meson: Fix libyuv detection","Message-ID":"<20250210114751.GA8531@pendragon.ideasonboard.com>","References":"<20250207135035.1104174-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20250207135035.1104174-1-kieran.bingham@ideasonboard.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]