[PATCH] gnu: polybar: Update to 3.6.3.

  • Done
  • quality assurance status badge
Details
3 participants
  • Josselin Poiret
  • John Kehayias
  • Ludovic Courtès
Owner
unassigned
Submitted by
John Kehayias
Severity
normal

Debbugs page

John Kehayias wrote 3 years ago
(name . Guix-patches)(address . guix-patches@gnu.org)
x7X8vmU7JxtyWWX_8daSzQTPTN90_PMPsSFKjAVkqrwd3wUnV1d3iPYdFbDDfaMHy9Jv6ApDam5D7blVNggGgxanv9UxcLB1SX98rsOQ0mU=@protonmail.com
Hi Guix,

Here is a patch to update polybar. There were some slight tweaks needed: new input, remove unneeded native-input, and change where the default configuration file is installed (from /etc) to #$output/etc/xdg.

This last change may look slightly different from the default behavior, but this will put it where it should be found using XDG_CONFIG_DIRS. This was made in the change to polybar that also moved/altered the configuration installation: https://github.com/polybar/polybar/commit/282b0f4e73e9cbb68afd6e168c472e3f422e9a6f#diff-6b4c594394f4751f9012dc3889b278312f0e7275ab48edbe3b02d434e183aa52

I tested that it builds and polybar will find this default configuration file when no config is otherwise found or specified. The default bar looked fine to me. Note that I did test this where I do have XDG_CONFIG_DIRS set for that profile anyway.

Thanks!
John
From 672bbe6f7d622dae75f1202482785540b22a8314 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Tue, 21 Jun 2022 14:14:08 -0400
Subject: [PATCH] gnu: polybar: Update to 3.6.3.

* gnu/packages/wm.scm (polybar): Update to 3.6.3.
[phases]: Add patch-config-path to install the default configuration file
where it can be found by polybar.
[inputs]: Add libuv, required to build polybar.
[native-inputs]: Remove python-2, no longer needed.
---
gnu/packages/wm.scm | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)

