From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7057120643105423360 X-Received: by 2002:a05:600c:1ca3:: with SMTP id k35mr2077787wms.170.1643113943902; Tue, 25 Jan 2022 04:32:23 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a5d:448f:: with SMTP id j15ls30617wrq.3.gmail; Tue, 25 Jan 2022 04:32:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzrJMDADWXbhH/Jf05/N5Ojd1R8tHOXw4rtbgxVFXNl12ov7GDcJ3dNdgdlR9dh3F9bH/Sf X-Received: by 2002:adf:e291:: with SMTP id v17mr18049454wri.479.1643113942969; Tue, 25 Jan 2022 04:32:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643113942; cv=none; d=google.com; s=arc-20160816; b=jwg3hPxyhATy7XK7gVr53Cdj+x0jj1KvlacRL9qk+5XcwhrqwAR6mwPNx9RBBJGk+f JSadmL10GySymmOcarlhQrjZP7iHZRDW10Jf/ZxTa+jLrXrInaK1+mZDVCk0B46JrD8c +2zYsQT4affxsbLVM1kpwLH1iiAXHSZN4JYnqxsr+rWYalwwoDTSUh/nngQFugBA22US Ula0iju5mHlyT8cf3xuNskzJAxO66YtYqL+hv/RNv5PqltXA8WEWiRDB/finqvNqe4ea H5E2g63NMILIbohui0tBd1veS4AoflAJ806LRPJzVIL/xJe7U4KHqubtpvr1XAvtjMSn uLig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=q3AMgjAshNdjUTbnD0Bf1u0fRhFqBV+Oidwai/1Z0Ns=; b=DRPTWDjs3uz73WFHwmqcdlcc264i5pM9LQEz5n8/yaAPB1UBIVGb21bTLX0WLoR6UH t98ilcLGBBUj6CP4MpZx9tOW3cfAG3XduzkoMxnv2vbrBxnNtzEomqGrRSqqlhVf7jh7 oVqrhfJyud5ZikkchoZVy1h1VzkURPGzk6ZFU+bAoOupMy/hTDe08deFt+sL8ZoNDMkw OsmSHHyEwyUJtSDLRIQCkZJlIC7ds//QdeIkkMRQ+QGJRC2PnZjLEuwa3g9G5OZPsVDY Unb07jIUleWM7/OrtDFLfDeOmSAbPbtt4n4U25Mf6l2RznG6Z5U2oblLr+IpoJfnJcRV kybw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id e5si901521wrj.8.2022.01.25.04.32.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Jan 2022 04:32:22 -0800 (PST) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from baighyz.m.ilbers.de (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPSA id 20PCWJHu019024 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 25 Jan 2022 13:32:22 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v2 8/9] dpkg: Use a specific export function in pre-build tasks Date: Tue, 25 Jan 2022 13:32:18 +0100 Message-Id: <20220125123219.32395-9-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220125123219.32395-1-ubely@ilbers.de> References: <20220125123219.32395-1-ubely@ilbers.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: cLsfGffHAkBj Build system like sbuild may not use the system environment, so direct shell export won't work. This introduces dpkg_build_export function that may be overloaded in sbuild or other build systems to be implemented in Isar. Use it in some recipes like optee-os-stm32mp15x as an alternative of passing TEE_IMPL_VERSION variable through template mechanism. Signed-off-by: Uladzimir Bely --- meta-isar/recipes-app/hello/hello.bb | 2 +- .../recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb | 2 +- meta/classes/dpkg-base.bbclass | 9 +++++++++ meta/classes/dpkg.bbclass | 2 +- meta/recipes-bsp/libubootenv/libubootenv_0.3-3.bb | 2 +- meta/recipes-kernel/linux/linux-custom.inc | 2 +- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/meta-isar/recipes-app/hello/hello.bb b/meta-isar/recipes-app/hello/hello.bb index d6bdf9bb..dfeea6e9 100644 --- a/meta-isar/recipes-app/hello/hello.bb +++ b/meta-isar/recipes-app/hello/hello.bb @@ -25,6 +25,6 @@ do_prepare_build() { dpkg_runbuild_prepend() { if [ ${ISAR_CROSS_COMPILE} -eq 1 ]; then - export DEB_BUILD_OPTIONS="nocheck" + dpkg_build_export DEB_BUILD_OPTIONS "nocheck" fi } diff --git a/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb b/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb index 0fa2005d..00b92707 100644 --- a/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb +++ b/meta-isar/recipes-bsp/optee-os/optee-os-stm32mp15x_3.11.0.bb @@ -21,5 +21,5 @@ OPTEE_BINARIES = "tee-header_v2.stm32 tee-pageable_v2.stm32 tee-pager_v2.stm32" # Set version manually to PV, the tarball does not contain any hint. # Alternative: pull from git and add git as build dependency. dpkg_runbuild_prepend() { - export TEE_IMPL_VERSION=${PV} + dpkg_build_export TEE_IMPL_VERSION ${PV} } diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass index 2add0b22..76b1290a 100644 --- a/meta/classes/dpkg-base.bbclass +++ b/meta/classes/dpkg-base.bbclass @@ -196,6 +196,15 @@ dpkg_undo_mounts() { sudo rmdir ${BUILDROOT} } +# Basic export implementation supporting multiword values +dpkg_build_export() { + var=$1 + shift + value=$@ + + export $var="$value" +} + # Placeholder for actual dpkg_runbuild() implementation dpkg_runbuild() { die "This should never be called, overwrite it in your derived class" diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass index 27fe84f4..e8c7e2eb 100644 --- a/meta/classes/dpkg.bbclass +++ b/meta/classes/dpkg.bbclass @@ -33,7 +33,7 @@ addtask devshell after do_install_builddeps dpkg_runbuild() { E="${@ isar_export_proxies(d)}" E="${@ isar_export_ccache(d)}" - export PARALLEL_MAKE="${PARALLEL_MAKE}" + dpkg_build_export PARALLEL_MAKE "${PARALLEL_MAKE}" sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \ /isar/build.sh ${PP}/${PPS} ${PACKAGE_ARCH} } diff --git a/meta/recipes-bsp/libubootenv/libubootenv_0.3-3.bb b/meta/recipes-bsp/libubootenv/libubootenv_0.3-3.bb index 68a55003..9cdbb366 100644 --- a/meta/recipes-bsp/libubootenv/libubootenv_0.3-3.bb +++ b/meta/recipes-bsp/libubootenv/libubootenv_0.3-3.bb @@ -21,5 +21,5 @@ S = "${WORKDIR}/git" dpkg_runbuild_prepend() { - export DEB_BUILD_OPTIONS="nocheck" + dpkg_build_export DEB_BUILD_OPTIONS "nocheck" } diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc index ed89aa09..72706f23 100644 --- a/meta/recipes-kernel/linux/linux-custom.inc +++ b/meta/recipes-kernel/linux/linux-custom.inc @@ -180,6 +180,6 @@ dpkg_runbuild_prepend() { if [ "${KERNEL_LIBC_DEV_DEPLOY}" != "1" ]; then profiles="${profiles} nolibcdev" fi - export DEB_BUILD_PROFILES="${profiles}" + dpkg_build_export DEB_BUILD_PROFILES "${profiles}" dpkg_configure_kernel } -- 2.20.1