public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Henning Schild <henning.schild@siemens.com>
Subject: [PATCH 1/2] cross: use env variables instead of switches
Date: Tue, 11 Sep 2018 12:16:04 +0200	[thread overview]
Message-ID: <20180911101605.21977-2-henning.schild@siemens.com> (raw)
In-Reply-To: <20180911101605.21977-1-henning.schild@siemens.com>

Debian has environment variables to set the architectures to be used by
dpkg-buildpackage and mk-build-deps. Use those instead of adding
parameters to the tools.
This patch now also uses the debian names for cross building and we do
not have confusing statements like "--host-arch $target_arch" anymore.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 meta/classes/dpkg.bbclass                         |  8 ++++++--
 meta/recipes-devtools/buildchroot/files/build.sh  |  2 +-
 meta/recipes-devtools/buildchroot/files/common.sh | 13 -------------
 meta/recipes-devtools/buildchroot/files/deps.sh   |  2 +-
 4 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 2e53c1b..4a04fc6 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -6,7 +6,9 @@ inherit dpkg-base
 # Install build dependencies for package
 dpkg_prepare() {
     E="${@ bb.utils.export_proxies(d)}"
-    sudo -E chroot ${BUILDCHROOT_DIR} /isar/deps.sh ${PP}/${PPS} ${DISTRO_ARCH}
+    export DEB_HOST_ARCH="${DISTRO_ARCH}"
+    export DEB_BUILD_ARCH="${HOST_ARCH}"
+    sudo -E chroot ${BUILDCHROOT_DIR} /isar/deps.sh ${PP}/${PPS}
 }
 
 # apt and reprepro may not run in parallel, acquire the Isar lock
@@ -15,5 +17,7 @@ do_prepare[lockfiles] += "${DEPLOY_DIR_APT}/isar.lock"
 # Build package from sources using build script
 dpkg_runbuild() {
     E="${@ bb.utils.export_proxies(d)}"
-    sudo -E chroot ${BUILDCHROOT_DIR} /isar/build.sh ${PP}/${PPS} ${DISTRO_ARCH}
+    export DEB_HOST_ARCH="${DISTRO_ARCH}"
+    export DEB_BUILD_ARCH="${HOST_ARCH}"
+    sudo -E chroot ${BUILDCHROOT_DIR} /isar/build.sh ${PP}/${PPS}
 }
diff --git a/meta/recipes-devtools/buildchroot/files/build.sh b/meta/recipes-devtools/buildchroot/files/build.sh
index e74bc14..0458b1f 100644
--- a/meta/recipes-devtools/buildchroot/files/build.sh
+++ b/meta/recipes-devtools/buildchroot/files/build.sh
@@ -15,4 +15,4 @@ for i in configure aclocal.m4 Makefile.am Makefile.in; do
 done
 
 # Build the package
-dpkg-buildpackage -a$target_arch -d --source-option=-I
+dpkg-buildpackage -d --source-option=-I
diff --git a/meta/recipes-devtools/buildchroot/files/common.sh b/meta/recipes-devtools/buildchroot/files/common.sh
index b7551eb..61917b8 100644
--- a/meta/recipes-devtools/buildchroot/files/common.sh
+++ b/meta/recipes-devtools/buildchroot/files/common.sh
@@ -6,19 +6,6 @@
 
 set -e
 
-# Create human-readable names
-target_arch=$2
-
-# Notes:
-#   mk-build-deps for jessie and jtretch has different parameter name to specify
-#   host architecture.
-debian_version=$(cut -c1 /etc/debian_version)
-if [ $(($debian_version)) -ge 9 ]; then
-    set_arch="--host-arch $target_arch"
-else
-    set_arch="-a $target_arch"
-fi
-
 # Go to build directory
 cd $1
 
diff --git a/meta/recipes-devtools/buildchroot/files/deps.sh b/meta/recipes-devtools/buildchroot/files/deps.sh
index 4bd604f..5c247f0 100644
--- a/meta/recipes-devtools/buildchroot/files/deps.sh
+++ b/meta/recipes-devtools/buildchroot/files/deps.sh
@@ -24,4 +24,4 @@ apt-get update \
     -o APT::Get::List-Cleanup="0"
 
 # Install all build deps
-mk-build-deps $set_arch -t "${install_cmd}" -i -r debian/control
+mk-build-deps -t "${install_cmd}" -i -r debian/control
-- 
2.16.4


  reply	other threads:[~2018-09-11 10:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-11 10:16 [PATCH 0/2] Straighten cross names Henning Schild
2018-09-11 10:16 ` Henning Schild [this message]
2018-09-21 12:55   ` [PATCHv2 1/2] cross: use env variables instead of switches Henning Schild
2018-09-21 13:08     ` Henning Schild
2018-09-27  7:12       ` Maxim Yu. Osipov
2018-09-27  7:15         ` Jan Kiszka
2018-09-28 10:47         ` Henning Schild
2018-09-11 10:16 ` [PATCH 2/2] build-kernel: fix the cross compile arch naming Henning Schild
2018-09-11 12:10   ` Jan Kiszka
2018-09-11 12:20     ` Henning Schild
2018-09-21 10:00 ` [PATCH 0/2] Straighten cross names Maxim Yu. Osipov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180911101605.21977-2-henning.schild@siemens.com \
    --to=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox