Subject: [PATCH v3 5/5] gnu: Add go-github-com-shirou-gopsutil-v3.

From: Troy Figiel <[email-masked]>
Date: Sat, 24 Feb 2024 09:05:28 +0100

* gnu/packages/golang-xyz.scm (go-github-com-shirou-gopsutil-v3): New variable.
---
 gnu/packages/golang-xyz.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/golang-xyz.scm b/gnu/packages/golang-xyz.scm
index 6eb5770c0f..2c154dd11c 100644
--- a/gnu/packages/golang-xyz.scm
+++ b/gnu/packages/golang-xyz.scm
@@ -16,6 +16,7 @@
 ;;; Copyright © 2023 Timo Wilken <[email-masked]>
 ;;; Copyright © 2023, 2024 Sharlatan Hellseher <[email-masked]>
 ;;; Copyright © 2024 Artyom V. Poptsov <[email-masked]>
+;;; Copyright © 2024 Troy Figiel <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1141,6 +1142,33 @@ (define-public go-github-com-shirou-gopsutil-v2
 (define-public go-github-com-shirou-gopsutil
   (deprecated-package "go-github-com-shirou-gopsutil" go-github-com-shirou-gopsutil-v2))
 
+(define-public go-github-com-shirou-gopsutil-v3
+  (package
+    (inherit go-github-com-shirou-gopsutil-v2)
+    (name "go-github-com-shirou-gopsutil-v3")
+    (version "3.24.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/shirou/gopsutil")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0mnlxfmssd15la95c64rsfds92fwp5yx4b2kb8madbj21qi813jf"))))
+    (arguments
+     (list
+      #:go go-1.18
+      #:import-path "github.com/shirou/gopsutil"
+      #:phases #~(modify-phases %standard-phases
+                   (add-before 'check 'remove-failing-tests
+                     (lambda* (#:key import-path #:allow-other-keys)
+                       (delete-file-recursively
+                        ;; host_test.go tries to access files such as
+                        ;; /var/run/utmp that do not exist in the build
+                        ;; environment.
+                        (string-append "src/" import-path "/host/host_test.go")))))))))
+
 (define-public go-github-com-skip2-go-qrcode
   (package
     (name "go-github-com-skip2-go-qrcode")
-- 
2.42.0