@@ -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")