guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/37: gnu: Add go-github-com-tklauser-numcpus.


From: guix-commits
Subject: 01/37: gnu: Add go-github-com-tklauser-numcpus.
Date: Wed, 6 Mar 2024 18:46:16 -0500 (EST)

sharlatan pushed a commit to branch master
in repository guix.

commit 548a4ac51cea891f4f5a796fd68e6e752f568a23
Author: Troy Figiel <troy@troyfigiel.com>
AuthorDate: Sun Feb 25 11:22:00 2024 +0100

    gnu: Add go-github-com-tklauser-numcpus.
    
    * gnu/packages/golang-xyz.scm (go-github-com-tklauser-numcpus): New 
variable.
    
    Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
---
 gnu/packages/golang-xyz.scm | 37 +++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/golang-xyz.scm b/gnu/packages/golang-xyz.scm
index e68948e495..ad6b8f04e6 100644
--- a/gnu/packages/golang-xyz.scm
+++ b/gnu/packages/golang-xyz.scm
@@ -15,6 +15,7 @@
 ;;; Copyright © 2023 Timo Wilken <guix@twilken.net>
 ;;; Copyright © 2023, 2024 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
+;;; Copyright © 2024 Troy Figiel <troy@troyfigiel.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1189,6 +1190,42 @@ Use waterutil with it to work with TUN/TAP 
packets/frames.")
       (home-page "https://github.com/stathat/go";)
       (license license:expat))))
 
+(define-public go-github-com-tklauser-numcpus
+  (package
+    (name "go-github-com-tklauser-numcpus")
+    (version "0.7.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/tklauser/numcpus";)
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1xcwk42zr6q72zvkqdd9nbyhvq11rmwm2164mr2rvbb9z7alkff8"))))
+    (build-system go-build-system)
+    (arguments
+     (list
+      #:go go-1.18
+      #:import-path "github.com/tklauser/numcpus"
+      #:phases #~(modify-phases %standard-phases
+                   (add-before 'check 'remove-failing-tests
+                     (lambda* (#:key import-path #:allow-other-keys)
+                       (with-directory-excursion (string-append "src/"
+                                                                import-path)
+                         (for-each delete-file-recursively
+                                   ;; These tests try to access
+                                   ;; /sys/devices/system/cpu, which is not
+                                   ;; available in the test environment.
+                                   '("numcpus_test.go" 
"numcpus_linux_test.go"))))))))
+    (propagated-inputs (list go-golang-org-x-sys))
+    (home-page "https://github.com/tklauser/numcpus";)
+    (synopsis "Provides information about the number of CPUs in the system")
+    (description
+     "This package provides both library functions and a command-line tool to
+query information regarding the number of CPUs available to the system.")
+    (license license:asl2.0)))
+
 (define-public go-go-uber-org-automaxprocs
   (package
     (name "go-go-uber-org-automaxprocs")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]