Toggle diff (55 lines)
diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index d816bad871..adbade7ba6 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -1469,19 +1469,27 @@ (define-public nitrogen
(define-public polybar
(package
(name "polybar")
- (version "3.5.7")
+ (version "3.6.3")
(source
(origin
(method url-fetch)
(uri (string-append "https://github.com/polybar/polybar/releases/"
"download/" version "/polybar-" version ".tar.gz"))
(sha256
- (base32 "1nr386jdlm8qkbdf23w7lyvbfhr362s90f957fawnyi1finhw8bk"))))
+ (base32 "19azx5dpfyfh0pv4q2fcrf4p7a0pc5d13m7lnv3qy8376mbmhmzj"))))
(build-system cmake-build-system)
(arguments
;; Test is disabled because it requires downloading googletest from the
;; Internet.
- '(#:tests? #f))
+ (list #:tests? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ ;; Install the default configuration file to where polybar
+ ;; can find it, through XDG_CONFIG_DIRS.
+ (add-after 'unpack 'patch-config-path
+ (lambda _
+ (substitute* "CMakeLists.txt"
+ (("/etc") (string-append #$output "/etc/xdg"))))))))
(inputs
(list alsa-lib
cairo
@@ -1489,6 +1497,7 @@ (define-public polybar
jsoncpp
libmpdclient
libnl
+ libuv
libxcb
pulseaudio
xcb-proto
@@ -1500,9 +1509,6 @@ (define-public polybar
(native-inputs
`(("pkg-config" ,pkg-config)
("python-sphinx" ,python-sphinx) ; for the manual
- ;; XXX: "python" input must be located after "python-2", or the package
- ;; fails to build with "missing required python module: xcbgen".
- ("python-2" ,python-2) ; lib/xpp depends on python 2
("python" ,python))) ; xcb-proto depends on python 3
(home-page "https://polybar.github.io/")
(synopsis "Fast and easy-to-use status bar")
--
2.36.1
Josselin Poiret wrote 3 years ago
(name . John Kehayias)(address . john.kehayias@protonmail.com)(address . 56127@debbugs.gnu.org)
878rpou84l.fsf@jpoiret.xyz
Hello John

John Kehayias via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (8 lines)
> Hi Guix,
>
> Here is a patch to update polybar. There were some slight tweaks needed: new input, remove unneeded native-input, and change where the default configuration file is installed (from /etc) to #$output/etc/xdg.
>
> This last change may look slightly different from the default behavior, but this will put it where it should be found using XDG_CONFIG_DIRS. This was made in the change to polybar that also moved/altered the configuration installation: https://github.com/polybar/polybar/commit/282b0f4e73e9cbb68afd6e168c472e3f422e9a6f#diff-6b4c594394f4751f9012dc3889b278312f0e7275ab48edbe3b02d434e183aa52
>
> I tested that it builds and polybar will find this default configuration file when no config is otherwise found or specified. The default bar looked fine to me. Note that I did test this where I do have XDG_CONFIG_DIRS set for that profile anyway.

Looks good to me as-is, builds and runs fine, although I'd prefer to
keep the file at /etc/, and patch src/utils/file.cpp to look for
$output/etc/polybar/config.ini. That way, polybar would work without a
config file even when not installed. Also, if you have the time, could
you move the native-inputs to the new style as an additional commit?

WDYT?
--
Josselin Poiret
John Kehayias wrote 3 years ago
(name . Josselin Poiret)(address . dev@jpoiret.xyz)(address . 56127@debbugs.gnu.org)
FPLRbSend_Y1e2dGrHvf8hJaACaz52k3wktjRZJ3QMzXIO6vBtxcA04Ig8heWmKLEUbjSBrVFQVier08v9vmd5Kc3g6MLBOZSyF2OH7bN6U=@protonmail.com
Hi Josselin,

------- Original Message -------
On Wednesday, June 22nd, 2022 at 9:42 AM, Josselin Poiret <dev@jpoiret.xyz> wrote:


Toggle quote (9 lines)
>
> Looks good to me as-is, builds and runs fine, although I'd prefer to
> keep the file at /etc/, and patch src/utils/file.cpp to look for
> $output/etc/polybar/config.ini. That way, polybar would work without a
> config file even when not installed. Also, if you have the time, could
> you move the native-inputs to the new style as an additional commit?
>
> WDYT?

Not sure I understand what you mean by not needing to have polybar installed. Do you mean not having to worry about XDG_CONFIG_DIRS being set up? Running directly from /gnu/store? I can make that change (it was the alternative I thought of too) if that would help useability for a new user without a config.

And yes, can update with a second commit to clean native-inputs as well.

Thanks for taking a look!

John
Josselin Poiret wrote 3 years ago
(name . John Kehayias)(address . john.kehayias@protonmail.com)(address . 56127@debbugs.gnu.org)
875ykru1ll.fsf@jpoiret.xyz
Hi John,

John Kehayias <john.kehayias@protonmail.com> writes:

Toggle quote (2 lines)
> Not sure I understand what you mean by not needing to have polybar installed. Do you mean not having to worry about XDG_CONFIG_DIRS being set up? Running directly from /gnu/store? I can make that change (it was the alternative I thought of too) if that would help useability for a new user without a config.

Yes, I meant running from store or using `guix shell polybar -- polybar`
(which does not setup XDG_CONFIG_DIRS).

Toggle quote (2 lines)
> And yes, can update with a second commit to clean native-inputs as well.

Great!

Toggle quote (2 lines)
> Thanks for taking a look!

Thank you for your contribution!

Best,
--
Josselin Poiret
John Kehayias wrote 3 years ago
Re: [bug#56127] [PATCH 1/2 v2] gnu: polybar: Update to 3.6.3.
(name . Josselin Poiret)(address . dev@jpoiret.xyz)(address . 56127@debbugs.gnu.org)
YimIaofu1SebPYrFzrj--vfl-d2xOspIL7Z_5OQelsMzDTi53oEGfLcdFg6iWTmP0h5kmyYgvXhDvfeZNjy-Ry6VTHNsAUjxPrk49-csJ2g=@protonmail.com
Hi Josselin,

------- Original Message -------
On Thursday, June 23rd, 2022 at 6:16 AM, Josselin Poiret wrote:
Toggle quote (5 lines)
>
> Yes, I meant running from store or using `guix shell polybar -- polybar`
> (which does not setup XDG_CONFIG_DIRS).
>

Done in the update first patch, checked that now `guix shell polybar -- polybar` finds the default config.

Toggle quote (3 lines)
> > And yes, can update with a second commit to clean native-inputs as well.
>

Added this second little patch.

Thanks!
John
From addc99adfc0013da57dcda43df96fca11eb33d1c Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Tue, 21 Jun 2022 14:14:08 -0400
Subject: [PATCH 1/2] gnu: polybar: Update to 3.6.3.

* gnu/packages/wm.scm (polybar): Update to 3.6.3.
[phases]: Add patch-config-path for polybar to find its default configuration
file in the store.
[inputs]: Add libuv, required to build polybar.
[native-inputs]: Remove python-2, no longer needed.
---
gnu/packages/wm.scm | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)

Toggle diff (57 lines)
diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index d816bad871..92106045e9 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -1469,19 +1469,29 @@ (define-public nitrogen
(define-public polybar
(package
(name "polybar")
- (version "3.5.7")
+ (version "3.6.3")
(source
(origin
(method url-fetch)
(uri (string-append "https://github.com/polybar/polybar/releases/"
"download/" version "/polybar-" version ".tar.gz"))
(sha256
- (base32 "1nr386jdlm8qkbdf23w7lyvbfhr362s90f957fawnyi1finhw8bk"))))
+ (base32 "19azx5dpfyfh0pv4q2fcrf4p7a0pc5d13m7lnv3qy8376mbmhmzj"))))
(build-system cmake-build-system)
(arguments
;; Test is disabled because it requires downloading googletest from the
;; Internet.
- '(#:tests? #f))
+ (list #:tests? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ ;; Make polybar find its default configuration file in the
+ ;; store.
+ (add-after 'unpack 'patch-config-path
+ (lambda _
+ (substitute* "CMakeLists.txt"
+ (("/etc") (string-append #$output "/etc")))
+ (substitute* "src/utils/file.cpp"
+ (("\"/etc\"") (string-append "\"" #$output "/etc\""))))))))
(inputs
(list alsa-lib
cairo
@@ -1489,6 +1499,7 @@ (define-public polybar
jsoncpp
libmpdclient
libnl
+ libuv
libxcb
pulseaudio
xcb-proto
@@ -1500,9 +1511,6 @@ (define-public polybar
(native-inputs
`(("pkg-config" ,pkg-config)
("python-sphinx" ,python-sphinx) ; for the manual
- ;; XXX: "python" input must be located after "python-2", or the package
- ;; fails to build with "missing required python module: xcbgen".
- ("python-2" ,python-2) ; lib/xpp depends on python 2
("python" ,python))) ; xcb-proto depends on python 3
(home-page "https://polybar.github.io/")
(synopsis "Fast and easy-to-use status bar")
--
2.36.1
John Kehayias wrote 3 years ago
Re: [bug#56127] [PATCH 2/2] gnu: polybar: Simplify inputs.
(name . Josselin Poiret)(address . dev@jpoiret.xyz)(address . 56127@debbugs.gnu.org)
JgbeCQtvYp74Iv3e8QpmIO6v0snbAl5Cd6jEr1N_kVbg9KwDCBApmLrFRV7g33xJ-HgKqT3yu_oOSxSr9utW0SuSziOHttw5fdz2KoAUv_I=@protonmail.com
Empty Message
From 6eda624895edc47c0b879437719b6f89875b48b9 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Thu, 23 Jun 2022 10:35:56 -0400
Subject: [PATCH 2/2] gnu: polybar: Simply inputs.

* gnu/packages/wm.scm (polybar)[native-inputs]: Remove labels.
---
gnu/packages/wm.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (19 lines)
diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index 92106045e9..256cdb4089 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -1509,9 +1509,9 @@ (define-public polybar
xcb-util-wm
xcb-util-xrm))
(native-inputs
- `(("pkg-config" ,pkg-config)
- ("python-sphinx" ,python-sphinx) ; for the manual
- ("python" ,python))) ; xcb-proto depends on python 3
+ (list pkg-config
+ python-sphinx ; for the manual
+ python)) ; xcb-proto depends on python 3
(home-page "https://polybar.github.io/")
(synopsis "Fast and easy-to-use status bar")
(description "Polybar aims to help users build beautiful and highly
--
2.36.1
Ludovic Courtès wrote 3 years ago
Re: bug#56127: [PATCH] gnu: polybar: Update to 3.6.3.
(name . John Kehayias)(address . john.kehayias@protonmail.com)(name . Josselin Poiret)(address . dev@jpoiret.xyz)(address . 56127-done@debbugs.gnu.org)
871qvfxgx1.fsf_-_@gnu.org
Hi John,

John Kehayias <john.kehayias@protonmail.com> skribis:

Toggle quote (11 lines)
> From addc99adfc0013da57dcda43df96fca11eb33d1c Mon Sep 17 00:00:00 2001
> From: John Kehayias <john.kehayias@protonmail.com>
> Date: Tue, 21 Jun 2022 14:14:08 -0400
> Subject: [PATCH 1/2] gnu: polybar: Update to 3.6.3.
>
> * gnu/packages/wm.scm (polybar): Update to 3.6.3.
> [phases]: Add patch-config-path for polybar to find its default configuration
> file in the store.
> [inputs]: Add libuv, required to build polybar.
> [native-inputs]: Remove python-2, no longer needed.

Applied together with the patch that removes input labels.

Thank you, and thanks Josselin for reviewing!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 56127@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 56127
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help