Subject: [PATCH] gnu: Add mbpfan.
From: Rene <[email-masked]>
To: "[email-masked]" <[email-masked]>
Date: Sun, 15 Apr 2018 12:04:44 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello team,
this is a proposed patch to add mbpfan.

Thank you
Rene

From 48444809ee2d0f2993fb0c2a772f52a68f13b30a Mon Sep 17 00:00:00 2001
From: Rene <[email-masked]>
Date: Sat, 14 Apr 2018 22:34:48 -0500
Subject: [PATCH] gnu: Add mbpfan.

* gnu/packages/linux.scm (mbpfan): New variable.
---
 gnu/packages/linux.scm | 37 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 26626ce8f..3125e64d9 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -16,7 +16,7 @@
 ;;; Copyright © 2016 David Craven <[email-masked]>
 ;;; Copyright © 2016 John Darrington <[email-masked]>
 ;;; Copyright © 2016, 2017, 2018 Marius Bakke <[email-masked]>
-;;; Copyright © 2016 Rene Saavedra <[email-masked]>
+;;; Copyright © 2016, 2018 Rene Saavedra <[email-masked]>
 ;;; Copyright © 2016 Carlos Sánchez de La Lama <[email-masked]>
 ;;; Copyright © 2016, 2017 Nils Gillmann <[email-masked]>
 ;;; Copyright © 2017, 2018 Leo Famulari <[email-masked]>
@@ -4596,3 +4596,38 @@ emulates the behaviour of Gunnar Monell's older fbgrab utility.")
 restriction, permission handling and more.  This package provides userspace
 interface to this kernel feature.")
     (license license:lgpl2.1)))
+
+(define-public mbpfan
+  (package
+    (name "mbpfan")
+    (version "2.0.2")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/dgraziotin/mbpfan/archive/v"
+                           version ".tar.gz"))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32
+         "0wifsws9icki95hhfh4zw1hmk07ddmkcz9mg5a9jr7q2kkrk01cx"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:tests? #f ; no tests
+       #:make-flags (let ((out (assoc-ref %outputs "out")))
+                      (list (string-append "DESTDIR=" out)
+                            "CC=gcc"))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch-paths
+           (lambda _
+             (substitute* "Makefile"
+               (("/usr") ""))))
+         (delete 'configure)))) ; There's no configure phase.
+    (home-page "https://github.com/dgraziotin/mbpfan")
+    (synopsis "Simple daemon to control fan speed")
+    (description
+     "Mbpfan is a fan control daemon for Apple Macbooks, the daemon uses input
+from @code{coretemp} module and sets the fan speed using the @code{applesmc}
+module.  It can be executed as a daemon or in the foreground with root
+privileges.")
+    (license license:gpl3)))
-- 
2.14.1