mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: tlp: Fix scripts.
tlp provides a number of executables. Before this change the "tlp" and "tlp-stat" executables worked fine but the "bluetooth", "nfc", "run-on-ac", "run-on-bat", "wifi", and "wwan" executables would give strange warnings. * gnu/packages/linux.scm (tlp): Fix scripts. <phases> [wrap]: Use wrap-script instead of wrap-program to preserve shell argument "$0". Don't wrap symlinks. <inputs>: Add guile-3.0 for wrap-script. Remove bash used for now removed wrap-program. Change-Id: I916a4385cb69db142f834839aa9aaf0d81085714 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
parent
2a8c5f834e
commit
5fd4df347e
1 changed files with 11 additions and 5 deletions
|
@ -145,6 +145,7 @@
|
||||||
#:use-module (gnu packages graphviz)
|
#:use-module (gnu packages graphviz)
|
||||||
#:use-module (gnu packages gstreamer)
|
#:use-module (gnu packages gstreamer)
|
||||||
#:use-module (gnu packages gtk)
|
#:use-module (gnu packages gtk)
|
||||||
|
#:use-module (gnu packages guile)
|
||||||
#:use-module (gnu packages haskell-apps)
|
#:use-module (gnu packages haskell-apps)
|
||||||
#:use-module (gnu packages haskell-xyz)
|
#:use-module (gnu packages haskell-xyz)
|
||||||
#:use-module (gnu packages image)
|
#:use-module (gnu packages image)
|
||||||
|
@ -8538,11 +8539,11 @@ interface in sysfs, which can be accomplished with the included udev rules.")
|
||||||
(native-inputs
|
(native-inputs
|
||||||
(list shellcheck))
|
(list shellcheck))
|
||||||
(inputs
|
(inputs
|
||||||
`(("bash" ,bash)
|
`(("dbus" ,dbus)
|
||||||
("dbus" ,dbus)
|
|
||||||
("ethtool" ,ethtool)
|
("ethtool" ,ethtool)
|
||||||
("eudev" ,eudev)
|
("eudev" ,eudev)
|
||||||
("grep" ,grep)
|
("grep" ,grep)
|
||||||
|
("guile" ,guile-3.0) ;for wrap-script
|
||||||
("hdparm" ,hdparm)
|
("hdparm" ,hdparm)
|
||||||
("inetutils" ,inetutils)
|
("inetutils" ,inetutils)
|
||||||
("iw" ,iw)
|
("iw" ,iw)
|
||||||
|
@ -8600,15 +8601,20 @@ interface in sysfs, which can be accomplished with the included udev rules.")
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||||
(let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
|
(let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
|
||||||
(sbin (string-append (assoc-ref outputs "out") "/sbin"))
|
(sbin (string-append (assoc-ref outputs "out") "/sbin"))
|
||||||
(bin-files (find-files bin ".*"))
|
;; Used to ignore symlinks which don't need wrapping
|
||||||
(sbin-files (find-files sbin ".*")))
|
(regular-file-predicate
|
||||||
|
(lambda (file stat) (eq? 'regular (stat:type stat))))
|
||||||
|
(bin-files (find-files bin regular-file-predicate))
|
||||||
|
(sbin-files (find-files sbin regular-file-predicate)))
|
||||||
(define (bin-directory input-name)
|
(define (bin-directory input-name)
|
||||||
(let ((p (assoc-ref inputs input-name)))
|
(let ((p (assoc-ref inputs input-name)))
|
||||||
(and p (string-append p "/bin"))))
|
(and p (string-append p "/bin"))))
|
||||||
(define (sbin-directory input-name)
|
(define (sbin-directory input-name)
|
||||||
(string-append (assoc-ref inputs input-name) "/sbin"))
|
(string-append (assoc-ref inputs input-name) "/sbin"))
|
||||||
(for-each (lambda (program)
|
(for-each (lambda (program)
|
||||||
(wrap-program program
|
;; Programs rely on $0 so we use wrap-script
|
||||||
|
;; instead of wrap-program
|
||||||
|
(wrap-script program
|
||||||
`("PATH" ":" prefix
|
`("PATH" ":" prefix
|
||||||
,(append
|
,(append
|
||||||
(filter-map bin-directory
|
(filter-map bin-directory
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue