public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH] Add git-buildpackage support
Date: Wed, 18 Sep 2019 22:18:56 +0200	[thread overview]
Message-ID: <1325f384-8bd8-96e9-589e-d19efcba716d@siemens.com> (raw)

From: Jan Kiszka <jan.kiszka@siemens.com>

This allows to build packages from gbp-compatible repositories like
found on salsa. This is particularly useful for building unreleased
or older packages, and also patching them.

The feature comes with a test case that builds cowsay from its salsa
repo, adding this also to CI.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Actually, CI is still running, but I'm optimistic...

 meta-isar/recipes-app/cowsay/cowsay_git.bb       |  9 +++++++++
 meta/classes/dpkg-gbp.bbclass                    | 24 ++++++++++++++++++++++++
 meta/recipes-devtools/buildchroot/files/build.sh |  2 +-
 scripts/ci_build.sh                              |  2 ++
 4 files changed, 36 insertions(+), 1 deletion(-)
 create mode 100644 meta-isar/recipes-app/cowsay/cowsay_git.bb
 create mode 100644 meta/classes/dpkg-gbp.bbclass

diff --git a/meta-isar/recipes-app/cowsay/cowsay_git.bb b/meta-isar/recipes-app/cowsay/cowsay_git.bb
new file mode 100644
index 0000000..7aca1b4
--- /dev/null
+++ b/meta-isar/recipes-app/cowsay/cowsay_git.bb
@@ -0,0 +1,9 @@
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2019
+#
+# SPDX-License-Identifier: MIT
+
+inherit dpkg-gbp
+
+SRC_URI = "git://salsa.debian.org/debian/cowsay.git;protocol=https"
+SRCREV = "756f0c41fbf582093c0c1dff9ff77734716cb26f"
diff --git a/meta/classes/dpkg-gbp.bbclass b/meta/classes/dpkg-gbp.bbclass
new file mode 100644
index 0000000..8a8e0f4
--- /dev/null
+++ b/meta/classes/dpkg-gbp.bbclass
@@ -0,0 +1,24 @@
+# This software is a part of ISAR.
+# Copyright (c) Siemens AG, 2019
+#
+# SPDX-License-Identifier: MIT
+
+inherit dpkg
+
+S = "${WORKDIR}/git"
+
+GBP_DEPENDS ?= "git-buildpackage pristine-tar"
+GBP_EXTRA_OPTIONS ?= "--git-pristine-tar"
+
+do_install_builddeps_append() {
+    dpkg_do_mounts
+    E="${@ bb.utils.export_proxies(d)}"
+    sudo -E chroot ${BUILDCHROOT_DIR} \
+        apt-get install -y -o Debug::pkgProblemResolver=yes \
+                        --no-install-recommends ${GBP_DEPENDS}
+    dpkg_undo_mounts
+}
+
+dpkg_runbuild_prepend() {
+    export GBP_PREFIX="gbp buildpackage --git-ignore-new ${GBP_EXTRA_OPTIONS} --git-builder="
+}
diff --git a/meta/recipes-devtools/buildchroot/files/build.sh b/meta/recipes-devtools/buildchroot/files/build.sh
index 1ba394c..101581d 100644
--- a/meta/recipes-devtools/buildchroot/files/build.sh
+++ b/meta/recipes-devtools/buildchroot/files/build.sh
@@ -14,4 +14,4 @@ for i in configure aclocal.m4 Makefile.am Makefile.in; do
     fi
 done
 
-dpkg-buildpackage -a$target_arch -d --source-option=-I
+${GBP_PREFIX}dpkg-buildpackage -a$target_arch -d --source-option=-I
diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
index a69cc51..d02326a 100755
--- a/scripts/ci_build.sh
+++ b/scripts/ci_build.sh
@@ -155,6 +155,8 @@ fi
 
 sed -i -e 's/#IMAGE_INSTALL += "isar-disable-apt-cache"/IMAGE_INSTALL += "isar-disable-apt-cache"/g' conf/local.conf
 
+echo 'IMAGE_INSTALL += "cowsay"' >> conf/local.conf
+
 # Start cross build for the defined set of configurations
 sed -i -e 's/ISAR_CROSS_COMPILE ?= "0"/ISAR_CROSS_COMPILE ?= "1"/g' conf/local.conf
 bitbake $BB_ARGS $CROSS_TARGETS_SET
-- 
2.16.4


-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

                 reply	other threads:[~2019-09-18 20:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1325f384-8bd8-96e9-589e-d19efcba716d@siemens.com \
    --to=jan.kiszka@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