GNU bug report logs - #51986
[PATCH] Add tlpui

Previous Next

Package: guix-patches;

Reported by: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

Date: Fri, 19 Nov 2021 21:37:02 UTC

Severity: normal

Tags: patch

Done: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 51986 in the body.
You can then email your comments to 51986 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#51986; Package guix-patches. (Fri, 19 Nov 2021 21:37:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 19 Nov 2021 21:37:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: guix-patches <at> gnu.org
Subject: [PATCH] Add tlpui
Date: Fri, 19 Nov 2021 22:36:29 +0100
[Message part 1 (text/plain, inline)]
Hello,

The following patch adds TLPUI to "linux.scm".

Regards,
-- 
Nicolas Goaziou
[0001-gnu-Add-tlpui.patch (text/x-diff, inline)]
From 701601c421713157c13f6fd2c649b7e69fc079fd Mon Sep 17 00:00:00 2001
Message-Id: <701601c421713157c13f6fd2c649b7e69fc079fd.1637357746.git.mail <at> nicolasgoaziou.fr>
From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Date: Fri, 19 Nov 2021 22:35:25 +0100
Subject: [PATCH] gnu: Add tlpui.

* gnu/packages/linux.scm (tlpui): New variable.
---
 gnu/packages/linux.scm | 55 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 1d005de1db..17a702c73e 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -6874,6 +6874,61 @@ (define-public tlp
     ;; rest is GPLv2+.
     (license (list license:gpl2+ license:gpl3+))))
 
