Subject: [bug#49672] [PATCH v2 1/6] gnu: Fix GNU/Linux system detection

From: Thiago Jung Bauermann <[email-masked]>
Date: Sun, 27 Mar 2022 18:40:21 -0300

The current code isn’t strictly correct because the GNU triplet in
‘%current-target-system’ could end in “linux-gnu”. The helper works in all
cases.

* gnu/packages/messaging.scm (ngircd)[inputs]: Use ‘target-linux?’.
[arguments]<#:configure-flags>: Likewise.
* gnu/packages/ntp.scm (ntp)[inputs]: Likewise
---
 gnu/packages/messaging.scm | 8 ++------
 gnu/packages/ntp.scm       | 3 +--
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm
index f40c3a7e2ccb..44809754212a 100644
--- a/gnu/packages/messaging.scm
+++ b/gnu/packages/messaging.scm
@@ -899,17 +899,13 @@ (define-public ngircd
     (inputs `(("zlib" ,zlib)
               ("libwrap" ,tcp-wrappers)
               ("gnutls" ,gnutls)
-              ,@(if (string-suffix? "-linux"
-                                    (or (%current-target-system)
-                                        (%current-system)))
+              ,@(if (target-linux?)
                     `(("linux-pam" ,linux-pam))
                     '())))
     (arguments
      `(#:configure-flags
        '("--with-gnutls" "--with-iconv" "--enable-ipv6" "--with-tcp-wrappers"
-         ,@(if (string-suffix? "-linux"
-                               (or (%current-target-system)
-                                   (%current-system)))
+         ,@(if (target-linux?)
                '("--with-pam")
                '()))
        #:phases
diff --git a/gnu/packages/ntp.scm b/gnu/packages/ntp.scm
index 7a3c033b2e12..d7f99c614ed8 100644
--- a/gnu/packages/ntp.scm
+++ b/gnu/packages/ntp.scm
@@ -148,8 +148,7 @@ (define-public ntp
       ("libevent" ,libevent)
       ;; Build with POSIX capabilities support on GNU/Linux.  This allows 'ntpd'
       ;; to run as non-root (when invoked with '-u'.)
-      ,@(if (string-suffix? "-linux"
-                            (or (%current-target-system) (%current-system)))
+      ,@(if (target-linux?)
             `(("libcap" ,libcap))
             '())))
    (arguments