GNU bug report logs - #73466
[PATCH 01/16] gnu: Add ocaml-jsonrpc.

Previous Next

Package: guix-patches;

Reported by: Herman Rimm <herman <at> rimm.ee>

Date: Wed, 25 Sep 2024 07:56:02 UTC

Severity: normal

Tags: patch

Full log


Message #86 received at 73466 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 73466 <at> debbugs.gnu.org
Subject: [PATCH v2 11/15] gnu: Add ocaml-cpu.
Date: Thu, 26 Sep 2024 09:23:41 +0200
* gnu/packages/ocaml.scm (ocaml-cpu): Add variable.

Change-Id: Id7e0251a97b03fcd186637f1d6c6be17b11d96f8
---
 gnu/packages/ocaml.scm | 41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm
index bf723e9055..396a546213 100644
--- a/gnu/packages/ocaml.scm
+++ b/gnu/packages/ocaml.scm
@@ -5142,6 +5142,47 @@ (define-public ocaml-cppo
 @end enumerate")
     (license license:bsd-3)))
 
+(define-public ocaml-cpu
+  (package
+    (name "ocaml-cpu")
+    (version "2.0.0")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/UnixJunkie/cpu")
+               (commit (string-append "v" version))))
+        (sha256
+          (base32
+            "1vir6gh1bhvxgj2fcn69c38yhw3jgk7dyikmw789m5ld2csnyjiv"))))
+    (build-system ocaml-build-system)
+    (arguments
+      (list #:tests? #f ; There is no test target.
+            #:phases
+            #~(modify-phases %standard-phases
+                (add-before 'configure 'create-header
+                  (lambda _
+                    (invoke "autoheader")))
+                (add-before 'configure 'fix-/bin/sh
+                  (lambda _
+                    (substitute* "configure"
+                      (("-/bin/sh") (string-append "-" (which "sh"))))))
+                (replace 'install
+                  (lambda* (#:key outputs #:allow-other-keys)
+                    (let* ((out (assoc-ref outputs "out"))
+                           (libdir
+                             (string-append out "/lib/ocaml/site-lib")))
+                      (invoke "dune" "install" "--prefix" out "--libdir"
+                              libdir)))))))
+    (native-inputs (list autoconf dune ocaml))
+    (home-page "https://github.com/UnixJunkie/cpu")
+    (synopsis "Pin current process to given core")
+    (description
+      "The module installed is called Cpu in order to not conflict with
+the Setcore module that is installed by parmap.  This library can also
+get the number of CPU cores online.")
+    (license license:bsd-3)))
+
 (define-public ocaml-seq
   (package
     (name "ocaml-seq")
-- 
2.45.2





This bug report was last modified 262 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.