* [PATCH] gnu: Add tlp.
@ 2017-01-31 21:01 Mathieu Othacehe
2017-02-09 22:27 ` Ludovic Courtès
2017-02-10 6:26 ` John Darrington
0 siblings, 2 replies; 7+ messages in thread
From: Mathieu Othacehe @ 2017-01-31 21:01 UTC (permalink / raw)
To: guix-devel
* gnu/packages/linux (tlp): New variable.
---
gnu/packages/linux.scm | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 94 insertions(+)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 395801e8e..691838747 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -20,6 +20,7 @@
;;; Copyright © 2016 ng0 <ng0@libertad.pw>
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.com>
+;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -44,6 +45,7 @@
#:use-module (gnu packages attr)
#:use-module (gnu packages autotools)
#:use-module (gnu packages base)
+ #:use-module (gnu packages bash)
#:use-module (gnu packages bison)
#:use-module (gnu packages calendar)
#:use-module (gnu packages check)
@@ -65,6 +67,7 @@
#:use-module (gnu packages man)
#:use-module (gnu packages maths)
#:use-module (gnu packages ncurses)
+ #:use-module (gnu packages networking)
#:use-module (gnu packages perl)
#:use-module (gnu packages pciutils)
#:use-module (gnu packages pkg-config)
@@ -3406,3 +3409,94 @@ set the screen to be pitch black at a vaĺue of 0 (or higher).
Light is the successor of lightscript.")
(license license:gpl3+)))
+
+(define-public tlp
+ (package
+ (name "tlp")
+ (version "0.9")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://github.com/linrunner/"
+ (string-upcase name)
+ "/archive/" version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0xksm8ar6dbq0azbfz8qs9yyzqg1j333lyd5znc074rz8inj4yw8"))))
+ (inputs `(("bash" ,bash)
+ ("dbus" ,dbus)
+ ("ethtool" ,ethtool)
+ ("eudev" ,eudev)
+ ("grep" ,grep)
+ ("hdparm" ,hdparm)
+ ("inetutils" ,inetutils)
+ ("iw" ,iw)
+ ("kmod" ,kmod)
+ ("pciutils" ,pciutils)
+ ("perl" ,perl)
+ ("rfkill" ,rfkill)
+ ("sed" ,sed)
+ ("usbutils" ,usbutils)
+ ("util-linux" ,util-linux)
+ ("wireless-tools" ,wireless-tools)))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (delete 'configure)
+ (add-before 'build 'setenv
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (setenv "TLP_WITH_SYSTEMD" "0")
+ (setenv "TLP_NO_INIT" "1")
+ (setenv "TLP_NO_PMUTILS" "1")
+ (setenv "TLP_SBIN" (string-append out "/bin"))
+ (setenv "TLP_BIN" (string-append out "/bin"))
+ (setenv "TLP_TLIB" (string-append out "/share/tlp-pm"))
+ (setenv "TLP_ULIB" (string-append out "/lib/udev"))
+ (setenv "TLP_CONF" (string-append out "/etc/tlp"))
+ (setenv "TLP_SHCPL"
+ (string-append out "/share/bash-completion/completions"))
+ (setenv "TLP_MAN" (string-append out "/share/man")))))
+ (delete 'check)
+ (replace 'install
+ (lambda _
+ (system "make install-tlp install-man")))
+ (add-after 'install 'wrap
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
+ (bin-files (find-files bin ".*")))
+ (define (bin-directory input-name)
+ (string-append (assoc-ref inputs input-name) "/bin"))
+ (define (sbin-directory input-name)
+ (string-append (assoc-ref inputs input-name) "/sbin"))
+ (for-each (lambda (program)
+ (wrap-program program
+ `("PATH" ":" prefix
+ ,(append
+ (map bin-directory '("bash"
+ "coreutils"
+ "dbus"
+ "eudev"
+ "grep"
+ "inetutils"
+ "kmod"
+ "perl"
+ "sed"
+ "usbutils"
+ "util-linux"))
+ (map sbin-directory '("ethtool"
+ "hdparm"
+ "iw"
+ "pciutils"
+ "rfkill"
+ "wireless-tools"))))))
+ bin-files)))))))
+ (home-page "http://linrunner.de/en/tlp/tlp.html")
+ (synopsis "Power management tool for Linux")
+ (description "TLP is a power management tool for Linux. It comes with
+a default configuration already optimized for battery life. Nevertheless,
+TLP is customizable to fulfil system requirements. TLP settings are applied
+every time the power supply source is changed.")
+ (license license:gpl2)))
--
2.11.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] gnu: Add tlp.
2017-01-31 21:01 [PATCH] gnu: Add tlp Mathieu Othacehe
@ 2017-02-09 22:27 ` Ludovic Courtès
2017-02-10 6:26 ` John Darrington
1 sibling, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2017-02-09 22:27 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: guix-devel
Mathieu Othacehe <m.othacehe@gmail.com> skribis:
> * gnu/packages/linux (tlp): New variable.
[...]
> + (home-page "http://linrunner.de/en/tlp/tlp.html")
> + (synopsis "Power management tool for Linux")
> + (description "TLP is a power management tool for Linux. It comes with
> +a default configuration already optimized for battery life. Nevertheless,
> +TLP is customizable to fulfil system requirements. TLP settings are applied
> +every time the power supply source is changed.")
> + (license license:gpl2)))
Per ‘COPYING’ this is GPLv2+ and GPLv3+ for one file.
Applied with this change, thanks!
Ludo’.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] gnu: Add tlp.
2017-01-31 21:01 [PATCH] gnu: Add tlp Mathieu Othacehe
2017-02-09 22:27 ` Ludovic Courtès
@ 2017-02-10 6:26 ` John Darrington
2017-02-10 12:49 ` Ludovic Courtès
1 sibling, 1 reply; 7+ messages in thread
From: John Darrington @ 2017-02-10 6:26 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 874 bytes --]
On Tue, Jan 31, 2017 at 10:01:18PM +0100, Mathieu Othacehe wrote:
+ (home-page "http://linrunner.de/en/tlp/tlp.html")
+ (synopsis "Power management tool for Linux")
+ (description "TLP is a power management tool for Linux. It comes with
Shouldn't we changed "Linux" to "Linux based GNU systems" or something similar?
+a default configuration already optimized for battery life. Nevertheless,
+TLP is customizable to fulfil system requirements. TLP settings are applied
+every time the power supply source is changed.")
+ (license license:gpl2)))
--
2.11.0
--
Avoid eavesdropping. Send strong encrypted email.
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] gnu: Add tlp.
2017-02-10 6:26 ` John Darrington
@ 2017-02-10 12:49 ` Ludovic Courtès
2017-02-10 14:14 ` John Darrington
0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2017-02-10 12:49 UTC (permalink / raw)
To: John Darrington; +Cc: guix-devel
John Darrington <john@darrington.wattle.id.au> skribis:
> On Tue, Jan 31, 2017 at 10:01:18PM +0100, Mathieu Othacehe wrote:
>
> + (home-page "http://linrunner.de/en/tlp/tlp.html")
> + (synopsis "Power management tool for Linux")
> + (description "TLP is a power management tool for Linux. It comes with
>
> Shouldn't we changed "Linux" to "Linux based GNU systems" or something similar?
It uses interfaces specific to the kernel Linux so I think it’s
technically correct.
Ludo’.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] gnu: Add tlp.
2017-02-10 12:49 ` Ludovic Courtès
@ 2017-02-10 14:14 ` John Darrington
2017-02-10 14:30 ` David Craven
2017-02-10 15:38 ` Ludovic Courtès
0 siblings, 2 replies; 7+ messages in thread
From: John Darrington @ 2017-02-10 14:14 UTC (permalink / raw)
To: Ludovic Court??s; +Cc: guix-devel
[-- Attachment #1: Type: text/plain, Size: 1378 bytes --]
On Fri, Feb 10, 2017 at 01:49:07PM +0100, Ludovic Court??s wrote:
John Darrington <john@darrington.wattle.id.au> skribis:
> On Tue, Jan 31, 2017 at 10:01:18PM +0100, Mathieu Othacehe wrote:
>
> + (home-page "http://linrunner.de/en/tlp/tlp.html")
> + (synopsis "Power management tool for Linux")
> + (description "TLP is a power management tool for Linux. It comes with
>
> Shouldn't we changed "Linux" to "Linux based GNU systems" or something similar?
It uses interfaces specific to the kernel Linux so I think it???s
technically correct.
But grammatically incorrect. Specifically, the preposition "for" is wrong.
It implies that the package provides some feature that Linux can use. Whereas
the opposite is true.
A more gramatically correct sentance might say "power management tool using
Linux kernel features".
But I wonder why we even mention it? I mean if a package happens to use libc, we don't
say in the package description or sysnopsis "an editor which makes using the
fopen, and fclose calls of glibc".
--
Avoid eavesdropping. Send strong encrypted email.
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] gnu: Add tlp.
2017-02-10 14:14 ` John Darrington
@ 2017-02-10 14:30 ` David Craven
2017-02-10 15:38 ` Ludovic Courtès
1 sibling, 0 replies; 7+ messages in thread
From: David Craven @ 2017-02-10 14:30 UTC (permalink / raw)
To: John Darrington; +Cc: guix-devel
> "an editor which makes using the fopen, and fclose calls of glibc".
You nailed the grammar there! We should probably add this to the
manual as an example of a great synopsis.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] gnu: Add tlp.
2017-02-10 14:14 ` John Darrington
2017-02-10 14:30 ` David Craven
@ 2017-02-10 15:38 ` Ludovic Courtès
1 sibling, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2017-02-10 15:38 UTC (permalink / raw)
To: John Darrington; +Cc: guix-devel
John Darrington <john@darrington.wattle.id.au> skribis:
> On Fri, Feb 10, 2017 at 01:49:07PM +0100, Ludovic Court??s wrote:
> John Darrington <john@darrington.wattle.id.au> skribis:
>
> > On Tue, Jan 31, 2017 at 10:01:18PM +0100, Mathieu Othacehe wrote:
> >
> > + (home-page "http://linrunner.de/en/tlp/tlp.html")
> > + (synopsis "Power management tool for Linux")
> > + (description "TLP is a power management tool for Linux. It comes with
> >
> > Shouldn't we changed "Linux" to "Linux based GNU systems" or something similar?
>
> It uses interfaces specific to the kernel Linux so I think it???s
> technically correct.
>
> But grammatically incorrect. Specifically, the preposition "for" is wrong.
> It implies that the package provides some feature that Linux can use. Whereas
> the opposite is true.
>
> A more gramatically correct sentance might say "power management tool using
> Linux kernel features".
Right, or “for Linux-based operating systems.”
I’m happy if you make one of these changes. :-)
> But I wonder why we even mention it? I mean if a package happens to use libc, we don't
> say in the package description or sysnopsis "an editor which makes using the
> fopen, and fclose calls of glibc".
I think we mention it because while GuixSD uses glibc, it may be able to
use different kernels in the future.
Ludo’.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-02-10 15:38 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-31 21:01 [PATCH] gnu: Add tlp Mathieu Othacehe
2017-02-09 22:27 ` Ludovic Courtès
2017-02-10 6:26 ` John Darrington
2017-02-10 12:49 ` Ludovic Courtès
2017-02-10 14:14 ` John Darrington
2017-02-10 14:30 ` David Craven
2017-02-10 15:38 ` Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.