{"id":15837,"url":"https://patchwork.libcamera.org/api/patches/15837/?format=json","web_url":"https://patchwork.libcamera.org/patch/15837/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20220509222558.31342-1-laurent.pinchart@ideasonboard.com>","date":"2022-05-09T22:25:58","name":"[libcamera-devel] meson: Compile libyaml as a subproject if not available on the system","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"e8f04727315f98433b0bfeda2c09697a9c4f3119","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/15837/mbox/","series":[{"id":3103,"url":"https://patchwork.libcamera.org/api/series/3103/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3103","date":"2022-05-09T22:25:58","name":"[libcamera-devel] meson: Compile libyaml as a subproject if not available on the system","version":1,"mbox":"https://patchwork.libcamera.org/series/3103/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15837/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15837/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 CB76CC3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  9 May 2022 22:26:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1CCC165646;\n\tTue, 10 May 2022 00:26:09 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 07C8860421\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 10 May 2022 00:26:07 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 778A15A4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 10 May 2022 00:26:06 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652135169;\n\tbh=Sfpa/vif6idCc7wbOhqqLAAZnxTfAshMlKWuolhHcGQ=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=W9PHHzDGOo5+y6xG/0UI3nUBgRZ/2VgBVYkeVv/xuj/yZQX+/xINTMMYadZ8vr0gh\n\te2sLUZqhrxbP52p7PNkBkWYt6QvNcliUXAlRS49TsWmqF3yidf93SAM32jMIvxDIgu\n\tMrl1xGDNQzxSJnIix96xwB7nGjM+sHmDsjsrnxuFM75CiOz0ZPUB7UP0QT9ttFU01S\n\tblCUNqZJRPbpsqYyHPLzfW66K7dV4Ev7oBBzBlRk2wbCh33dhmevd7BDpuMtO4MsDG\n\tObCGqnZ61gClGv08X1BiNTmuDAdXgnhAQNbGY3cfE5EcUleVg88NW7l48aS6htyjeZ\n\tzzKTTygtPGzQQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652135166;\n\tbh=Sfpa/vif6idCc7wbOhqqLAAZnxTfAshMlKWuolhHcGQ=;\n\th=From:To:Subject:Date:From;\n\tb=jxDjtMR0h1sDfTF5hTveM5uv+0mwHIoboHdlCEZTfwEXAtJJ1qkDvas5oK1AyLgXU\n\tNIJBIdLUiteZYffJKqpOlwIja2b0ZJmjHW0u0NpDVoX6mvG7/0/sIv3l4dGOCff6Gh\n\t4MvQvkD1Z2NCopcAlZv02lnqFxevn4Gqp5JtoJlI="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"jxDjtMR0\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 10 May 2022 01:25:58 +0300","Message-Id":"<20220509222558.31342-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.35.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] meson: Compile libyaml as a subproject if\n\tnot available on the system","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"AOSP doesn't ship libyaml, making it more difficult to compile libcamera\nfor Android. Use a meson wrap to compile libyaml as a subproject if the\ndependency is not found.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/meson.build | 13 ++++++++++++-\n subprojects/.gitignore    |  3 ++-\n subprojects/libyaml.wrap  |  5 +++++\n 3 files changed, 19 insertions(+), 2 deletions(-)\n create mode 100644 subprojects/libyaml.wrap\n\n\nbase-commit: 6d990f102fd829feb05e37e5f242a796fcada1b5","diff":"diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\nindex f8e18e035575..d1a6c5c88159 100644\n--- a/src/libcamera/meson.build\n+++ b/src/libcamera/meson.build\n@@ -67,7 +67,7 @@ subdir('proxy')\n libdl = cc.find_library('dl')\n libgnutls = cc.find_library('gnutls', required : true)\n libudev = dependency('libudev', required : false)\n-libyaml = dependency('yaml-0.1', required : true)\n+libyaml = dependency('yaml-0.1', required : false)\n \n if libgnutls.found()\n     config_h.set('HAVE_GNUTLS', 1)\n@@ -88,6 +88,17 @@ if libudev.found()\n     ])\n endif\n \n+# Fallback to a subproject if libyaml isn't found, as it's not packaged in AOSP.\n+if not libyaml.found()\n+    cmake = import('cmake')\n+\n+    libyaml_vars = cmake.subproject_options()\n+    libyaml_vars.add_cmake_defines({'CMAKE_POSITION_INDEPENDENT_CODE': 'ON'})\n+    libyaml_vars.append_compile_args('c', '-Wno-unused-value')\n+    libyaml_wrap = cmake.subproject('libyaml', options : libyaml_vars)\n+    libyaml = libyaml_wrap.dependency('yaml')\n+endif\n+\n control_sources = []\n \n foreach source : control_source_files\ndiff --git a/subprojects/.gitignore b/subprojects/.gitignore\nindex 391fde2ce1e0..f207720b271a 100644\n--- a/subprojects/.gitignore\n+++ b/subprojects/.gitignore\n@@ -1,3 +1,4 @@\n /googletest-release*\n+/libyaml\n /libyuv\n-/packagecache\n\\ No newline at end of file\n+/packagecache\ndiff --git a/subprojects/libyaml.wrap b/subprojects/libyaml.wrap\nnew file mode 100644\nindex 000000000000..3d7d0a328be4\n--- /dev/null\n+++ b/subprojects/libyaml.wrap\n@@ -0,0 +1,5 @@\n+[wrap-git]\n+directory = libyaml\n+url = https://github.com/yaml/libyaml\n+# tags/0.2.5\n+revision = 2c891fc7a770e8ba2fec34fc6b545c672beb37e6\n","prefixes":["libcamera-devel"]}