Subject: [PATCH core-updates] gnu: socat: Update to 1.8.0.3 and enable tests.

From: Maxim Cournoyer <[email-masked]>
Date: Sat, 12 Apr 2025 23:41:47 +0900

* gnu/packages/networking.scm (socat): Update to 1.8.0.3.
[arguments]: Remove #:tests? and add #:test-target, #:make-flags and #:phases.
[native-inputs]: New field.

Change-Id: Ice251af89ce1757aeb17c70debfcf38515fac1e8
---
 gnu/packages/networking.scm | 41 +++++++++++++++++++++++++++++++++----
 1 file changed, 37 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index caff01e1b9..9f8449954f 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -26,7 +26,7 @@
 ;;; Copyright © 2018, 2020-2022 Marius Bakke <[email-masked]>
 ;;; Copyright © 2018, 2020, 2021, 2022 Oleg Pykhalov <[email-masked]>
 ;;; Copyright © 2018 Pierre Neidhardt <[email-masked]>
-;;; Copyright © 2019, 2020, 2021, 2022, 2023, 2024 Maxim Cournoyer <[email-masked]>
+;;; Copyright © 2019-2025 Maxim Cournoyer <[email-masked]>
 ;;; Copyright © 2019 Vasile Dumitrascu <[email-masked]>
 ;;; Copyright © 2019 Julien Lepiller <[email-masked]>
 ;;; Copyright © 2019 Timotej Lazar <[email-masked]>
@@ -1234,7 +1234,7 @@ (define-public pproxy
 (define-public socat
   (package
     (name "socat")
-    (version "1.7.4.4")
+    (version "1.8.0.3")
     (source (origin
               (method url-fetch)
               (uri (string-append
@@ -1242,9 +1242,42 @@ (define-public socat
                     version ".tar.bz2"))
               (sha256
                (base32
-                "1b40ccdvxq5kaghsbwg4q3dq5aw4acw1bpqvs3v3ljp5y392pm7v"))))
+                "1580dbns45ibs171bx1dz6mkyfj6wichp10yjjkb6nyrc5rh3sq1"))))
     (build-system gnu-build-system)
-    (arguments '(#:tests? #f))          ; no test suite
+    (arguments
+     (list
+      #:make-flags
+      #~(list (string-append "SHELL="
+                             (search-input-file %build-inputs "bin/sh")))
+      #:test-target "test"
+      #:phases #~(modify-phases %standard-phases
+                   (add-after 'unpack 'patch-commands
+                     (lambda _
+                       (substitute* "test.sh"
+                         (("/bin/rm")
+                          (which "rm"))
+                         (("/usr/bin/env")
+                          (which "env"))
+                         (("/sbin/ifconfig")
+                          (which "ifconfig")))))
+                   (add-after 'unpack 'disable-problematic-tests
+                     (lambda _
+                       ;; Wholly skip tests 418 and 503, which fail
+                       ;; non-deterministically.
+                       (invoke "sed"
+                               "-e" "/NAME=ABSTRACT_USER/{n;s/$TESTS/SKIP/}"
+                               "-e" "/NAME=SYSTEM_SIGINT/{n;s/$TESTS/SKIP/}"
+                               "-i" "test.sh")
+                       (substitute* "Makefile.in"
+                         (("./test.sh")
+                          (string-append
+                           "./test.sh --expect-fail "
+                           (string-join
+                            '("228,467,468" ;requires /etc/services
+                              "478"   ;pkill: only one pattern can be provided
+                              "528")  ;requires tty
+                            ",")))))))))
+    (native-inputs (list net-tools procps))
     (inputs (list openssl readline))
     (home-page "http://www.dest-unreach.org/socat/")
     (synopsis

base-commit: e839cd1108626a6db6c47915f0efa4ab41c6a01c
-- 
2.49.0