diff mbox

[1/2] gnu: Add cpupower.

Message ID 20160719024520.9121-2-me@tobias.gr
State New
Headers show

Commit Message

Tobias Geerinckx-Rice July 19, 2016, 2:45 a.m. UTC
* gnu/packages/linux.scm (cpupower): New variable.
---
 gnu/packages/linux.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

Comments

Ludovic Courtès July 19, 2016, 8:59 p.m. UTC | #1
Tobias Geerinckx-Rice <me@tobias.gr> skribis:

> * gnu/packages/linux.scm (cpupower): New variable.

[...]

> +    (inputs `(("gettext" ,gnu-gettext)
> +              ("pciutils" ,pciutils)))

I made Gettext a ‘native-inputs’ and applied.

Thanks!

Ludo’.
Tobias Geerinckx-Rice July 19, 2016, 9:13 p.m. UTC | #2
Ludo',

On 2016-07-19 22:59, ludo@gnu.org wrote:
> I made Gettext a ‘native-inputs’ and applied.

Thanks. I am genuinely puzzled as to why I put it in ‘inputs’ to
begin with.

Isn't gettext almost always a should-be-native-input?
If so, I'll try my hand at a linter patch.

Kind regards,

T G-R
Eric Bavier July 19, 2016, 10:01 p.m. UTC | #3
On 2016-07-19 16:13, Tobias Geerinckx-Rice wrote:
> Ludo',
> 
> On 2016-07-19 22:59, ludo@gnu.org wrote:
>> I made Gettext a ‘native-inputs’ and applied.
> 
> Thanks. I am genuinely puzzled as to why I put it in ‘inputs’ to
> begin with.
> 
> Isn't gettext almost always a should-be-native-input?
> If so, I'll try my hand at a linter patch.

Not always.  I'm working on a package currently whose primary tool is a 
shell script that calls gettext at runtime for i18n.
diff mbox

Patch

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index d20314f..8b8d8d6 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2752,3 +2752,41 @@  from that to the system kernel's @file{/dev/random} machinery.")
     ;; The source package is offered under the GPL2+, but the files
     ;; 'rngd_rdrand.c' and 'rdrand_asm.S' are only available under the GPL2.
     (license (list license:gpl2 license:gpl2+))))
+
+(define-public cpupower
+  (package
+    (name "cpupower")
+    (version (package-version linux-libre))
+    (source (package-source linux-libre))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'enter-subdirectory
+                    (lambda _
+                      (chdir "tools/power/cpupower")))
+                  (delete 'configure)
+                  (add-before 'build 'fix-makefiles
+                    (lambda _
+                      (substitute* "Makefile"
+                        (("/usr/") "/")
+                        (("/bin/(install|pwd)" _ command) command))
+                      (substitute* "bench/Makefile"
+                        (("\\$\\(CC\\) -o") "$(CC) $(LDFLAGS) -o")))))
+       #:make-flags (let ((out (assoc-ref %outputs "out")))
+                      (list (string-append "DESTDIR=" out)
+                            (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")
+                            "docdir=/share/doc/cpupower"
+                            "confdir=$(docdir)/examples"
+                            ;; The Makefile recommends the following changes
+                            "DEBUG=false"
+                            "PACKAGE_BUGREPORT=bug-guix@gnu.org"))
+       #:tests? #f)) ;no tests
+    (inputs `(("gettext" ,gnu-gettext)
+              ("pciutils" ,pciutils)))
+    (home-page (package-home-page linux-libre))
+    (synopsis "CPU frequency and voltage scaling tools for Linux")
+    (description
+     "cpupower is a set of user-space tools that use the cpufreq feature of the
+Linux kernel to retrieve and control processor features related to power saving,
+such as frequency and voltage scaling.")
+    (license license:gpl2)))