Subject: [PATCH] gnu: Add powercap.
From: [email-masked]
To: [email-masked]
Cc: Morgan Smith <[email-masked]>
Date: Thu, 15 Jul 2021 17:27:56 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

From: Morgan Smith <[email-masked]>

* gnu/packages/linux.scm (powercap): New variable.
---
 gnu/packages/linux.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 41902e7785..295e456488 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1651,6 +1651,34 @@ at login.  Local and dynamic reconfiguration are its key features.")
 ;;; Miscellaneous.
 ;;;
 
+(define-public powercap
+  (package
+    (name "powercap")
+    (version "0.4.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/powercap/powercap")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1hp2i1d195v0n4jgvgaymkxlpgyhn07ic273gkda95lz65cdfcgm"))))
+    (build-system cmake-build-system)
+    (arguments
+     '(#:configure-flags
+       '("-DBUILD_SHARED_LIBS=On" "-DCMAKE_BUILD_TYPE=Release")))
+    (home-page "https://github.com/powercap/powercap")
+    (synopsis "C interface to the Linux power capping framework
+(sysfs interface)")
+    (description "C interface to the Linux power capping framework (sysfs
+interface).  It includes an implementation for working with Intel Running
+Average Power Limit (RAPL).
+
+It provides the commands powercap-info and powercap-set.")
+    (license license:bsd-3)))
+
 (define-public powerstat
   (package
     (name "powerstat")
-- 
2.32.0