Source: ghdl
Followup-For: Bug #1100461
Control: tags -1 + patch

Hello.

I suggest to remove the dependency on dh-ada-library and duplicate the
definitions of ADAFLAGS and GNATMAKEFLAGS.

Anyway, DEB_GNAT_VERSION must be read from the ghdl debian/control
file, but not from /usr/bin/gnatmake which may differ or be missing.

I would like to NMU the attached changes in a few days because this
bug blocks the gnat transition.
>From ad493c3f4d1c60c4fe9ac4930906c495b408928d Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <nico...@debian.org>
Date: Sun, 23 Mar 2025 19:19:53 +0100
Subject: [PATCH 1/2] Remove dh-ada-library from build-dependencies.  Closes:
 #1100461

---
 debian/control |  1 -
 debian/rules   | 22 +++++++++++++++++++++-
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/debian/control b/debian/control
index b51b9263..25b476fa 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,6 @@ Priority: optional
 Maintainer: Debian Electronics Team <pkg-electronics-de...@lists.alioth.debian.org>
 Uploaders: Andreas Bombe <a...@debian.org>
 Build-Depends: debhelper-compat (= 13),
-               dh-ada-library (>= 8.1),
                gnat-13, gcc-13, g++-13,
                gcc-13-source <!pkg.ghdl.nogcc>,
                libisl-dev (>= 0.14) <!pkg.ghdl.nogcc>,
diff --git a/debian/rules b/debian/rules
index 5611b4e2..5452d4a9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,7 +7,27 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-format
 #export DH_VERBOSE = 1
 
 include /usr/share/dpkg/default.mk
-include /usr/share/ada/packaging.mk
+
+# Ghdl build-depends on a gnat version that may differ from the
+# default Ada compiler, and hence be incompatible with dh-ada-library.
+# So we duplicate its computation of ADAFLAGS GNATMAKEFLAGS.
+DEB_GNAT_VERSION := $(shell \
+  sed '/.*\bgnat-\([0-9]\+\)\b.*/ ! d; s//\1/; q' debian/control)
+ADAFLAGS := $(shell \
+  $(foreach v,DEB_ADAFLAGS_SET     DEB_ADAFLAGS_MAINT_SET \
+              DEB_ADAFLAGS_PREPEND DEB_ADAFLAGS_MAINT_PREPEND \
+                                   DEB_ADAFLAGS_MAINT_STRIP \
+                                   DEB_ADAFLAGS_MAINT_APPEND \
+              DEB_BUILD_OPTIONS    DEB_BUILD_MAINT_OPTIONS, \
+    $(if $(filter undefined,$(origin $v)),\
+      unset $(v:DEB_ADA%=DEB_C%),\
+      export $(v:DEB_ADA%=DEB_C%)='$($v)') &&)\
+  DEB_CFLAGS_STRIP='$(DEB_ADAFLAGS_STRIP) -Wformat -Werror=format-security \
+    -Werror=implicit-function-declaration -fstack-clash-protection ' \
+  DEB_CFLAGS_APPEND='$(DEB_ADAFLAGS_APPEND) -gno-record-gcc-switches' \
+  dpkg-buildflags --get CFLAGS)
+GNATMAKEFLAGS := $(if $(filter terse,$(DEB_BUILD_OPTIONS)),,-v) \
+  $(DEB_BUILD_OPTION_PARALLEL:%=-j%) -R -eS
 
 # These variables are used to find and unpack the gcc source
 GCC_DIR := /usr/src/gcc-$(DEB_GNAT_VERSION)
-- 
2.39.5

>From e7de4af7af3fad512b2e7a3b429b90ab975551c1 Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <nico...@debian.org>
Date: Sun, 23 Mar 2025 19:38:54 +0100
Subject: [PATCH 2/2] Update changelog for an NMU.

---
 debian/changelog | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index eea86917..09c1534e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+ghdl (4.1.0+dfsg-4.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Remove dh-ada-library from build-dependencies.  Closes: #1100461
+
+ -- Nicolas Boulenguez <nico...@debian.org>  Sun, 23 Mar 2025 19:38:02 +0100
+
 ghdl (4.1.0+dfsg-4) unstable; urgency=medium
 
   * Restrict architectures to those on which GHDL builds and clears the
-- 
2.39.5

Reply via email to