From patchwork Fri Feb 24 12:16:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas Goaziou X-Patchwork-Id: 47256 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 EB1BC16BA5; Fri, 24 Feb 2023 12:17:27 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B444716857 for ; Fri, 24 Feb 2023 12:17:25 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pVX0a-0001y4-CL; Fri, 24 Feb 2023 07:17:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pVX0Y-0001xr-Rf for guix-patches@gnu.org; Fri, 24 Feb 2023 07:17:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pVX0Y-0005Sc-Je for guix-patches@gnu.org; Fri, 24 Feb 2023 07:17:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pVX0Y-0001aZ-8P for guix-patches@gnu.org; Fri, 24 Feb 2023 07:17:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#61620] [PATCH v2] gnu: tlpui: Update to 1.5.0-6. References: <20230219101622.138785-1-mail@nicolasgoaziou.fr> In-Reply-To: <20230219101622.138785-1-mail@nicolasgoaziou.fr> Resent-From: Nicolas Goaziou Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 24 Feb 2023 12:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61620 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 61620@debbugs.gnu.org Received: via spool by 61620-submit@debbugs.gnu.org id=B61620.16772410136088 (code B ref 61620); Fri, 24 Feb 2023 12:17:02 +0000 Received: (at 61620) by debbugs.gnu.org; 24 Feb 2023 12:16:53 +0000 Received: from localhost ([127.0.0.1]:36207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVX0M-0001a5-TT for submit@debbugs.gnu.org; Fri, 24 Feb 2023 07:16:53 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:57159) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pVX0J-0001Zp-Ds for 61620@debbugs.gnu.org; Fri, 24 Feb 2023 07:16:49 -0500 Received: (Authenticated sender: admin@nicolasgoaziou.fr) by mail.gandi.net (Postfix) with ESMTPSA id 6AD24E0005 for <61620@debbugs.gnu.org>; Fri, 24 Feb 2023 12:16:40 +0000 (UTC) From: Nicolas Goaziou Date: Fri, 24 Feb 2023 13:16:33 +0100 Message-Id: <20230224121633.310678-1-mail@nicolasgoaziou.fr> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/linux.scm (tlpui): Update to 1.5.0-6. [arguments]<#:phases>: Rename USE-TLP-INPUT into SET-ABSOLUTE-LOCATIONS to be more accurate. Also add a new phase to skip failing tests. [inputs]: Add LSBUTILS and PCIUTILS. --- gnu/packages/linux.scm | 42 ++++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) base-commit: e36ac715518387686bd8165e1724ce54984ee0ee diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 691e0d2edc..65c5171463 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -11,7 +11,7 @@ ;;; Copyright © 2016, 2017 Alex Kost ;;; Copyright © 2016 Raymond Nicholson ;;; Copyright © 2016 Mathieu Lirzin -;;; Copyright © 2016, 2018-2022 Nicolas Goaziou +;;; Copyright © 2016, 2018-2023 Nicolas Goaziou ;;; Copyright © 2016, 2018, 2019, 2020, 2021, 2022 Ricardo Wurmus ;;; Copyright © 2016 David Craven ;;; Copyright © 2016 John Darrington @@ -7517,7 +7517,7 @@ (define (sbin-directory input-name) (define-public tlpui (package (name "tlpui") - (version "1.5.0-1") + (version "1.5.0-6") (source (origin (method git-fetch) @@ -7526,7 +7526,7 @@ (define-public tlpui (commit (string-append "tlpui-" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "16a6x733szsggn23ns7bj3gpvb80675plh96v4llrz0s8p3h47pg")))) + (base32 "0zxiciafq1xmb047jlyhipkkj4vaiw4jzbx71f6xgx559dy96paq")))) (build-system python-build-system) (arguments (list @@ -7537,16 +7537,31 @@ (define-public tlpui (lambda _ (substitute* "setup.py" (("/usr/") "")))) - (add-after 'unpack 'use-tlp-input - ;; Hard-code tlp-stat filename to avoid propagating "tlp". + (add-after 'unpack 'set-absolute-locations (lambda* (#:key inputs #:allow-other-keys) - (let ((tlp-stat (search-input-file inputs "/bin/tlp-stat"))) + (let ((defaults.conf + (search-input-file inputs "/share/tlp/defaults.conf")) + (lspci (search-input-file inputs "/sbin/lspci")) + (lsusb (search-input-file inputs "/bin/lsusb")) + (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 "'"))))))) + (string-append "'" tlp-stat "'")) + (("/usr/share/tlp/defaults.conf") + (string-append "'" defaults.conf "'"))) + (substitute* "ui_config_objects/gtkusblist.py" + (("\"lsusb\"") + (string-append "'" lsusb "'"))) + (substitute* "ui_config_objects/gtkpcilist.py" + (("\"lspci\"") + (string-append "'" lspci "'"))) + ;; Settings check if various tlp executables, lspci and + ;; usbutils are available. Skip this phase since we know + ;; for sure they are (and it avoids patching each location). + (substitute* "settingshelper.py" + (("(command_exists = ).*" _ lead) + (string-append lead "True\n"))))))) (add-before 'check 'fix-home-directory (lambda _ ;; Tests fail with "Permission denied: @@ -7557,6 +7572,13 @@ (define-public tlpui ;; Connection refused" and "Error: cannot read user ;; configuration from /etc/tlp.conf or /etc/default/tlp". (delete 'sanity-check) + ;; Skip two failing tests (out of 10) about configuration file + ;; issues. + (add-before 'check 'skip-failing-tests + (lambda _ + (substitute* "test/test_tlp_settings.py" + ((".*?windowxsize = 900.*") "") + ((".*?windowysize = 600.*") "")))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? @@ -7569,7 +7591,7 @@ (define-public tlpui (native-inputs (list `(,glib "bin") gobject-introspection python-discover)) (inputs - (list gtk+ python-pygobject tlp)) + (list gtk+ pciutils python-pygobject tlp usbutils)) (home-page "https://github.com/d4nj1/TLPUI") (synopsis "User interface for TLP written in Python") (description