+(define-public tlpui
+  (package
+    (name "tlpui")
+    (version "1.4.0")
+    (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 "1sd380inkiq8mljnzjd8p69a6cnwv19v2793358v3ws1mr55x127"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #false
+       #: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 (string-append (assoc-ref inputs "tlp")
+                                            "/bin/tlp-stat")))
+               (substitute* '("tlpui/file.py"
+                              "tlpui/settingshelper.py"
+                              "tlpui/statui.py")
+                 (("which\\(\"tlp-stat\"\\)") (string-append "'" tlp-stat "'"))
+                 (("\"tlp-stat\"") (string-append "'" tlp-stat "'"))))))
+         (add-after 'install 'wrap-gi-python
+           (lambda* (#:key inputs 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
+     `(("glib:bin" ,glib "bin")
+       ("gobject-introspection" ,gobject-introspection)))
+    (inputs
+     `(("gtk+" ,gtk+)
+       ("python-pygobject" ,python-pygobject)
+       ("tlp" ,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 has the aim 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")
-- 
2.34.0


Information forwarded to guix-patches <at> gnu.org:
bug#51986; Package guix-patches. (Thu, 25 Nov 2021 12:39:01 GMT) Full text and rfc822 format available.

Message #8 received at 51986 <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 51986 <at> debbugs.gnu.org
Subject: Re: bug#51986: [PATCH] Add tlpui
Date: Thu, 25 Nov 2021 12:38:33 +0000
Hello Nicolas,

> * gnu/packages/linux.scm (tlpui): New variable.

When trying to build the following patch on the c-u-f branch, I have the
following error:

--8<---------------cut here---------------start------------->8---
phase `check' succeeded after 0.0 seconds
starting phase `sanity-check'
Unable to init server: Could not connect: Connection refused
Unable to init server: Could not connect: Connection refused
validating 'TLPUI' /gnu/store/xjvdm652mfks314s1lnvwinn6pnrbz5a-tlpui-1.4.0/lib/python3.9/site-packages
...checking requirements: OK
...trying to load module tlpui: OK
...trying to load endpoint gui_scripts tlpui: ERROR:
Traceback (most recent call last):
  File "/gnu/store/p5fgysbcnnp8b1d91mrvjvababmczga0-python-3.9.6/lib/python3.9/pathlib.py", line 1313, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/homeless-shelter/.config/tlpui'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/gnu/store/p5fgysbcnnp8b1d91mrvjvababmczga0-python-3.9.6/lib/python3.9/pathlib.py", line 1313, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/homeless-shelter/.config'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/gnu/store/nwwr89v2vyg1hs48i49m083vhczsgh3m-sanity-check.py", line 85, in <module>
    ep.load()
  File "/gnu/store/p5fgysbcnnp8b1d91mrvjvababmczga0-python-3.9.6/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2450, in load
    return self.resolve()
  File "/gnu/store/p5fgysbcnnp8b1d91mrvjvababmczga0-python-3.9.6/lib/python3.9/site-packages/pkg_resources/__init__.py", line 2456, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/gnu/store/xjvdm652mfks314s1lnvwinn6pnrbz5a-tlpui-1.4.0/lib/python3.9/site-packages/tlpui/__main__.py", line 8, in <module>
    from . import settings
  File "/gnu/store/xjvdm652mfks314s1lnvwinn6pnrbz5a-tlpui-1.4.0/lib/python3.9/site-packages/tlpui/settings.py", line 13, in <module>
    userconfig = settingshelper.UserConfig()
  File "/gnu/store/xjvdm652mfks314s1lnvwinn6pnrbz5a-tlpui-1.4.0/lib/python3.9/site-packages/tlpui/settingshelper.py", line 53, in __init__
    self.read_user_config()
  File "/gnu/store/xjvdm652mfks314s1lnvwinn6pnrbz5a-tlpui-1.4.0/lib/python3.9/site-packages/tlpui/settingshelper.py", line 71, in read_user_config
    self.userconfigfile.parent.mkdir(parents=True, exist_ok=True)
  File "/gnu/store/p5fgysbcnnp8b1d91mrvjvababmczga0-python-3.9.6/lib/python3.9/pathlib.py", line 1317, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  File "/gnu/store/p5fgysbcnnp8b1d91mrvjvababmczga0-python-3.9.6/lib/python3.9/pathlib.py", line 1317, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  File "/gnu/store/p5fgysbcnnp8b1d91mrvjvababmczga0-python-3.9.6/lib/python3.9/pathlib.py", line 1313, in mkdir
    self._accessor.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/homeless-shelter'
error: in phase 'sanity-check': uncaught exception:
%exception #<&invoke-error program: "python" arguments: ("/gnu/store/nwwr89v2vyg1hs48i49m083vhczsgh3m-sanity-check.py" "/gnu/store/xjvdm652mfks314s1lnvwinn6pnrbz5a-tlpui-1.4.0/lib/python3.9/site-packages") exit-status: 1 term-signal: #f stop-signal: #f> 
phase `sanity-check' failed after 0.2 seconds
command "python" "/gnu/store/nwwr89v2vyg1hs48i49m083vhczsgh3m-sanity-check.py" "/gnu/store/xjvdm652mfks314s1lnvwinn6pnrbz5a-tlpui-1.4.0/lib/python3.9/site-packages" failed with status 1
note: keeping build directory `/tmp/guix-build-tlpui-1.4.0.drv-1'
builder for `/gnu/store/2xbpy0qsqr6pqaa5vwcs6l8mxyahadg5-tlpui-1.4.0.drv' failed with exit code 1
build of /gnu/store/2xbpy0qsqr6pqaa5vwcs6l8mxyahadg5-tlpui-1.4.0.drv failed
View build log at '/var/log/guix/drvs/2x/bpy0qsqr6pqaa5vwcs6l8mxyahadg5-tlpui-1.4.0.drv.bz2'.
guix build: error: build of `/gnu/store/2xbpy0qsqr6pqaa5vwcs6l8mxyahadg5-tlpui-1.4.0.drv' failed
--8<---------------cut here---------------end--------------->8---

Any idea what could go wrong?

Thanks,

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#51986; Package guix-patches. (Fri, 26 Nov 2021 08:37:01 GMT) Full text and rfc822 format available.

Message #11 received at 51986 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Mathieu Othacehe <othacehe <at> gnu.org>
Cc: 51986 <at> debbugs.gnu.org
Subject: Re: [bug#51986] [PATCH] Add tlpui
Date: Fri, 26 Nov 2021 09:36:17 +0100
Hello,

Mathieu Othacehe <othacehe <at> gnu.org> writes:

Thanks for the feedback.

> When trying to build the following patch on the c-u-f branch, I have the
> following error:

[...]

> error: in phase 'sanity-check': uncaught exception:
> %exception #<&invoke-error program: "python" arguments: ("/gnu/store/nwwr89v2vyg1hs48i49m083vhczsgh3m-sanity-check.py" "/gnu/store/xjvdm652mfks314s1lnvwinn6pnrbz5a-tlpui-1.4.0/lib/python3.9/site-packages") exit-status: 1 term-signal: #f stop-signal: #f> 
> phase `sanity-check' failed after 0.2 seconds
> command "python" "/gnu/store/nwwr89v2vyg1hs48i49m083vhczsgh3m-sanity-check.py" "/gnu/store/xjvdm652mfks314s1lnvwinn6pnrbz5a-tlpui-1.4.0/lib/python3.9/site-packages" failed with status 1

I disabled tests in the package definition because the program insists
on reading "/etc" directory. 

However, c-u-f added a new phase, `sanity-check' which has the same
issue (trying to read "/etc"). We could delete that phase too, but I'm
not sure about the consequences.

Meawhile, there's the upstream pending open issue:
<https://github.com/d4nj1/TLPUI/issues/86>

Regards,
-- 
Nicolas Goaziou




Reply sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
You have taken responsibility. (Tue, 21 Dec 2021 21:26:02 GMT) Full text and rfc822 format available.

Notification sent to Nicolas Goaziou <mail <at> nicolasgoaziou.fr>:
bug acknowledged by developer. (Tue, 21 Dec 2021 21:26:02 GMT) Full text and rfc822 format available.

Message #16 received at 51986-done <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: 51986-done <at> debbugs.gnu.org
Subject: [PATCH] Add tlpui
Date: Tue, 21 Dec 2021 22:25:28 +0100
Applied.

I could enable tests, but couldn't appease sanity-check phase.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 19 Jan 2022 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 213 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.