gnu: tlp: Update to 1.8.0.

* gnu/packages/linux.scm (tlp): Update to 1.8.0.

Change-Id: Ie3f02ddffc8d38f47945e5acc2c28c13c6586091
This commit is contained in:
Nicolas Goaziou 2025-02-22 21:09:44 +01:00
parent 6cd8c58496
commit 0b8ceaa1cd
No known key found for this signature in database
GPG key ID: DA00B4F048E92F2D

View file

@ -8129,7 +8129,7 @@ interface in sysfs, which can be accomplished with the included udev rules.")
(define-public tlp (define-public tlp
(package (package
(name "tlp") (name "tlp")
(version "1.5.0") (version "1.8.0")
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
@ -8138,7 +8138,7 @@ interface in sysfs, which can be accomplished with the included udev rules.")
(commit version))) (commit version)))
(file-name (git-file-name name version)) (file-name (git-file-name name version))
(sha256 (sha256
(base32 "0cssclk2brhwvn9dm7h5snm2svwy0c8cfr4z2cgkdkac2pfaaxw4")))) (base32 "0r8r95wjb1sl5v8mli7kba2py9hc0ps915fx4lap5pg108ik9a06"))))
(native-inputs (native-inputs
(list shellcheck)) (list shellcheck))
(inputs (inputs
@ -8168,78 +8168,61 @@ interface in sysfs, which can be accomplished with the included udev rules.")
(arguments (arguments
;; XXX: The full test suite is run with "checkall" but it requires ;; XXX: The full test suite is run with "checkall" but it requires
;; "checkbashisms" and "perlcritic", not yet packaged in Guix. ;; "checkbashisms" and "perlcritic", not yet packaged in Guix.
`(#:test-target "shellcheck" (list
#:modules ((guix build gnu-build-system) #:test-target "shellcheck"
#:modules '((guix build gnu-build-system)
(guix build utils) (guix build utils)
(srfi srfi-1)) (srfi srfi-1))
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(delete 'configure) ; no configure script (delete 'configure) ; no configure script
(add-before 'build 'setenv (add-before 'build 'setenv
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let ((out (assoc-ref outputs "out"))) (setenv "TLP_WITH_SYSTEMD" "0")
(setenv "TLP_WITH_SYSTEMD" "0") (setenv "TLP_NO_INIT" "1")))
(setenv "TLP_NO_INIT" "1") (add-before 'build 'fix-installation
(setenv "TLP_NO_PMUTILS" "1") (lambda _
(setenv "TLP_SBIN" (string-append out "/bin")) ;; Stop the Makefile from trying to create system directories.
(setenv "TLP_BATD" (string-append out "/share/tlp/bat.d")) (substitute* "Makefile"
(setenv "TLP_BIN" (string-append out "/bin")) (("= /usr") (string-append "= " #$output))
(setenv "TLP_TLIB" (string-append out "/share/tlp")) (("= /etc") (string-append "= " #$output "/etc"))
(setenv "TLP_FLIB" (string-append out "/share/tlp/func.d")) (("install -d -m 755 \\$\\(_VAR\\)") "#"))))
(setenv "TLP_ULIB" (string-append out "/lib/udev")) (replace 'install
(setenv "TLP_CONFDEF" (lambda _ (invoke "make" "install-tlp" "install-man-tlp")))
(string-append out "/share/tlp/defaults.conf")) (add-after 'install 'wrap
(setenv "TLP_CONFDIR" (string-append out "/etc/tlp.d")) (lambda* (#:key inputs outputs #:allow-other-keys)
(setenv "TLP_CONFREN" (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
(string-append out "/share/tlp/rename.conf")) (bin-files (find-files bin ".*")))
(setenv "TLP_ELOD" (define (bin-directory input-name)
(string-append out "/lib/elogind/system-sleep")) (let ((p (assoc-ref inputs input-name)))
(setenv "TLP_SHCPL" (and p (string-append p "/bin"))))
(string-append out "/share/bash-completion/completions")) (define (sbin-directory input-name)
(setenv "TLP_MAN" (string-append out "/share/man")) (string-append (assoc-ref inputs input-name) "/sbin"))
(setenv "TLP_META" (string-append out "/share/metainfo"))))) (for-each (lambda (program)
(add-before 'install 'fix-installation (wrap-program program
(lambda _ `("PATH" ":" prefix
;; Stop the Makefile from trying to create system directories. ,(append
(substitute* "Makefile" (filter-map bin-directory
(("\\[ -f \\$\\(_CONFUSR\\) \\]") "#") '("bash"
(("install -d -m 755 \\$\\(_VAR\\)") "#")))) "coreutils"
(replace 'install "dbus"
(lambda _ (invoke "make" "install-tlp" "install-man-tlp"))) "eudev"
(add-after 'install 'wrap "grep"
(lambda* (#:key inputs outputs #:allow-other-keys) "inetutils"
(let* ((bin (string-append (assoc-ref outputs "out") "/bin")) "kmod"
(bin-files (find-files bin ".*"))) "perl"
(define (bin-directory input-name) "sed"
(let ((p (assoc-ref inputs input-name))) "usbutils"
(and p (string-append p "/bin")))) "util-linux"
(define (sbin-directory input-name) "x86-energy-perf-policy"))
(string-append (assoc-ref inputs input-name) "/sbin")) (filter-map sbin-directory
(for-each (lambda (program) '("ethtool"
(wrap-program program "hdparm"
`("PATH" ":" prefix "iw"
,(append "pciutils"
(filter-map bin-directory "rfkill"
'("bash" "wireless-tools"))))))
"coreutils" bin-files)))))))
"dbus"
"eudev"
"grep"
"inetutils"
"kmod"
"perl"
"sed"
"usbutils"
"util-linux"
"x86-energy-perf-policy"))
(filter-map sbin-directory
'("ethtool"
"hdparm"
"iw"
"pciutils"
"rfkill"
"wireless-tools"))))))
bin-files)))))))
(home-page "https://linrunner.de/en/tlp/tlp.html") (home-page "https://linrunner.de/en/tlp/tlp.html")
(synopsis "Power management tool for Linux") (synopsis "Power management tool for Linux")
(description "TLP is a power management tool for Linux. It comes with (description "TLP is a power management tool for Linux. It comes with