me
/
guix
Archived
1
0
Fork 0

gnu: Add tlpui.

* gnu/packages/linux.scm (tlpui): New variable.
master
Nicolas Goaziou 2021-12-21 22:20:23 +01:00
parent 081c07d6a0
commit f7493e1dc8
No known key found for this signature in database
GPG Key ID: DA00B4F048E92F2D
1 changed files with 64 additions and 0 deletions

View File

@ -6926,6 +6926,70 @@ every time the power supply source is changed.")
;; rest is GPLv2+.
(license (list license:gpl2+ license:gpl3+))))
(define-public tlpui
(package
(name "tlpui")
(version "1.4.0-1")
(source
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/d4nj1/TLPUI")
(commit (string-append "tlpui-" version))))
(file-name (git-file-name name version))
(sha256
(base32 "0yshdpj521wiwc5rkvq89hwq9f3nqp3jbz8v921hpyk8wwq7nniq"))))
(build-system python-build-system)
(arguments
`(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'patch-setup.py
;; Install data_files to $out/share instead of /usr/share.
(lambda _
(substitute* "setup.py"
(("/usr/") ""))))
(add-after 'unpack 'use-tlp-input
;; Hard-code tlp-stat filename to avoid propagating "tlp".
(lambda* (#:key inputs #:allow-other-keys)
(let ((tlp-stat (search-input-file inputs "/bin/tlp-stat")))
(with-directory-excursion "tlpui"
(substitute* '("file.py" "settingshelper.py" "statui.py")
(("which\\(\"tlp-stat\"\\)")
(string-append "'" tlp-stat "'"))
(("\"tlp-stat\"")
(string-append "'" tlp-stat "'")))))))
(add-before 'check 'fix-home-directory
(lambda _
;; Tests fail with "Permission denied:
;; '/homeless-shelter'".
(setenv "HOME" "/tmp")))
;; `sanity-check' phase errors out with the following
;; messages: "Unable to init server: Could not connect:
;; Connection refused" and "Error: cannot read user
;; configuration from /etc/tlp.conf or /etc/default/tlp".
(delete 'sanity-check)
(replace 'check
(lambda _
(invoke "python" "-m" "discover")))
(add-after 'install 'wrap-gi-python
(lambda* (#:key outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(gi-typelib-path (getenv "GI_TYPELIB_PATH")))
(wrap-program (string-append out "/bin/tlpui")
`("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)))))))))
(native-inputs
(list `(,glib "bin") gobject-introspection python-discover))
(inputs
(list gtk+ python-pygobject tlp))
(home-page "https://github.com/d4nj1/TLPUI")
(synopsis "User interface for TLP written in Python")
(description
"The Python scripts in this project generate a GTK-UI to change
TLP configuration files easily. It aims to protect users from setting
bad configuration and to deliver a basic overview of all the valid
configuration values.")
(license license:gpl2+)))
(define-public lshw
(package
(name "lshw")