[{"id":22940,"web_url":"https://patchwork.libcamera.org/comment/22940/","msgid":"<CAOgh=Fyg9Kz9D3hB8D=tm1XXQHkBSj_ZA=TFFF5iV_2B39=kow@mail.gmail.com>","date":"2022-05-10T14:03:45","subject":"Re: [libcamera-devel] [PATCH] meson: Compile libyaml as a\n\tsubproject if not available on the system","submitter":{"id":101,"url":"https://patchwork.libcamera.org/api/people/101/","name":"Eric Curtin","email":"ecurtin@redhat.com"},"content":"On Mon, 9 May 2022 at 23:26, Laurent Pinchart via libcamera-devel\n<libcamera-devel@lists.libcamera.org> wrote:\n>\n> AOSP doesn't ship libyaml, making it more difficult to compile libcamera\n> for Android. Use a meson wrap to compile libyaml as a subproject if the\n> dependency is not found.\n>\n> Signed-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> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 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\n> diff --git a/subprojects/.gitignore b/subprojects/.gitignore\n> index 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\n> diff --git a/subprojects/libyaml.wrap b/subprojects/libyaml.wrap\n> new file mode 100644\n> index 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>\n> base-commit: 6d990f102fd829feb05e37e5f242a796fcada1b5\n> --\n> Regards,\n>\n> Laurent Pinchart\n>\n\nWorks great!\n\nTested-by: Eric Curtin <ecurtin@redhat.com>\n\nRegards,\n\nEric","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 19906C326C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 10 May 2022 14:04:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CFF0065644;\n\tTue, 10 May 2022 16:04:06 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 340ED65643\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 10 May 2022 16:04:05 +0200 (CEST)","from mail-oi1-f197.google.com (mail-oi1-f197.google.com\n\t[209.85.167.197]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\tus-mta-381-xvNXagOIPQWh-KFdEqMK6A-1; Tue, 10 May 2022 10:04:02 -0400","by mail-oi1-f197.google.com with SMTP id\n\tp9-20020a544609000000b00325565968bdso5040500oip.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 10 May 2022 07:04:02 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652191446;\n\tbh=CyD7u8dRe+rlqu0xE7adi+6mxuGItoQlZGuzH1QLcFc=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=EECoW0gq60U1PemfRS0caZ5RzMT/nlHmWH1zQsmfwb7MkSoTEWjS1Mdj+pfrp82nG\n\tENMqlhMxbBKVk/1OZB1wBRsxDZ9jiWwcmwMswtznQU8Ye6DqPU9+Fkqz6S88UiR1Ku\n\t3Jx6nE4jVjAc8mfSKgC8EyRqYvqM6d2jaI8dComiwG1M/8ZTUqnMtUQW7Z3DxG/GBv\n\tIP03N2seDnF5MCml0mtG61ktyN/ytWyVmSITlARxgATzFApM8OwUabzxRLiK3d37BM\n\td0vvaG3VlehTr/k35KpUK4z8eVM3oA7JRNH4j7s5Vjd7zNru+xTsERwl3iMV80GwUa\n\tb0cc82xvRcKtg==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1652191444;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=chNSlz6J+Ck3NTyDnCPaMjkquaZ27B/YFYYSG/kt3wg=;\n\tb=LZnp8DgQHwUPI168hBefEseznqscucK0mUAdeGxDBg+ZeYqli63e6SfQ/sCmjSmZLPGr98\n\tAoyZABWOir0y7Gl2T34mppYnwgydOa9co8i7kUR2X3Zxv46uj3FVYmWN9+MJmoNyn/XqAn\n\ttkQ9cw9ui6YxgwBWeozk1cTSgSz9nho="],"Authentication-Results":["lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=redhat.com\n\theader.i=@redhat.com header.b=\"LZnp8DgQ\"; \n\tdkim-atps=neutral","relay.mimecast.com;\n\tauth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ecurtin@redhat.com"],"X-MC-Unique":"xvNXagOIPQWh-KFdEqMK6A-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=chNSlz6J+Ck3NTyDnCPaMjkquaZ27B/YFYYSG/kt3wg=;\n\tb=UvB9xqQNEVy2iOe83gaxUaF8ily1So8w0fF71rocNrJ36I3UDRYYRuRhQvry+fhDA8\n\tGlTycjLlz59MjShalmG6EUXhZj+f1E81UmjwS4hTWa7A7Ft2pWycjDOGV8+zqGYv4H53\n\txwgSRNHf8hFgqk/BqYNRNV+NlP0fqPQjXFw5Puv445AAF6fhrQCFBOG+Kk/EFcnzBrrK\n\tvJdR6RUHdxeIBqBXrNK7L80dvXrJYrnEh4KMulmz2JqN71A98ZoBnrDjzsKSrak7o7D4\n\te78wbG6p4GOzqi915c0Mdqhl184d/4GRHnGoXrp63K5jq8gNPtJHCQAxxFe7r/iE0xBr\n\trVBw==","X-Gm-Message-State":"AOAM532NVl5ixrQsVYnATC6xd6aLN/epDCwMU0Tt3LsJ1I8AMiENJlgw\n\tLBFPDAj6DaKuHnuUAhDjzum4HP3zs/o5T8PaBlfb5wO0yLh2KR3heqv6pa6+eaZzQRzwuqp1y9A\n\tqSlN9dvm1tG4px44Dy7g4QdMuij8iVXT+gp+leFuiHSO+2PAI/g==","X-Received":["by 2002:a05:6870:11cd:b0:e5:e565:9185 with SMTP id\n\t13-20020a05687011cd00b000e5e5659185mr99908oav.251.1652191441988; \n\tTue, 10 May 2022 07:04:01 -0700 (PDT)","by 2002:a05:6870:11cd:b0:e5:e565:9185 with SMTP id\n\t13-20020a05687011cd00b000e5e5659185mr99894oav.251.1652191441732;\n\tTue, 10 May 2022 07:04:01 -0700 (PDT)"],"X-Google-Smtp-Source":"ABdhPJy1ovWPDx7JAyKIt0QNzEiN1xUH2Js1wz7EMM2s1jeHsKDjAV3ESmKNamD1Ig+r8WtY1CH5wB+MFksmplGqI20=","MIME-Version":"1.0","References":"<20220509222558.31342-1-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20220509222558.31342-1-laurent.pinchart@ideasonboard.com>","Date":"Tue, 10 May 2022 15:03:45 +0100","Message-ID":"<CAOgh=Fyg9Kz9D3hB8D=tm1XXQHkBSj_ZA=TFFF5iV_2B39=kow@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH] meson: Compile libyaml as a\n\tsubproject if not 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":"Eric Curtin via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Eric Curtin <ecurtin@redhat.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22943,"web_url":"https://patchwork.libcamera.org/comment/22943/","msgid":"<165219428005.2416244.13384014121029893841@Monstersaurus>","date":"2022-05-10T14:51:20","subject":"Re: [libcamera-devel] [PATCH] meson: Compile libyaml as a\n\tsubproject if not available on the system","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart via libcamera-devel (2022-05-09 23:25:58)\n> AOSP doesn't ship libyaml, making it more difficult to compile libcamera\n> for Android. Use a meson wrap to compile libyaml as a subproject if the\n> dependency is not found.\n> \n\nI expect (once the newly introduced py path issue is resolved), this\nwill fix the linux-media jenkins build failure there [0] too?\n\n[0] https://lists.libcamera.org/pipermail/libcamera-devel/2022-May/030292.html\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\n\n> Signed-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> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 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\n> diff --git a/subprojects/.gitignore b/subprojects/.gitignore\n> index 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\n> diff --git a/subprojects/libyaml.wrap b/subprojects/libyaml.wrap\n> new file mode 100644\n> index 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> \n> base-commit: 6d990f102fd829feb05e37e5f242a796fcada1b5\n> -- \n> Regards,\n> \n> Laurent Pinchart\n>","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 00ED3C0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 10 May 2022 14:51:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 40E1465643;\n\tTue, 10 May 2022 16:51:24 +0200 (CEST)","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 14B5B65643\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 10 May 2022 16:51:23 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A451BB60;\n\tTue, 10 May 2022 16:51:22 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652194284;\n\tbh=cl/G5dcg5avjc3WT9Ihh7XzSF7TjuTONCeG4SCvLdaQ=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=pX85GKsi8e96O2bTz5NWN+4gvK7di5yboHciiZbxokNI2BvjCZWNyQkX//m9+yIrP\n\tv5c8FIwipcokgxwy319rRX+T3WBuoerEDOwQSQrKElNQUAjDlTmD6XzEX3V48ALx7o\n\tzKMBQX1F0I8zXhOpquqFCnc7IaiMEmz2zGMA9xr+FrgIxIv1VblTlSQYf1mYtnHWMV\n\ti3Gv2Fitxx8rKVT7+nT4ap/f4ROkxU6D5c0BWadOO4s5WzcTqu9zF4+75igXOzuwoz\n\t9YSrXx++CxPVwC3KO0b1K1HLHPOjAZeicRYJjZrdRm+9EqLtSkCjSyJiunW412Zdai\n\tKCHMZsR13A/hw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652194282;\n\tbh=cl/G5dcg5avjc3WT9Ihh7XzSF7TjuTONCeG4SCvLdaQ=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=GW9hqmj5KL2MrXBtOmG3UsKUPspVGo7GUVvy63GXtxwkmaS4J87wVwJWFRu/ezRB8\n\t3xDq2KZ/POtvgaQLciqI8rr+0jp3j8aqifCu6n6s3z/JBJsSHiXlss5qqmZRh+fnel\n\tKa0wGG7yPwchGlcXpWQgGJrrQK4FlmLyb552KfX4="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"GW9hqmj5\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20220509222558.31342-1-laurent.pinchart@ideasonboard.com>","References":"<20220509222558.31342-1-laurent.pinchart@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Tue, 10 May 2022 15:51:20 +0100","Message-ID":"<165219428005.2416244.13384014121029893841@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH] meson: Compile libyaml as a\n\tsubproject if not 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":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22944,"web_url":"https://patchwork.libcamera.org/comment/22944/","msgid":"<Ynp8bS4p8ZqKWMV1@pendragon.ideasonboard.com>","date":"2022-05-10T14:53:33","subject":"Re: [libcamera-devel] [PATCH] meson: Compile libyaml as a\n\tsubproject if not available on the system","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, May 10, 2022 at 03:51:20PM +0100, Kieran Bingham wrote:\n> Quoting Laurent Pinchart via libcamera-devel (2022-05-09 23:25:58)\n> > AOSP doesn't ship libyaml, making it more difficult to compile libcamera\n> > for Android. Use a meson wrap to compile libyaml as a subproject if the\n> > dependency is not found.\n> \n> I expect (once the newly introduced py path issue is resolved), this\n> will fix the linux-media jenkins build failure there [0] too?\n> \n> [0] https://lists.libcamera.org/pipermail/libcamera-devel/2022-May/030292.html\n\nI expect it would have if Mauro hadn't installed libyaml on the builder\nin the meantime :-)\n\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> > Signed-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> > diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> > index 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\n> > diff --git a/subprojects/.gitignore b/subprojects/.gitignore\n> > index 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\n> > diff --git a/subprojects/libyaml.wrap b/subprojects/libyaml.wrap\n> > new file mode 100644\n> > index 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> > \n> > base-commit: 6d990f102fd829feb05e37e5f242a796fcada1b5","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 90A74C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 10 May 2022 14:53:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E8F9065646;\n\tTue, 10 May 2022 16:53:40 +0200 (CEST)","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 58C8A65643\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 10 May 2022 16:53:39 +0200 (CEST)","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 BE553B60;\n\tTue, 10 May 2022 16:53:38 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652194420;\n\tbh=0uqR8RRX33KUkkZu1586IajjA+UmQak1k4iQnMKtaSU=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=XSYoiHBEVnzCGNrtgw1onK58lemMb44T/0DR5st6OhrAU0PU3pTeL08+8u6P8X5mm\n\teZaOCsEUYhgb+/EWCeXwjXqPx2Tbnh4ssi/Uj43mlmFqYOFeySLtPLgMV/uMBFCawR\n\ta47LnUyByIEKFBparOL42r2NZPnqRZZ9fjd9maAyd+cD2P4ykm/TePx4xwmk/y1b58\n\tYZ64jG1nMdf7He8bOv1uvtoBDlmI99YxT9QmiyZjV14ftUWN7J+kiF6l6/mkzAGnLy\n\tOPaLBdC/rUVX7+RbhNlOMwAHsMuPsoB7jGag5S6aylZpUrDr5wFonp2Nbl7cgdIkxj\n\tbP1xCAaOchL+w==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652194419;\n\tbh=0uqR8RRX33KUkkZu1586IajjA+UmQak1k4iQnMKtaSU=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=vtlhPIk8vlPFvxkfVLdU8X0Q1egAkjutfDAfMfFZkR954lwJDdshw36THKzIbvNLW\n\t6Pwfq7kvUJXCgNY48GcM5m9MuRAYu0xcjgGXrQuj6/f2bMqykHsKSklE/N3h5WHNbH\n\tItzWYlTqeuGNYS6xjV21oVHgvA3zUP7OCP5o3xxs="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"vtlhPIk8\"; dkim-atps=neutral","Date":"Tue, 10 May 2022 17:53:33 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<Ynp8bS4p8ZqKWMV1@pendragon.ideasonboard.com>","References":"<20220509222558.31342-1-laurent.pinchart@ideasonboard.com>\n\t<165219428005.2416244.13384014121029893841@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<165219428005.2416244.13384014121029893841@Monstersaurus>","Subject":"Re: [libcamera-devel] [PATCH] meson: Compile libyaml as a\n\tsubproject if not 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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23044,"web_url":"https://patchwork.libcamera.org/comment/23044/","msgid":"<5a6faa18-2f7f-627b-306c-378c741c7452@ideasonboard.com>","date":"2022-05-18T10:48:33","subject":"Re: [libcamera-devel] [PATCH] meson: Compile libyaml as a\n\tsubproject if not available on the system","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Laurent,\n\nOn 5/10/22 00:25, Laurent Pinchart via libcamera-devel wrote:\n> AOSP doesn't ship libyaml, making it more difficult to compile libcamera\n> for Android. Use a meson wrap to compile libyaml as a subproject if the\n> dependency is not found.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\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> diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build\n> index 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\n> diff --git a/subprojects/.gitignore b/subprojects/.gitignore\n> index 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\n> diff --git a/subprojects/libyaml.wrap b/subprojects/libyaml.wrap\n> new file mode 100644\n> index 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>\n> base-commit: 6d990f102fd829feb05e37e5f242a796fcada1b5","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 E2001C0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 May 2022 10:48:39 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 23C9E65659;\n\tWed, 18 May 2022 12:48:39 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D3B4265656\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 May 2022 12:48:37 +0200 (CEST)","from [192.168.1.164] (unknown [45.131.31.124])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 136589C4;\n\tWed, 18 May 2022 12:48:36 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652870919;\n\tbh=YHpRAFE9Ayo3kYKn4b7o1oDcbVw416PJRMI6HSXB+h8=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=yZ2iuPUXKFqoWMrc5r5PougF1tVSMFU5sOaP/dozhOLssaTNlU7Ie9UNL1EqedzCv\n\tnQnCGg0iDaqAInuQvK6Ch9acAIubfg9Kx7Iy9O1ByQ1povJdZmrU12NwRnPTli03vC\n\trCbJXulgRE7P0icvPSbM856F8ooHhZL/4VBeGaR6wAtCt/nUw7xtIb/1gsLZzBzk9j\n\tD6aSnDCx006gaVrHrrPtA15EXRfyf4C0srYLJDq0VMV5TLb4F4RZOqRWWg9p66N4Ek\n\tXit5cgZXW92S+Pjh+Ri+QDprF1amyjS9gnwaaZwUFZoVIDbVHOZPvCsbR90qXrvp/v\n\tnSsGsirwbb/Fw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652870917;\n\tbh=YHpRAFE9Ayo3kYKn4b7o1oDcbVw416PJRMI6HSXB+h8=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=KDdnJQY0rdBr7H/vOEJf2LgeCCzCz/vTDcpbEk72as8/KJ/4QTLuYhMGPImEYMw+j\n\tUhcTnAXgBUMduEKDswO7sYs27LpwsyCkJJoBB+icbq0cl6SG5MvK6PJxQ36TjUXTZP\n\tbBo0RfZ+dO6ANGxar5bZfHF4oRzpUrKdk4MxORLU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"KDdnJQY0\"; dkim-atps=neutral","Message-ID":"<5a6faa18-2f7f-627b-306c-378c741c7452@ideasonboard.com>","Date":"Wed, 18 May 2022 12:48:33 +0200","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101\n\tThunderbird/91.4.1","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220509222558.31342-1-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20220509222558.31342-1-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH] meson: Compile libyaml as a\n\tsubproject if not 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":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]