From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:49203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPD4i-0002fm-OA for guix-patches@gnu.org; Fri, 10 May 2019 17:29:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hPD4h-0004lI-LP for guix-patches@gnu.org; Fri, 10 May 2019 17:29:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:53986) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hPD4h-0004lA-IS for guix-patches@gnu.org; Fri, 10 May 2019 17:29:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hPD4h-0003Cm-F4 for guix-patches@gnu.org; Fri, 10 May 2019 17:29:03 -0400 Subject: [bug#35679] [PATCH 3/3] gnu: Add tpacpi-bat. Resent-Message-ID: Received: from eggs.gnu.org ([209.51.188.92]:49124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPD4P-0002fA-Ja for guix-patches@gnu.org; Fri, 10 May 2019 17:28:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hPD4O-0004Xj-5B for guix-patches@gnu.org; Fri, 10 May 2019 17:28:45 -0400 Received: from tobias.gr ([2001:470:7405::1]:53610) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hPD4N-0004Un-QR for guix-patches@gnu.org; Fri, 10 May 2019 17:28:44 -0400 Received: by tobias.gr (OpenSMTPD) with ESMTP id d5a5dd38 for ; Fri, 10 May 2019 21:28:40 +0000 (UTC) Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id e12c2a50 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Fri, 10 May 2019 21:28:39 +0000 (UTC) From: Tobias Geerinckx-Rice Date: Fri, 10 May 2019 23:28:18 +0200 Message-Id: <20190510212818.7996-3-me@tobias.gr> In-Reply-To: <20190510212818.7996-1-me@tobias.gr> References: <35676@debbugs.gnu.org> <20190510212818.7996-1-me@tobias.gr> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 35679@debbugs.gnu.org * gnu/packages/linux.scm (tpacpi-bat): New public variable. --- Same. gnu/packages/linux.scm | 62 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 9689a89cc9..080a8b228b 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -3748,6 +3748,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 +@uref{https://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") -- 2.21.0