unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Troy Figiel <troy@troyfigiel.com>
To: 69379@debbugs.gnu.org
Subject: [bug#69379] [PATCH 1/2] gnu: Add go-github-com-tklauser-numcpus.
Date: Sun, 25 Feb 2024 11:22:00 +0100	[thread overview]
Message-ID: <877cisaiqz.fsf@troyfigiel.com> (raw)
In-Reply-To: <878r38al98.fsf@troyfigiel.com>

* gnu/packages/golang-xyz.scm (go-github-com-tklauser-numcpus): New variable.
---
 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 @@ (define-public go-github-com-stathat-go
       (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")
-- 
2.42.0





  reply	other threads:[~2024-02-25 11:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-25 10:29 [bug#69379] [PATCH 0/2] gnu: Add go-github-com-tklauser-go-sysconf Troy Figiel
2024-02-25 10:22 ` Troy Figiel [this message]
2024-02-25 10:24 ` [bug#69379] [PATCH 2/2] " Troy Figiel
2024-03-06 23:53 ` bug#69379: [PATCH 0/2] " Sharlatan Hellseher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877cisaiqz.fsf@troyfigiel.com \
    --to=troy@troyfigiel.com \
    --cc=69379@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).