public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] Add git-buildpackage support
@ 2019-09-18 20:18 Jan Kiszka
  0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2019-09-18 20:18 UTC (permalink / raw)
  To: isar-users

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-18 20:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18 20:18 [PATCH] Add git-buildpackage support Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox