Source: ghdl
Followup-For: Bug #916475

Hello.
0001 is unchanged.
0002 is stripped from unwanted spaces<->tabulations changes.
>From 93ac475b1389fb875094c14a4977f64d8c1f74fd Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <nico...@debian.org>
Date: Sun, 1 Oct 2023 01:14:25 +0200
Subject: [PATCH 1/2] Delegate computation of Built-Using to dh-builtusing

---
 debian/control | 7 ++++---
 debian/rules   | 9 ---------
 2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/debian/control b/debian/control
index 585ee55e..545c44b4 100644
--- a/debian/control
+++ b/debian/control
@@ -5,6 +5,7 @@ Maintainer: Debian Electronics Team <pkg-electronics-devel@lists.alioth.debian.o
 Uploaders: Andreas Bombe <a...@debian.org>
 Build-Depends: debhelper-compat (= 13),
                dh-ada-library (>= 8.1),
+               dh-sequence-builtusing,
                gnat-12, gcc-12, g++-12,
                gcc-12-source <!pkg.ghdl.nogcc>,
                libisl-dev (>= 0.14) <!pkg.ghdl.nogcc>,
@@ -80,7 +81,7 @@ Description: VHDL compiler/simulator (mcode backend)
 Package: ghdl-gcc
 Architecture: any
 Build-Profiles: <!pkg.ghdl.nogcc>
-Built-Using: ${Built-Using-GCC}
+Built-Using: ${dh-builtusing:gcc-S-source}
 Depends: ghdl-common (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends},
 	gcc, zlib1g-dev
 Description: VHDL compiler/simulator (GCC backend)
@@ -122,7 +123,7 @@ Description: VHDL compiler/simulator (tools)
 
 Package: libghdl-3-0-0
 Architecture: any
-Built-Using: ${Built-Using-GCC}
+Built-Using: ${dh-builtusing:gcc-S-source} <!pkg.ghdl.nogcc>
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Multi-Arch: same
 Description: VHDL compiler/simulator (shared library)
@@ -135,7 +136,7 @@ Description: VHDL compiler/simulator (shared library)
 
 Package: libghdl-dev
 Architecture: any
-Built-Using: ${Built-Using-GCC}
+Built-Using: ${dh-builtusing:gcc-S-source} <!pkg.ghdl.nogcc>
 Depends: libghdl-3-0-0 (= ${binary:Version}), ${misc:Depends}
 Multi-Arch: same
 Description: VHDL compiler/simulator (library development files)
diff --git a/debian/rules b/debian/rules
index 5821f85d..138b8581 100755
--- a/debian/rules
+++ b/debian/rules
@@ -95,15 +95,6 @@ override_dh_strip:
 	dh_strip -N libghdl-3-0-0
 	dh_strip -p libghdl-3-0-0 --dbgsym-migration='libghdl-2-0-0'
 
-override_dh_gencontrol:
-ifneq ($(filter gcc,$(BACKENDS)),)
-	dh_gencontrol -- -VBuilt-Using-GCC="$(shell dpkg-query -f '$${Source} (= $${Version})' -W gcc-$(DEB_GNAT_VERSION)-source)"
-else
-	dh_gencontrol
-endif
-
-
-
 configure-llvm-stamp configure-mcode-stamp: configure-%-stamp:
 	$(announce)
 	mkdir -p $(BUILDDIR)/$*
-- 
2.39.2

>From 9fd880fea151ef73266938f65f423003f9d8f36b Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <nico...@debian.org>
Date: Thu, 5 Oct 2023 14:39:35 +0200
Subject: [PATCH 2/2] test driver: move error reporting to a separate procedure

---
 debian/tests/ghdl-tests | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/debian/tests/ghdl-tests b/debian/tests/ghdl-tests
index 871d594b..9ef0a66d 100755
--- a/debian/tests/ghdl-tests
+++ b/debian/tests/ghdl-tests
@@ -6,15 +6,19 @@ set -C -e -f -u
 # Debian yet.
 TESTS="sanity gna vests synth vpi vhpi"
 
-test $# = 2
+error() {
+    echo >&2 "$0: $1"
+    exit 1
+}
+
+test $# = 2 || error "bad argument count: $#"
 
 case "$2" in
     gcc|llvm|mcode)
 	BACKEND=$2
 	;;
     *)
-	echo >&2 "Invalid backend specification"
-	exit 1
+	error "invalid backend specification: $2"
 esac
 
 case "$1" in
@@ -27,8 +31,7 @@ case "$1" in
 	GHDL=/usr/bin/ghdl-$BACKEND
 	;;
     *)
-	echo >&2 "Invalid test environment specification"
-	exit 1
+	error "invalid test environment specification: $1"
 esac
 
 # Copy testsuite into $RUNDIR to execute there, so that no cleanup is necessary
@@ -50,6 +53,5 @@ if ./testsuite.sh $TESTS -- --keep-going; then
 elif test $BACKEND = llvm; then
     echo "Tests for backend llvm failed (but ignored for now)."
 else
-    echo >&2 "Tests for backend $BACKEND failed."
-    exit 1
+    error "tests for backend $BACKEND failed."
 fi
-- 
2.39.2

Reply via email to