summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-04-30 10:31:13 +0200
committerLeo Famulari <leo@famulari.name>2016-05-06 22:46:59 -0400
commitd17ae8c0c3023683a3175246a8ceedac237b5dd0 (patch)
tree1850133111a44ee5448981d88845d7e3fc2ecb19
parent13416a10afdbad6546ef7943d93aba795ee5703b (diff)
gnu: Add thinkfan.
* gnu/packages/linux.scm (thinkfan): New variable. Signed-off-by: Leo Famulari <leo@famulari.name>
-rw-r--r--gnu/packages/linux.scm52
1 files changed, 52 insertions, 0 deletions
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index e80c9004ed..fcea499227 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -11,6 +11,7 @@
;;; Copyright © 2016 Alex Kost <alezost@gmail.com>
;;; Copyright © 2016 Raymond Nicholson <rain1@openmailbox.org>
;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
+;;; Copyright © 2016 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -63,6 +64,7 @@
#:use-module (gnu packages readline)
#:use-module (gnu packages calendar)
#:use-module (gnu packages tls)
+ #:use-module (gnu packages freedesktop)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix utils)
@@ -2591,3 +2593,53 @@ where they are less likely to cause damage to the spinning disc. Requires a
drive that supports the ATA/ATAPI-7 IDLE IMMEDIATE command with unload
feature, and a laptop with an accelerometer. It has no effect on SSDs.")
(license license:gpl2)))
+
+(define-public thinkfan
+ (package
+ (name "thinkfan")
+ (version "0.9.3")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "mirror://sourceforge/thinkfan/"
+ version "/thinkfan-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0nz4c48f0i0dljpk5y33c188dnnwg8gz82s4grfl8l64jr4n675n"))
+ (modules '((guix build utils)))
+ ;; Fix erroneous man page location in Makefile leading to
+ ;; a compilation failure.
+ (snippet
+ '(substitute* "CMakeLists.txt"
+ (("thinkfan\\.1") "src/thinkfan.1")))))
+ (build-system cmake-build-system)
+ (arguments
+ `(#:modules ((guix build cmake-build-system)
+ (guix build utils)
+ (srfi srfi-26))
+ #:tests? #f ;no test target
+ #:configure-flags
+ ;; Enable reading temperatures from hard disks via S.M.A.R.T.
+ `("-DUSE_ATASMART:BOOL=ON")
+ #:phases
+ (modify-phases %standard-phases
+ ;; Install scripts for various foreign init systems.
+ (add-after 'install 'install-rc-scripts
+ (lambda* (#:key outputs #:allow-other-keys)
+ (for-each (cute install-file <>
+ (string-append (assoc-ref outputs "out")
+ "/share/thinkfan"))
+ (find-files (string-append "../thinkfan-" ,version
+ "/rcscripts")
+ ".*"))
+ #t)))))
+ (inputs
+ `(("libatasmart" ,libatasmart)))
+ (home-page "http://thinkfan.sourceforge.net/")
+ (synopsis "Simple fan control program")
+ (description
+ "Thinkfan is a simple fan control program. It reads temperatures,
+checks them against configured limits and switches to appropriate (also
+pre-configured) fan level. It requires a working @code{thinkpad_acpi} or any
+other @code{hwmon} driver that enables temperature reading and fan control
+from userspace.")
+ (license license:gpl3+)))