diff mbox series

[bug#53953] gnu: Add acpilight.

Message ID 20220212104432.22611-1-brice@waegenei.re
State Accepted
Headers show
Series [bug#53953] gnu: Add acpilight. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Brice Waegeneire Feb. 12, 2022, 10:44 a.m. UTC
* gnu/packages/linux.scm (acpilight): New variable.
---
 gnu/packages/linux.scm | 42 +++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)


base-commit: 068d99978a0c9c6fb66f95455060c8d08ba55ac5

Comments

M Feb. 12, 2022, 1:34 p.m. UTC | #1
Brice Waegeneire schreef op za 12-02-2022 om 11:44 [+0100]:
> +             (substitute* "90-backlight.rules"
> +               (("/bin")
> +                (string-append (assoc-ref inputs "coreutils") "/bin")))
> +             #t)))))
> +    (inputs
> +     (list python))

coreutils-minimal needs to be added to inputs, otherwise the
substitute* above won't work when cross-compiling.  Also, phases do not
have to return #t anymore.

Greetings,
Maxime
M Feb. 12, 2022, 1:38 p.m. UTC | #2
Brice Waegeneire schreef op za 12-02-2022 om 11:44 [+0100]:
> +       #:make-flags (list "prefix="
> +                          (string-append "DESTDIR="
> +                                         (assoc-ref %outputs "out")))

%outputs, %build-inputs and friends are being deprecated (not 100%
sure, you might want to confirm with ludo) in favour of G-exps. More
concretely: (list #:make-flags #~(list "prefix=" (string-append
"DESTDIR=" #$output))).

Also, about prefix= and DESTDIR=, it's normally the other way around.

#~(list ; (probably) no need to set DESTDIR=, it's normally "" by default:
        (string-append "prefix=" #$output)).

(Search for "Staged installation" for details)

Also, are you sure about the case of 'prefix'?  Usually, Makefiles use
uppercase 'PREFIX' and not 'prefix' (for ./configure, it's other way
around).

Greetings,
Maxime.
Antero Mejr June 1, 2022, 2:14 p.m. UTC | #3
Any update on this merge? I was hoping to install acpilight but it doesn't appear to be in the latest master (commit 16a0aea02d). Thanks.
diff mbox series

Patch

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index bcbaa2166d..2d6c024906 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -35,7 +35,7 @@ 
 ;;; Copyright © 2019 Tim Gesthuizen <tim.gesthuizen@yahoo.de>
 ;;; Copyright © 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2019 Stefan Stefanović <stefanx2ovic@gmail.com>
-;;; Copyright © 2019, 2020, 2021 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2019-2022 Brice Waegeneire <brice@waegenei.re>
 ;;; Copyright © 2019 Kei Kebreau <kkebreau@posteo.net>
 ;;; Copyright © 2020, 2021 Oleg Pykhalov <go.wigust@gmail.com>
 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
@@ -8806,3 +8806,43 @@  (define-public libgpiod
     (license (list license:lgpl2.1+   ;; libgpiod
                    license:gpl2+      ;; gpio-tools
                    license:lgpl3+)))) ;; C++ bindings
+
+(define-public acpilight
+  (package
+    (name "acpilight")
+    (version "1.2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://gitlab.com/wavexx/acpilight.git")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1r0r3nx6x6vkpal6vci0zaa1n9dfacypldf6k8fxg7919vzxdn1w"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f  ;no tests
+       #:make-flags (list "prefix="
+                          (string-append "DESTDIR="
+                                         (assoc-ref %outputs "out")))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'unpack 'patch
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "Makefile"
+               (("udevadm") "true"))
+             (substitute* "90-backlight.rules"
+               (("/bin")
+                (string-append (assoc-ref inputs "coreutils") "/bin")))
+             #t)))))
+    (inputs
+     (list python))
+    (home-page "https://gitlab.com/wavexx/acpilight")
+    (synopsis "Backward-compatibile xbacklight replacement")
+    (description "acpilight is a backward-compatibile replacement for
+xbacklight that uses the ACPI interface to set the display
+brightness.  On modern laptops acpilight can control both display and
+keyboard backlight uniformly on either X11, the console or Wayland.")
+    (license license:gpl3+)))