[PATCH] gnu: Add polybar

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Meiyo Peng
Owner
unassigned
Submitted by
Meiyo Peng
Severity
normal

Debbugs page

Meiyo Peng wrote 6 years ago
(address . guix-patches@gnu.org)
87imzkfe3g.fsf@gmail.com
Hi,

This patch adds polybar to Guix. A beautiful and flexible status bar.
From e5871eaba91a1d5909fbc0ffcea767244204f644 Mon Sep 17 00:00:00 2001
From: Meiyo Peng <meiyo.peng@gmail.com>
Date: Sun, 23 Dec 2018 23:05:38 +0800
Subject: [PATCH] gnu: Add polybar.

* gnu/packages/wm.scm (polybar): New variable.
---
gnu/packages/wm.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)

Toggle diff (60 lines)
diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index 2e211e389..062790141 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -76,6 +76,7 @@
#:use-module (gnu packages lua)
#:use-module (gnu packages linux)
#:use-module (gnu packages suckless)
+ #:use-module (gnu packages mpd)
#:use-module (guix download)
#:use-module (guix git-download))
@@ -1051,3 +1052,45 @@ its size
@item Display preview images in a tiled icon layout
@end itemize")
(license license:gpl2+)))
+
+(define-public polybar
+ (package
+ (name "polybar")
+ (version "3.2.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/jaagr/polybar/releases/"
+ "download/" version "/polybar.tar"))
+ (sha256
+ (base32 "1zpsvh1n77bx7s6mqqh3ba828k9xbp35c2mjmcl9nywfp6r5ldqi"))
+ (file-name (string-append name "-" version ".tar"))))
+ (build-system cmake-build-system)
+ (arguments
+ ;; Test is disabled because it requires downloading googletest from the
+ ;; Internet.
+ '(#:tests? #f))
+ (inputs
+ `(("alsa-lib" ,alsa-lib)
+ ("cairo" ,cairo)
+ ("i3-wm" ,i3-wm)
+ ("libmpdclient" ,libmpdclient)
+ ("libnl" ,libnl)
+ ("libxcb" ,libxcb)
+ ("pulseaudio" ,pulseaudio)
+ ("xcb-proto" ,xcb-proto)
+ ("xcb-util" ,xcb-util)
+ ("xcb-util-cursor" ,xcb-util-cursor)
+ ("xcb-util-image" ,xcb-util-image)
+ ("xcb-util-wm" ,xcb-util-wm)
+ ("xcb-util-xrm" ,xcb-util-xrm)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("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")
+ (description "Polybar aims to help users build beautiful and highly
+customizable status bars for their desktop environment. It has built-in
+functionality to display information about the most commonly used services.")
+ (license license:expat)))
--
2.20.0
Ludovic Courtès wrote 6 years ago
(name . Meiyo Peng)(address . meiyo.peng@gmail.com)(address . 33849@debbugs.gnu.org)
87zhswgmyo.fsf@gnu.org
Hello,

Meiyo Peng <meiyo.peng@gmail.com> skribis:

Toggle quote (7 lines)
>>From e5871eaba91a1d5909fbc0ffcea767244204f644 Mon Sep 17 00:00:00 2001
> From: Meiyo Peng <meiyo.peng@gmail.com>
> Date: Sun, 23 Dec 2018 23:05:38 +0800
> Subject: [PATCH] gnu: Add polybar.
>
> * gnu/packages/wm.scm (polybar): New variable.

[...]

Toggle quote (9 lines)
> + (source
> + (origin
> + (method url-fetch)
> + (uri (string-append "https://github.com/jaagr/polybar/releases/"
> + "download/" version "/polybar.tar"))
> + (sha256
> + (base32 "1zpsvh1n77bx7s6mqqh3ba828k9xbp35c2mjmcl9nywfp6r5ldqi"))
> + (file-name (string-append name "-" version ".tar"))))

Please use ‘git-fetch’ rather than downloading a generated tarball (it’s
a generated tarball, right?).

Toggle quote (6 lines)
> + (build-system cmake-build-system)
> + (arguments
> + ;; Test is disabled because it requires downloading googletest from the
> + ;; Internet.
> + '(#:tests? #f))

Did you try adding ‘googletest’ to ‘native-inputs’, and perhaps also
disabling the code that tries to download it?

The rest LGTM! Could you send an updated patch?

Thank you,
Ludo’.
Meiyo Peng wrote 6 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 33849@debbugs.gnu.org)
878t0f5tii.fsf@gmail.com
Hi,

Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (12 lines)
>> + (source
>> + (origin
>> + (method url-fetch)
>> + (uri (string-append "https://github.com/jaagr/polybar/releases/"
>> + "download/" version "/polybar.tar"))
>> + (sha256
>> + (base32 "1zpsvh1n77bx7s6mqqh3ba828k9xbp35c2mjmcl9nywfp6r5ldqi"))
>> + (file-name (string-append name "-" version ".tar"))))
>
> Please use ‘git-fetch’ rather than downloading a generated tarball (it’s
> a generated tarball, right?).

No. This is a user uploaded release tarball. You can notice their
difference. User uploaded tarball has "/releases/download/" in its URL.

#+BEGIN_EXAMPLE
#+END_EXAMPLE

I tried to use the git-fetch method first, but it failed to build
because git-fetch doesn't fetch git submodules. Do we support
recursively fetching git submodules?

Toggle quote (9 lines)
>> + (build-system cmake-build-system)
>> + (arguments
>> + ;; Test is disabled because it requires downloading googletest from the
>> + ;; Internet.
>> + '(#:tests? #f))
>
> Did you try adding ‘googletest’ to ‘native-inputs’, and perhaps also
> disabling the code that tries to download it?

I checked the CMakeLists.txt, but it's too complex for me. I am not
familiar with cmake, so I prefer not to patch it.

Toggle quote (2 lines)
> The rest LGTM! Could you send an updated patch?

The author released a new version after I sent the last patch. So here
is a new patch with version 3.3.0.
From 3faa9dcf77ca83972db6234a9af6b22325ee0311 Mon Sep 17 00:00:00 2001
From: Meiyo Peng <meiyo.peng@gmail.com>
Date: Sun, 23 Dec 2018 23:05:38 +0800
Subject: [PATCH] gnu: Add polybar.

* gnu/packages/wm.scm (polybar): New variable.
---
gnu/packages/wm.scm | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)

Toggle diff (60 lines)
diff --git a/gnu/packages/wm.scm b/gnu/packages/wm.scm
index 2e211e389..a761bce23 100644
--- a/gnu/packages/wm.scm
+++ b/gnu/packages/wm.scm
@@ -76,6 +76,7 @@
#:use-module (gnu packages lua)
#:use-module (gnu packages linux)
#:use-module (gnu packages suckless)
+ #:use-module (gnu packages mpd)
#:use-module (guix download)
#:use-module (guix git-download))
@@ -1051,3 +1052,45 @@ its size
@item Display preview images in a tiled icon layout
@end itemize")
(license license:gpl2+)))
+
+(define-public polybar
+ (package
+ (name "polybar")
+ (version "3.3.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/jaagr/polybar/releases/"
+ "download/" version "/polybar.tar"))
+ (sha256
+ (base32 "0sjh3xmf11g09spi88zj7xsc3a3vv78kixab6n5i7436py7xwzb4"))
+ (file-name (string-append name "-" version ".tar"))))
+ (build-system cmake-build-system)
+ (arguments
+ ;; Test is disabled because it requires downloading googletest from the
+ ;; Internet.
+ '(#:tests? #f))
+ (inputs
+ `(("alsa-lib" ,alsa-lib)
+ ("cairo" ,cairo)
+ ("i3-wm" ,i3-wm)
+ ("libmpdclient" ,libmpdclient)
+ ("libnl" ,libnl)
+ ("libxcb" ,libxcb)
+ ("pulseaudio" ,pulseaudio)
+ ("xcb-proto" ,xcb-proto)
+ ("xcb-util" ,xcb-util)
+ ("xcb-util-cursor" ,xcb-util-cursor)
+ ("xcb-util-image" ,xcb-util-image)
+ ("xcb-util-wm" ,xcb-util-wm)
+ ("xcb-util-xrm" ,xcb-util-xrm)))
+ (native-inputs
+ `(("pkg-config" ,pkg-config)
+ ("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")
+ (description "Polybar aims to help users build beautiful and highly
+customizable status bars for their desktop environment. It has built-in
+functionality to display information about the most commonly used services.")
+ (license license:expat)))
--
2.20.0
Ludovic Courtès wrote 6 years ago
(name . Meiyo Peng)(address . meiyo.peng@gmail.com)(address . 33849-done@debbugs.gnu.org)
8736qlftd3.fsf@gnu.org
Hi,

Meiyo Peng <meiyo.peng@gmail.com> skribis:

Toggle quote (22 lines)
> Ludovic Courtès <ludo@gnu.org> writes:
>
>>> + (source
>>> + (origin
>>> + (method url-fetch)
>>> + (uri (string-append "https://github.com/jaagr/polybar/releases/"
>>> + "download/" version "/polybar.tar"))
>>> + (sha256
>>> + (base32 "1zpsvh1n77bx7s6mqqh3ba828k9xbp35c2mjmcl9nywfp6r5ldqi"))
>>> + (file-name (string-append name "-" version ".tar"))))
>>
>> Please use ‘git-fetch’ rather than downloading a generated tarball (it’s
>> a generated tarball, right?).
>
> No. This is a user uploaded release tarball. You can notice their
> difference. User uploaded tarball has "/releases/download/" in its URL.
>
> #+BEGIN_EXAMPLE
> User uploaded: https://github.com/jaagr/polybar/releases/download/3.3.0/polybar.tar
> Auto generated: https://github.com/jaagr/polybar/archive/3.3.0.tar.gz
> #+END_EXAMPLE

Oh right, so that’s OK.

Toggle quote (4 lines)
> I tried to use the git-fetch method first, but it failed to build
> because git-fetch doesn't fetch git submodules. Do we support
> recursively fetching git submodules?

Yes, just add (recursive? #t).

Toggle quote (7 lines)
>>From 3faa9dcf77ca83972db6234a9af6b22325ee0311 Mon Sep 17 00:00:00 2001
> From: Meiyo Peng <meiyo.peng@gmail.com>
> Date: Sun, 23 Dec 2018 23:05:38 +0800
> Subject: [PATCH] gnu: Add polybar.
>
> * gnu/packages/wm.scm (polybar): New variable.

Applied, thanks!

Ludo’.
Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 33849
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