Source: opencryptoki
Version: 3.23.0+dfsg-0.3
Tags: patch
User: [email protected]
Usertags: ftcbfs

opencryptoki fails to cross build from source for two reasons. The
immediate failure is a bit crazy as it results from $(CC_FOR_BUILD)
ending up being empty. This is due to running autoreconf without
installing autoconf-archive and therefore AX_CC_FOR_BUILD not being
substituted. Once substituted the build proceeds much further until a
build-time tools fails to be built due to missing a macro. This macro is
set for the host's CFLAGS and also needs to be set in CFLAGS_FOR_BUILD.
I'm attaching a patch addressing both problems for your convenience.
Please consider applying it and forwarding the upstream parts upstream.

Helmut
diff --minimal -Nru opencryptoki-3.23.0+dfsg/debian/changelog 
opencryptoki-3.23.0+dfsg/debian/changelog
--- opencryptoki-3.23.0+dfsg/debian/changelog   2024-07-19 14:53:37.000000000 
+0200
+++ opencryptoki-3.23.0+dfsg/debian/changelog   2025-04-15 12:21:50.000000000 
+0200
@@ -1,3 +1,12 @@
+opencryptoki (3.23.0+dfsg-0.4) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Missing Build-Depends: autoconf-archive for AX_CC_FOR_BUILD.
+    + cross.patch: Fix missing PKCS_GROUP macro in CFLAGS_FOR_BUILD.
+
+ -- Helmut Grohne <[email protected]>  Tue, 15 Apr 2025 12:21:50 +0200
+
 opencryptoki (3.23.0+dfsg-0.3) unstable; urgency=medium
 
   * Non-maintainer upload.
diff --minimal -Nru opencryptoki-3.23.0+dfsg/debian/control 
opencryptoki-3.23.0+dfsg/debian/control
--- opencryptoki-3.23.0+dfsg/debian/control     2024-06-20 15:01:43.000000000 
+0200
+++ opencryptoki-3.23.0+dfsg/debian/control     2025-04-15 12:21:42.000000000 
+0200
@@ -4,6 +4,7 @@
 Maintainer: Paulo Vital <[email protected]>
 Build-Depends:
  autoconf,
+ autoconf-archive,
  automake,
  bison,
  debhelper (>= 13~),
diff --minimal -Nru opencryptoki-3.23.0+dfsg/debian/patches/cross.patch 
opencryptoki-3.23.0+dfsg/debian/patches/cross.patch
--- opencryptoki-3.23.0+dfsg/debian/patches/cross.patch 1970-01-01 
01:00:00.000000000 +0100
+++ opencryptoki-3.23.0+dfsg/debian/patches/cross.patch 2025-04-15 
12:21:50.000000000 +0200
@@ -0,0 +1,10 @@
+--- opencryptoki-3.23.0+dfsg.orig/configure.ac
++++ opencryptoki-3.23.0+dfsg/configure.ac
+@@ -663,6 +663,7 @@
+ 
+ CFLAGS+=' -DCONFIG_PATH=\"$(localstatedir)/lib/opencryptoki\" 
-DSBIN_PATH=\"$(sbindir)\" -DLIB_PATH=\"$(libdir)\" 
-DLOCKDIR_PATH=\"$(lockdir)\" -DOCK_CONFDIR=\"$(sysconfdir)/opencryptoki\" 
-DOCK_LOGDIR=\"$(logdir)\"'
+ CFLAGS+=' -DPKCSSLOTD_USER=\"$(pkcsslotd_user)\" 
-DPKCS_GROUP=\"$(pkcs_group)\"'
++CFLAGS_FOR_BUILD+=' -DPKCS_GROUP=\"$(pkcs_group)\"'
+ CFLAGS+=" -std=c99 -Werror=implicit-int -Werror=implicit-function-declaration 
-Werror=int-conversion -Werror=strict-prototypes -Werror=old-style-definition 
-pedantic"
+ 
+ # At this point, CFLAGS is set to something sensible
diff --minimal -Nru opencryptoki-3.23.0+dfsg/debian/patches/series 
opencryptoki-3.23.0+dfsg/debian/patches/series
--- opencryptoki-3.23.0+dfsg/debian/patches/series      2024-06-19 
22:36:31.000000000 +0200
+++ opencryptoki-3.23.0+dfsg/debian/patches/series      2025-04-15 
12:21:50.000000000 +0200
@@ -3,3 +3,4 @@
 04-pkcsslotd-cmdline-args.patch
 
 lp-1982842-move-pkcs11-group-assigment-from-makefile-to-postinst.patch
+cross.patch

Reply via email to