From patchwork Fri May 10 21:28:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Geerinckx-Rice X-Patchwork-Id: 13948 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0E88616F8E; Fri, 10 May 2019 22:29:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 89EF316F7B for ; Fri, 10 May 2019 22:29:08 +0100 (BST) Received: from localhost ([127.0.0.1]:50258 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hPD4m-0002hZ-54 for patchwork@mira.cbaines.net; Fri, 10 May 2019 17:29:08 -0400 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 X-Loop: help-debbugs@gnu.org Subject: [bug#35679] [PATCH 3/3] gnu: Add tpacpi-bat. Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 10 May 2019 21:29:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35679 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35679@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155752373712278 (code B ref -1); Fri, 10 May 2019 21:29:03 +0000 Received: (at submit) by debbugs.gnu.org; 10 May 2019 21:28:57 +0000 Received: from localhost ([127.0.0.1]:39293 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPD4b-0003By-1V for submit@debbugs.gnu.org; Fri, 10 May 2019 17:28:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34744) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hPD4W-0003BK-1i for submit@debbugs.gnu.org; Fri, 10 May 2019 17:28:53 -0400 Received: from lists.gnu.org ([209.51.188.17]:34841) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hPD4Q-0004ZM-U4 for submit@debbugs.gnu.org; Fri, 10 May 2019 17:28:46 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tobias.gr; h=from:to :subject:date:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=2018; i=me@tobias.gr; bh=MWK1rOPBOdgPzauzQbFTzYczFhFYoKcJn8Hq1HS+AN0=; b=hEdwOoTMLzxZ zhWBXSl3UaQeCdTXQS7tJ+SLCoDsN2z+qwO0bA651kQrLlb6Z/feOkD4zaUQ6Gwm p62ODWbqtqbStl4ImgKDZpX4lGQroJKiiVKw6ZfwZYzgeAqbjyhMIKMaX/SWwaoq mOOhY924Pp5gr56bEh5oLV7kuwSl9fGF1wA7Mrc+vG9wujcTcqRznGK5mNT9ctuX +NJwAbLUvfJ1Ui7ekHIWpS5AtAKu3Vcgv4B1JXnTI1wVhlO5XObY0o+4BabeF4v0 6TRLk0xnwi4BbQ6ACUzNfP6vL2Ad9iqg4io52xDDa9qldhmAI6012Na+XWiygdss pjL1noGkHA== 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> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190510212818.7996-1-me@tobias.gr> References: <35676@debbugs.gnu.org> <20190510212818.7996-1-me@tobias.gr> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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")