Subject: [bug#56394] [PATCH] gnu: xl2tpd: Fix cross-compilation.

From: Jean Pierre De Jesus DIAZ <[email-masked]>
Date: Tue, 05 Jul 2022 09:30:47 +0000

Fixes cross-compilation and also updates (optionally) the version
of xl2tpd to 1.3.17, the changes between versions is minimal:

https://github.com/xelerance/xl2tpd/compare/v1.3.16..v1.3.17

—
Jean-Pierre De Jesus DIAZ
From 511bb2155973e24767befe11ea9b9eb66641f075 Mon Sep 17 00:00:00 2001
Message-Id: <[email-masked]>
In-Reply-To: <[email-masked]>
References: <[email-masked]>
From: Jean-Pierre De Jesus DIAZ <[email-masked]>
Date: Tue, 5 Jul 2022 11:27:01 +0200
Subject: [PATCH 2/2] gnu: xl2tpd: Update to 1.3.17.

* gnu/packages/vpn.scm (xl2tpd)[version]: Update to 1.3.17.
---
 gnu/packages/vpn.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index d239288d10..e3b91549db 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -1163,7 +1163,7 @@ (define-public wireguard-tools
 (define-public xl2tpd
   (package
     (name "xl2tpd")
-    (version "1.3.16")
+    (version "1.3.17")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -1172,7 +1172,7 @@ (define-public xl2tpd
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "0is5ccrvijz0pfm45pfrlbb9y8231yz3c4zqs8mkgakl9rxajy6l"))))
+                "06aiidwygywaa1jn8m2pw8l3vnsc2bjnacbjmlsdy1cqgr1f5cc9"))))
     (build-system gnu-build-system)
     (arguments
       (list #:make-flags
-- 
2.36.1

From 1baf2bb97ab79cd020718605131b0a087fa215b4 Mon Sep 17 00:00:00 2001
Message-Id: <[email-masked]>
From: Jean-Pierre De Jesus DIAZ <[email-masked]>
Date: Tue, 5 Jul 2022 11:21:07 +0200
Subject: [PATCH] gnu: xl2tpd: Fix cross-compilation.

* gnu/packages/vpn.scm (xl2tpd): Fix cross-compilation.
  [arguments]: Use G-Expressions and use `cc-for-target'.
---
 gnu/packages/vpn.scm | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/gnu/packages/vpn.scm b/gnu/packages/vpn.scm
index 23141e56a3..d239288d10 100644
--- a/gnu/packages/vpn.scm
+++ b/gnu/packages/vpn.scm
@@ -1175,19 +1175,21 @@ (define-public xl2tpd
                 "0is5ccrvijz0pfm45pfrlbb9y8231yz3c4zqs8mkgakl9rxajy6l"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:make-flags (list (string-append "PREFIX=" %output)
-                          "CC=gcc")
-       #:phases (modify-phases %standard-phases
-                  (delete 'configure) ;no configure script
-                  (add-before 'build 'setup-environment
-                    (lambda* (#:key inputs #:allow-other-keys)
-                      (substitute* "l2tp.h"
-                        (("/usr/sbin/pppd")
-                         (search-input-file inputs "/sbin/pppd")))
-                      (setenv "KERNELSRC"
-                              (assoc-ref inputs "kernel-headers"))
-                      #t)))
-       #:tests? #f))                    ; no tests provided
+      (list #:make-flags
+            #~(list (string-append "PREFIX=" #$output)
+                    (string-append "CC=" #$(cc-for-target)))
+            #:phases
+            #~(modify-phases %standard-phases
+                (delete 'configure) ;; No configure script.
+                (add-before 'build 'setup-environment
+                  (lambda* (#:key inputs #:allow-other-keys)
+                    (substitute* "l2tp.h"
+                      (("/usr/sbin/pppd")
+                       (search-input-file inputs "/sbin/pppd")))
+                    (setenv "KERNELSRC"
+                      (assoc-ref inputs "kernel-headers"))
+                    #t)))
+            #:tests? #f))           ;; No tests provided.
     (inputs (list libpcap ppp))
     (home-page "https://www.xelerance.com/software/xl2tpd/")
     (synopsis "Layer 2 Tunnelling Protocol Daemon (RFC 2661)")
-- 
2.36.1