{"id":22066,"url":"https://patchwork.libcamera.org/api/1.1/patches/22066/?format=json","web_url":"https://patchwork.libcamera.org/patch/22066/","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":"<20241125005228.24737-1-laurent.pinchart@ideasonboard.com>","date":"2024-11-25T00:52:28","name":"meson: Don't unnecessarily fallback to libyuv wrap","commit_ref":"e5f8d40bad2a7b050f4653de2d0e309f29c4c40a","pull_url":null,"state":"accepted","archived":false,"hash":"3c376a7c58e3ed1c71268290388cf2ceb6378994","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/22066/mbox/","series":[{"id":4817,"url":"https://patchwork.libcamera.org/api/1.1/series/4817/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4817","date":"2024-11-25T00:52:28","name":"meson: Don't unnecessarily fallback to libyuv wrap","version":1,"mbox":"https://patchwork.libcamera.org/series/4817/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/22066/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/22066/checks/","tags":{},"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 E41FABD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 25 Nov 2024 00:52:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D536066002;\n\tMon, 25 Nov 2024 01:52:41 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 637B165FC6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 25 Nov 2024 01:52:39 +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 D5A4E4AD;\n\tMon, 25 Nov 2024 01:52:17 +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=\"eBau7LXq\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1732495938;\n\tbh=sl7tulU8jmZMjYCZXuuDsQzZ+3s55g6eoN+SEzY44bI=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=eBau7LXqyCTw4X7Dh8aCv8eizStI2Ww9ebd9QPsi48KNS+RSOfXDLG6riOuO7Zwew\n\t21Tnd51UbG7jtlJjBaQBRmSmz510fNB6RgopGvFECWCUuGI/RG1ZGLer9iGhxmiFJB\n\ta9lxniCl+bgbw7ChMKlKMXdhO2lCiDLULI5e/8UQ=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Harvey Yang <chenghaoyang@chromium.org>","Subject":"[PATCH] meson: Don't unnecessarily fallback to libyuv wrap","Date":"Mon, 25 Nov 2024 02:52:28 +0200","Message-ID":"<20241125005228.24737-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.45.2","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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>"},"content":"Before commit eeaa7de21b8c (\"libcamera: pipeline: Add test pattern for\nVirtualPipelineHandler\") the libyuv dependency was only needed for the\nAndroid adaptation layer. As libyuv isn't packaged by most distribution,\nmeson fell back to using a meson wrap if the Android adaptation layer\nwas enabled and the library wasn't found.\n\nWith commit eeaa7de21b8c, libyuv is also used by the virtual pipeline\nhandler, and the meson wrap fallback handling got centralized and became\nunconditional, so the wrap is downloaded even if the components\ndepending on libyuv are all disabled. This causes unnecessary downloads\nat setup time, which can be problematic on build systems without an\ninternet connection.\n\nFix this by making the wrap fallback conditional on the components that\nuse libyuv.\n\nFixes: eeaa7de21b8c (\"libcamera: pipeline: Add test pattern for VirtualPipelineHandler\")\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/android/meson.build | 3 +--\n src/meson.build         | 8 +++++---\n 2 files changed, 6 insertions(+), 5 deletions(-)\n\n\nbase-commit: 9a5f91c78abc8985baff89563992be3644f861b0","diff":"diff --git a/src/android/meson.build b/src/android/meson.build\nindex 6341ee8b0bfb..7b226a4b5d35 100644\n--- a/src/android/meson.build\n+++ b/src/android/meson.build\n@@ -4,6 +4,7 @@ android_deps = [\n     dependency('libexif', required : get_option('android')),\n     dependency('libjpeg', required : get_option('android')),\n     libcamera_private,\n+    libyuv_dep,\n ]\n \n android_enabled = true\n@@ -15,8 +16,6 @@ foreach dep : android_deps\n     endif\n endforeach\n \n-android_deps += [libyuv_dep]\n-\n android_hal_sources = files([\n     'camera3_hal.cpp',\n     'camera_capabilities.cpp',\ndiff --git a/src/meson.build b/src/meson.build\nindex 91bea7753a2e..76198e9535db 100644\n--- a/src/meson.build\n+++ b/src/meson.build\n@@ -27,11 +27,13 @@ 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 \n-# Fallback to a subproject if libyuv isn't found, as it's typically not\n-# provided by distributions.\n-if not libyuv_dep.found()\n+if (pipelines.contains('virtual') or get_option('android').allowed()) and \\\n+   not libyuv_dep.found()\n     cmake = import('cmake')\n \n     libyuv_vars = cmake.subproject_options()\n","prefixes":[]}