[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/17: gnu: Add tpacpi-bat.
From: |
guix-commits |
Subject: |
04/17: gnu: Add tpacpi-bat. |
Date: |
Sun, 19 May 2019 22:18:30 -0400 (EDT) |
nckx pushed a commit to branch master
in repository guix.
commit b313665fa0ca93c84aa80311cb57eca8396731af
Author: Tobias Geerinckx-Rice <address@hidden>
Date: Fri May 10 14:49:58 2019 +0200
gnu: Add tpacpi-bat.
* gnu/packages/linux.scm (tpacpi-bat): New public variable.
---
gnu/packages/linux.scm | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 62 insertions(+)
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index aa3b36c..24b4980 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -3770,6 +3770,68 @@ other @code{hwmon} driver that enables temperature
reading and fan control
from userspace.")
(license license:gpl3+)))
+(define-public tpacpi-bat
+ (package
+ (name "tpacpi-bat")
+ (version "3.1")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/teleshoes/tpacpi-bat.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0wbaz34z99gqx721alh5vmpxpj2yxg3x9m8jqyivfi1wfpwc2nd5"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:tests? #f ; no test target
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'refer-to-inputs
+ (lambda _
+ (substitute* "tpacpi-bat"
+ (("cat ")
+ (format "~a " (which "cat")))
+ ;; tpacpi-bat modprobes the acpi_call kernel module if it's not
+ ;; loaded. That's the administrator's prerogative; disable it.
+ (("system \"(modprobe .*)\"" _ match)
+ (format "die \"Please run ‘~a’ first.\\n\"" match)))
+ #t))
+ (delete 'configure) ; nothing to configure
+ (delete 'build) ; nothing to build
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (bin (string-append out "/bin"))
+ (doc (string-append out "/share/doc/" ,name "-" ,version)))
+ (install-file "tpacpi-bat" bin)
+
+ ;; There's no man page. Install other forms of documentation.
+ (for-each (lambda (file)
+ (let ((target (string-append doc "/" file)))
+ (mkdir-p (dirname target))
+ (copy-recursively file target)))
+ (list "battery_asl" "examples" "README.md"))
+ #t))))))
+ (inputs
+ `(("perl" ,perl)))
+ (home-page "https://github.com/teleshoes/tpacpi-bat")
+ (synopsis "ThinkPad battery charge controller")
+ (description
+ "Tpacpi-bat is a command-line interface to control battery charging on
address@hidden://github.com/teleshoes/tpacpi-bat/wiki/Supported-Hardware, Lenovo
+ThinkPad models released after 2011}, starting with the xx20 series. It can
+query and set the thresholds at which one or both batteries will start and stop
+charging, inhibit charging batteries for a set period of time, or force them to
+discharge when they otherwise would not.
+
+This tool merely exposes ACPI calls provided by the @code{acpi_call} Linux
+kernel module provided by the @code{acpi-call-linux-module} package, which must
+be installed and loaded separately. Only the original vendor firmware is
+supported.")
+ (license license:gpl3+)))
+
(define-public ntfs-3g
(package
(name "ntfs-3g")
- branch master updated (f5557bd -> b8ae2e9), guix-commits, 2019/05/19
- 01/17: gnu: openconnect: Update to 8.03., guix-commits, 2019/05/19
- 03/17: gnu: Add acpi-call-linux-module., guix-commits, 2019/05/19
- 05/17: gnu: wimlib: Update to 1.13.1., guix-commits, 2019/05/19
- 04/17: gnu: Add tpacpi-bat.,
guix-commits <=
- 06/17: gnu: restic: Update to 0.9.5., guix-commits, 2019/05/19
- 02/17: gnu: Move Linux-Libre modules to their own section., guix-commits, 2019/05/19
- 12/17: gnu: tumbler: Update to 0.2.4., guix-commits, 2019/05/19
- 09/17: gnu: exo: Don't use NAME in source URI., guix-commits, 2019/05/19
- 16/17: gnu: s6: Update to 2.8.0.1., guix-commits, 2019/05/19
- 17/17: gnu: libu2f-host: Update to 1.1.10., guix-commits, 2019/05/19
- 07/17: gnu: exo: Update to 0.12.5., guix-commits, 2019/05/19
- 14/17: gnu: stunnel: Update to 5.54., guix-commits, 2019/05/19
- 13/17: gnu: tumbler: Don't use NAME in source URI., guix-commits, 2019/05/19
- 10/17: gnu: thunar: Don't use NAME in source URI., guix-commits, 2019/05/19