diff mbox

Add thinkfan.

Message ID 874ma5lnqm.fsf@saiph.selenimh
State New
Headers show

Commit Message

Nicolas Goaziou May 10, 2016, 7:25 p.m. UTC
Hello,

ludo@gnu.org (Ludovic Courtès) writes:

> Nicolas Goaziou <mail@nicolasgoaziou.fr> skribis:

>> I realize there are hard-coded paths in init scripts. Would it make
>> sense to patch them so as to refer to `thinkfan' in store instead of
>> "/usr/sbin/thinkfan"?
>
> Yes, I think so.

Here's the patch, then.

Regards,

Comments

Ludovic Courtès May 11, 2016, 3:57 p.m. UTC | #1
Nicolas Goaziou <mail@nicolasgoaziou.fr> skribis:

> From f6e8845b46cd469a2e9a8540879436671944c87e Mon Sep 17 00:00:00 2001
> From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
> Date: Tue, 10 May 2016 21:20:49 +0200
> Subject: [PATCH] gnu: thinkfan: Fix daemon path in init scripts.
>
> * gnu/packages/linux.scm (thinkfan): Fix daemon path in init scripts.

Applied, thanks!

Ludo’.
diff mbox

Patch

From f6e8845b46cd469a2e9a8540879436671944c87e Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Date: Tue, 10 May 2016 21:20:49 +0200
Subject: [PATCH] gnu: thinkfan: Fix daemon path in init scripts.

* gnu/packages/linux.scm (thinkfan): Fix daemon path in init scripts.
---
 gnu/packages/linux.scm | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index fcea499..5500681 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -2622,15 +2622,20 @@  feature, and a laptop with an accelerometer.  It has no effect on SSDs.")
        `("-DUSE_ATASMART:BOOL=ON")
        #:phases
        (modify-phases %standard-phases
-         ;; Install scripts for various foreign init systems.
+         ;; Install scripts for various foreign init systems. Also fix
+         ;; hard-coded path for daemon.
          (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")
-                                   ".*"))
+             (let ((out (assoc-ref outputs "out"))
+                   (files (find-files
+                           (string-append "../thinkfan-" ,version "/rcscripts")
+                           ".*")))
+               (substitute* files
+                 (("/usr/sbin/(\\$NAME|thinkfan)" _ name)
+                  (string-append out "/sbin/" name)))
+               (for-each (cute install-file <>
+                               (string-append out "/share/thinkfan"))
+                         files))
              #t)))))
     (inputs
      `(("libatasmart" ,libatasmart)))
-- 
2.7.4