Subject: [bug#72810] [PATCH 1/4] gnu: Add go-github-com-libp2p-go-reuseport.

From: "Artyom V. Poptsov" <[email-masked]>
Date: Mon, 26 Aug 2024 00:23:34 +0300

* gnu/packages/golang-web.scm (go-github-com-libp2p-go-reuseport): New variable.

Change-Id: Iafbf09d6537cd5a92825830b64f952ad903ed96d
---
 gnu/packages/golang-web.scm | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/gnu/packages/golang-web.scm b/gnu/packages/golang-web.scm
index 28eba7f5d2..dd226b6c96 100644
--- a/gnu/packages/golang-web.scm
+++ b/gnu/packages/golang-web.scm
@@ -2266,6 +2266,37 @@ (define-public go-github-com-libp2p-go-netroute
 gopacket/routing.Router} interface for Golang.")
     (license license:bsd-3)))
 
+(define-public go-github-com-libp2p-go-reuseport
+  (package
+    (name "go-github-com-libp2p-go-reuseport")
+    (version "0.4.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/libp2p/go-reuseport")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "012kgriw1bchf0apk6ff4y34n9mffbh0cmi15348v9vj3h4w3sa5"))))
+    (build-system go-build-system)
+    (arguments
+     (list
+      #:import-path "github.com/libp2p/go-reuseport"))
+    (native-inputs (list go-github-com-stretchr-testify))
+    (propagated-inputs (list go-github-com-google-gopacket go-golang-org-x-net
+                             go-golang-org-x-sys))
+    (home-page "https://github.com/libp2p/go-reuseport")
+    (synopsis "Reuse TCP/UDP ports in Golang")
+    (description
+     "@code{go-reuseport} enables listening and dialing from the same TCP or UDP
+port.  This means that @code{SO_REUSEADDR} and @code{SO_REUSEPORT} socket options may
+be set.  This is particularly important when attempting to do TCP NAT hole-punching,
+which requires a process to both @code{Listen} and @code{Dial} on the same TCP port.
+@code{go-reuseport} provides some utilities around enabling this behaviour on various
+operating systems.")
+    (license license:isc)))
+
 (define-public go-github-com-makeworld-the-better-one-go-gemini
   (package
     (name "go-github-com-makeworld-the-better-one-go-gemini")
-- 
2.45.2