From patchwork Tue Nov 7 10:01:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Volk X-Patchwork-Id: 33994 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2A7FC4332F for ; Tue, 7 Nov 2023 10:01:42 +0000 (UTC) Received: from mailout02.t-online.de (mailout02.t-online.de [194.25.134.17]) by mx.groups.io with SMTP id smtpd.web10.7183.1699351297747083929 for ; Tue, 07 Nov 2023 02:01:38 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); spf=pass (domain: t-online.de, ip: 194.25.134.17, mailfrom: f_l_k@t-online.de) Received: from fwd78.aul.t-online.de (fwd78.aul.t-online.de [10.223.144.104]) by mailout02.t-online.de (Postfix) with SMTP id 6A0E215779 for ; Tue, 7 Nov 2023 11:01:35 +0100 (CET) Received: from intel-corei7-64.fritz.box ([84.154.173.54]) by fwd78.t-online.de with (TLSv1.3:TLS_AES_256_GCM_SHA384 encrypted) esmtp id 1r0Itq-4YZ7tB0; Tue, 7 Nov 2023 11:01:34 +0100 From: Markus Volk To: openembedded-core@lists.openembedded.org Subject: [oe-core][RFC][PATCH] vala.bbclass: enable vapi build if class is inherited Date: Tue, 7 Nov 2023 11:01:49 +0100 Message-ID: <20231107100149.1048627-1-f_l_k@t-online.de> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-TOI-EXPURGATEID: 150726::1699351294-3FFFCEA2-2C0F4D18/0/0 CLEAN NORMAL X-TOI-MSGID: bad6a41c-d908-4ed9-9b77-b967ac0f25e8 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 07 Nov 2023 10:01:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/190261 Try to enable vapi build automatically if GI_DATA_ENABLED = True. Do it basically the same way it is done for gi Signed-off-by: Markus Volk --- meta/classes-recipe/vala.bbclass | 23 +++++++++++++++++++ .../libdazzle/libdazzle_3.44.0.bb | 1 + .../appstream/appstream_0.16.3.bb | 2 -- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/meta/classes-recipe/vala.bbclass b/meta/classes-recipe/vala.bbclass index 460ddb36f0..45c3993c54 100644 --- a/meta/classes-recipe/vala.bbclass +++ b/meta/classes-recipe/vala.bbclass @@ -16,6 +16,29 @@ export STAGING_DATADIR # Upstream Vala >= 0.11 looks in XDG_DATA_DIRS for .vapi files export XDG_DATA_DIRS = "${STAGING_DATADIR}:${STAGING_LIBDIR}" +VALA_ENABLED:class-native = "False" +VALA_ENABLED ?= "${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'True', 'False', d)}" + +# meson: default option name to enable/disable vala. This matches most +# project's configuration. In doubts - check meson_options.txt in project's +# source path. +VALA_MESON_OPTION ?= 'vapi' +VALA_MESON_ENABLE_FLAG ?= 'true' +VALA_MESON_DISABLE_FLAG ?= 'false' + +# Define vala options such that they can be disabled completely when VALA_MESON_OPTION is empty +VALAMESONTARGET = "-D${VALA_MESON_OPTION}=${@bb.utils.contains('VALA_ENABLED', 'True', '${VALA_MESON_ENABLE_FLAG}', '${VALA_MESON_DISABLE_FLAG}', d)} " +VALAMESONBUILD = "-D${VALA_MESON_OPTION}=${VALA_MESON_DISABLE_FLAG} " + +EXTRA_OECONF:prepend:class-target = "${@bb.utils.contains('VALA_ENABLED', 'True', '--enable-vala', '--disable-vala', d)} " +EXTRA_OEMESON:prepend:class-target = "${@['', '${VALAMESONTARGET}'][d.getVar('VALA_MESON_OPTION') != '']} " +# When building native recipes, disable vala, as it is not necessary, +# pulls in additional dependencies, and makes build times longer +EXTRA_OECONF:prepend:class-native = "--disable-vala " +EXTRA_OEMESON:prepend:class-native = "${@['', '${VALAMESONBUILD}'][d.getVar('VALA_MESON_OPTION') != '']}" +EXTRA_OECONF:prepend:class-nativesdk = "--disable-vala " +EXTRA_OEMESON:prepend:class-nativesdk = "${@['', '${VALAMESONBUILD}'][d.getVar('VALA_MESON_OPTION') != '']}" + # Package additional files FILES:${PN}-dev += "\ ${datadir}/vala/vapi/*.vapi \ diff --git a/meta/recipes-gnome/libdazzle/libdazzle_3.44.0.bb b/meta/recipes-gnome/libdazzle/libdazzle_3.44.0.bb index 49ebc818b0..e561bfa22a 100644 --- a/meta/recipes-gnome/libdazzle/libdazzle_3.44.0.bb +++ b/meta/recipes-gnome/libdazzle/libdazzle_3.44.0.bb @@ -15,5 +15,6 @@ DEPENDS = "glib-2.0-native glib-2.0 gtk+3" SRC_URI[archive.sha256sum] = "3cd3e45eb6e2680cb05d52e1e80dd8f9d59d4765212f0e28f78e6c1783d18eae" GIR_MESON_OPTION = 'with_introspection' +VALA_MESON_OPTION = "with_vapi" ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}" diff --git a/meta/recipes-support/appstream/appstream_0.16.3.bb b/meta/recipes-support/appstream/appstream_0.16.3.bb index bde679e256..dafeff2555 100644 --- a/meta/recipes-support/appstream/appstream_0.16.3.bb +++ b/meta/recipes-support/appstream/appstream_0.16.3.bb @@ -40,6 +40,4 @@ PACKAGECONFIG[stemming] = "-Dstemming=true,-Dstemming=false,libstemmer" FILES:${PN} += "${datadir}" -EXTRA_OEMESON += "${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-Dvapi=true', '-Dvapi=false', d)}" - BBCLASSEXTEND = "native"