Source: libreswan
Version: 3.29-2
Tags: patch
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

libreswan fails to cross build from source, because it does not pass
cross tools to make. Using dh_auto_build mostly fixes that except that
the upstream makefiles hard code the build architecture pkg-config. The
attached patch addresses both issues and makes libreswan cross
buildable. Please consider applying it.

Helmut
diff --minimal -Nru libreswan-3.29/debian/changelog 
libreswan-3.29/debian/changelog
--- libreswan-3.29/debian/changelog     2019-08-20 00:57:33.000000000 +0200
+++ libreswan-3.29/debian/changelog     2020-04-20 19:55:15.000000000 +0200
@@ -1,3 +1,12 @@
+libreswan (3.29-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix FTCBFS: (Closes: #-1)
+    + Let dh_auto_build pass cross tools to make. (Closes: #-1)
+    + cross.patch: Make pkg-config substitutable.
+
+ -- Helmut Grohne <hel...@subdivi.de>  Mon, 20 Apr 2020 19:55:15 +0200
+
 libreswan (3.29-2) unstable; urgency=medium
 
   * Release to unstable
diff --minimal -Nru libreswan-3.29/debian/patches/cross.patch 
libreswan-3.29/debian/patches/cross.patch
--- libreswan-3.29/debian/patches/cross.patch   1970-01-01 01:00:00.000000000 
+0100
+++ libreswan-3.29/debian/patches/cross.patch   2020-04-20 19:55:15.000000000 
+0200
@@ -0,0 +1,20 @@
+--- libreswan-3.29.orig/mk/config.mk
++++ libreswan-3.29/mk/config.mk
+@@ -231,7 +231,7 @@
+ # XXX: Don't add NSSFLAGS to USERLAND_CFLAGS for now.  It needs to go
+ # after -I$(top_srcdir)/include and fixing that is an entirely
+ # separate cleanup.
+-NSSFLAGS?=$(shell pkg-config --cflags nss)
++NSSFLAGS?=$(shell $(PKG_CONFIG) --cflags nss)
+ # We don't want to link against every library pkg-config --libs nss
+ # returns
+ NSS_LDFLAGS ?= -lnss3 -lnssutil3
+@@ -288,6 +288,8 @@
+ 
+ MAKE?=make
+ 
++PKG_CONFIG?=pkg-config
++
+ # Enable AddressSanitizer - see 
https://libreswan.org/wiki/Compiling_with_AddressSanitizer
+ # requires clang or gcc >= 4.8 and libasan. Do not combine with Electric 
Fence and do not
+ # run pluto with --leak-detective
diff --minimal -Nru libreswan-3.29/debian/patches/series 
libreswan-3.29/debian/patches/series
--- libreswan-3.29/debian/patches/series        2019-08-20 00:57:33.000000000 
+0200
+++ libreswan-3.29/debian/patches/series        2020-04-20 19:55:15.000000000 
+0200
@@ -3,3 +3,4 @@
 0003-update-README.nss-to-match-debian-defaults-for-IPSEC.patch
 0004-move-to-python3-scripts-are-compatible.patch
 0005-minor-Fix-spelling-and-grammar.patch
+cross.patch
diff --minimal -Nru libreswan-3.29/debian/rules libreswan-3.29/debian/rules
--- libreswan-3.29/debian/rules 2019-08-20 00:57:33.000000000 +0200
+++ libreswan-3.29/debian/rules 2020-04-20 19:55:13.000000000 +0200
@@ -22,7 +22,7 @@
 CV25519_AVAILABILITY=$(shell if grep -q SEC_OID_CURVE25519 
/usr/include/nss/secoidt.h; then echo true; else echo false; fi)
 
 override_dh_auto_build:
-       $(MAKE) programs \
+       dh_auto_build -- programs \
                ARCH=$(DEB_HOST_ARCH) \
                IPSECVERSION=$(DEB_VERSION_UPSTREAM) \
                INC_USRLOCAL=/usr \

Reply via email to