[PATCH] added btop

OpenSubmitted by Wil deBeest.
Details
3 participants
  • Wil deBeest
  • Greg Hogan
  • Maxime Devos
Owner
unassigned
Severity
normal
W
W
Wil deBeest wrote on 16 Apr 17:37 +0200
(address . guix-patches@gnu.org)
3D9386AF-4BB9-4C79-B170-A6A2AEC13728@4tii.de
---
gnu/packages/admin.scm | 52 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)

Toggle diff (67 lines)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 1db04adf71..68f09cdbf9 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -730,6 +730,58 @@ (define-public bpytop
memory, disks, network and processes.  It's a Python port and continuation of
@command{bashtop}.")
    (license license:asl2.0)))
+(define-public btop
+  (package
+    (name "btop")
+    (version "1.2.5")
+    (source
+      (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/aristocratos/btop")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1v0lj296bzwgs29hv9z3r82fwmibiqgsvsqqh2fimxs0jmld7c2v"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'configure) ;; not provided
+         (delete 'check) ;; not provided
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((bin (string-append
+                         (assoc-ref outputs "out")"/bin")))
+               (install-file "bin/btop" bin)))))))
+    (home-page "https://github.com/aristocratos/btop")
+    (synopsis "Resource monitor for processor, memory, disks, network and processes")
+    (description "Resource monitor that shows usage and stats
+for processor, memory, disks, network and processes.
+
+C++ version and continuation of bashtop and bpytop.
+
+Features
+
+    Easy to use, with a game inspired menu system.
+    Full mouse support, all buttons with a highlighted key is clickable
+ and mouse scroll works in process list and menu boxes.
+    Fast and responsive UI with UP, DOWN keys process selection.
+    Function for showing detailed stats for selected process.
+    Ability to filter processes.
+    Easy switching between sorting options.
+    Tree view of processes.
+    Send any signal to selected process.
+    UI menu for changing all config file options.
+    Auto scaling graph for network usage.
+    Shows IO activity and speeds for disks
+    Battery meter
+    Selectable symbols for the graphs
+    Custom presets
+    And more...
+")
+     (license license:asl2.0)))

(define-public pies
  (package

base-commit: 20645d8467852990413c1ea9cf81cec82d23defd
-- 
2.35.1
G
G
Greg Hogan wrote on 18 Apr 15:40 +0200
(name . Wil deBeest)(address . bovid-19@4tii.de)(address . 54974@debbugs.gnu.org)
CA+3U0ZmF1+zwJrjDx8MAjQ-_SL0C7xxcqs7xJVJCK4MUmLxRkQ@mail.gmail.com
Hi Wil,

I had recently looked at adding this package so I happen to have a few
comments.

v1.2.6 was released last week.

Is it preferable to "(delete 'check)" the test phase or specify the
"#:tests? #f" argument?

Instead of the "replace 'install" lambda, I had done:
#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
which is both shorter and to my understanding more generic (more adaptable
to future additional binaries or libraries, though this package will likely
only ever have a single binary).

Greg

On Sat, Apr 16, 2022 at 12:18 PM Wil deBeest <bovid-19@4tii.de> wrote:

Toggle quote (78 lines)
>
> ---
> gnu/packages/admin.scm | 52 ++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 52 insertions(+)
>
> diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
> index 1db04adf71..68f09cdbf9 100644
> --- a/gnu/packages/admin.scm
> +++ b/gnu/packages/admin.scm
> @@ -730,6 +730,58 @@ (define-public bpytop
> memory, disks, network and processes. It's a Python port and continuation
> of
> @command{bashtop}.")
> (license license:asl2.0)))
> +(define-public btop
> + (package
> + (name "btop")
> + (version "1.2.5")
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/aristocratos/btop")
> + (commit (string-append "v" version))))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32
> + "1v0lj296bzwgs29hv9z3r82fwmibiqgsvsqqh2fimxs0jmld7c2v"))))
> + (build-system gnu-build-system)
> + (arguments
> + `(#:phases
> + (modify-phases %standard-phases
> + (delete 'configure) ;; not provided
> + (delete 'check) ;; not provided
> + (replace 'install
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let ((bin (string-append
> + (assoc-ref outputs "out")"/bin")))
> + (install-file "bin/btop" bin)))))))
> + (home-page "https://github.com/aristocratos/btop")
> + (synopsis "Resource monitor for processor, memory, disks, network and
> processes")
> + (description "Resource monitor that shows usage and stats
> +for processor, memory, disks, network and processes.
> +
> +C++ version and continuation of bashtop and bpytop.
> +
> +Features
> +
> + Easy to use, with a game inspired menu system.
> + Full mouse support, all buttons with a highlighted key is clickable
> + and mouse scroll works in process list and menu boxes.
> + Fast and responsive UI with UP, DOWN keys process selection.
> + Function for showing detailed stats for selected process.
> + Ability to filter processes.
> + Easy switching between sorting options.
> + Tree view of processes.
> + Send any signal to selected process.
> + UI menu for changing all config file options.
> + Auto scaling graph for network usage.
> + Shows IO activity and speeds for disks
> + Battery meter
> + Selectable symbols for the graphs
> + Custom presets
> + And more...
> +")
> + (license license:asl2.0)))
>
> (define-public pies
> (package
>
> base-commit: 20645d8467852990413c1ea9cf81cec82d23defd
> --
> 2.35.1
>
>
>
>
Attachment: file
W
W
Wil deBeest wrote on 18 Apr 20:02 +0200
(name . Greg Hogan)(address . code@greghogan.com)(address . 54974@debbugs.gnu.org)
DF778340-74CF-4D0D-8CA4-DB456D1A56CF@4tii.de
Greg Hogan <code@greghogan.com> writes:

Toggle quote (2 lines)
> Hi Wil,

Hi Greg,

thank you for the feedback!

Toggle quote (4 lines)
> I had recently looked at adding this package so I happen to have a few comments.
>
> v1.2.6 was released last week.

I had updated the package from v1.0.0 before creating the patch, but
thanks to my mail server I was only able to send it the other day.


Toggle quote (2 lines)
> Is it preferable to "(delete 'check)" the test phase or specify the "#:tests? #f" argument?

I am quite new to Guix and Scheme, but `#:tests? #f' seems much better to me.


Toggle quote (5 lines)
> Instead of the "replace 'install" lambda, I had done:
> #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
> which is both shorter and to my understanding more generic (more adaptable to future additional binaries or libraries, though this
> package will likely only ever have a single binary).

That's definitely neater. I'd suggest you send your patch here to
replace my hacky one, but if you prefer I could also incorporate your
improvements into mine and update the version.


Wil



Toggle quote (77 lines)
> Greg
>
> On Sat, Apr 16, 2022 at 12:18 PM Wil deBeest <bovid-19@4tii.de> wrote:
>
> ---
> gnu/packages/admin.scm | 52 ++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 52 insertions(+)
>
> diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
> index 1db04adf71..68f09cdbf9 100644
> --- a/gnu/packages/admin.scm
> +++ b/gnu/packages/admin.scm
> @@ -730,6 +730,58 @@ (define-public bpytop
> memory, disks, network and processes. It's a Python port and continuation of
> @command{bashtop}.")
> (license license:asl2.0)))
> +(define-public btop
> + (package
> + (name "btop")
> + (version "1.2.5")
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/aristocratos/btop")
> + (commit (string-append "v" version))))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32
> + "1v0lj296bzwgs29hv9z3r82fwmibiqgsvsqqh2fimxs0jmld7c2v"))))
> + (build-system gnu-build-system)
> + (arguments
> + `(#:phases
> + (modify-phases %standard-phases
> + (delete 'configure) ;; not provided
> + (delete 'check) ;; not provided
> + (replace 'install
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let ((bin (string-append
> + (assoc-ref outputs "out")"/bin")))
> + (install-file "bin/btop" bin)))))))
> + (home-page "https://github.com/aristocratos/btop")
> + (synopsis "Resource monitor for processor, memory, disks, network and processes")
> + (description "Resource monitor that shows usage and stats
> +for processor, memory, disks, network and processes.
> +
> +C++ version and continuation of bashtop and bpytop.
> +
> +Features
> +
> + Easy to use, with a game inspired menu system.
> + Full mouse support, all buttons with a highlighted key is clickable
> + and mouse scroll works in process list and menu boxes.
> + Fast and responsive UI with UP, DOWN keys process selection.
> + Function for showing detailed stats for selected process.
> + Ability to filter processes.
> + Easy switching between sorting options.
> + Tree view of processes.
> + Send any signal to selected process.
> + UI menu for changing all config file options.
> + Auto scaling graph for network usage.
> + Shows IO activity and speeds for disks
> + Battery meter
> + Selectable symbols for the graphs
> + Custom presets
> + And more...
> +")
> + (license license:asl2.0)))
>
> (define-public pies
> (package
>
> base-commit: 20645d8467852990413c1ea9cf81cec82d23defd
> --
> 2.35.1


--
Pascal
M
M
Maxime Devos wrote on 18 Apr 20:47 +0200
(address . 54974@debbugs.gnu.org)
edc9fc636bbae79f34359046540425ccd95a4a25.camel@telenet.be
Greg Hogan schreef op ma 18-04-2022 om 09:40 [-0400]:
Toggle quote (7 lines)
> Instead of the "replace 'install" lambda, I had done:
>   #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs
> "out")))
> which is both shorter and to my understanding more generic (more
> adaptable to future additional binaries or libraries, though this
> package will likely only ever have a single binary).

Long term, %outputs, %build-inputs, ... are being phased out, so I'd go
with, so I'd go with

(arguments (list #:make-flags #~(string-append "PREFIX=" #$output)))

here instead.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYl2yNxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7o0qAP4wemfFI33yAzLAnrXzJXAHGx9L
jBFhgOh3ejsnTwO//gD/TTXigCRbhVfE+0f2nHjddBtkSdvaGcpVJe9BbAMOUQs=
=C+YI
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 18 Apr 20:53 +0200
97da943a1c1aaea2622bed8e651f3fdb3368e5c4.camel@telenet.be
Wil deBeest schreef op za 16-04-2022 om 17:37 [+0200]:
Toggle quote (5 lines)
> +    (description "Resource monitor that shows usage and stats
> +for processor, memory, disks, network and processes.
> +
> +C++

Seems like an implementation detail to me.

Toggle quote (2 lines)
> version and continuation of bashtop and bpytop.

In that case, can 'bashtop' and 'bpytop' be removed now? (Using
'(deprecated-package ...) for a smooth transition).

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYl2zlRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7rlSAQD+a5LYt77bsCx3BPHmKM+qV6Em
ABpxlCy6CGlkHKZ7UQEAuZ/yzl9k5xQPY2UOkEl1RWe1L9reJmTVL46MvYQN5Q4=
=Fges
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 18 Apr 20:55 +0200
a38afd208874e04a20ca508f46bbaa99d7ccb566.camel@telenet.be
Wil deBeest schreef op za 16-04-2022 om 17:37 [+0200]:
Toggle quote (7 lines)
> +Features
> +
> +    Easy to use, with a game inspired menu system.
> +    Full mouse support, all buttons with a highlighted key is clickable
> + and mouse scroll works in process list and menu boxes.
> +    Fast and responsive UI with UP, DOWN keys process selection.

What's an UP and DOWN key? I just have a regular up and down keys but
no fancy uppercase UP and DOWN keys ...

Toggle quote (13 lines)
> +    Function for showing detailed stats for selected process.
> +    Ability to filter processes.
> +    Easy switching between sorting options.
> +    Tree view of processes.
> +    Send any signal to selected process.
> +    UI menu for changing all config file options.
> +    Auto scaling graph for network usage.
> +    Shows IO activity and speeds for disks
> +    Battery meter
> +    Selectable symbols for the graphs
> +    Custom presets
> +    And more...

It's a list, so you can use the Texinfo markup @itemize, @item and @end
itemize here. It's also leaning a bit towards marketing talk with the
‘and more ...’ and rather subjective ‘fast and responsive UI’, ...

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYl20IhccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7gIAAP9I6jdaoijM6fMnpazbyXfKjYOx
0PHaouwIDm9I8nx5RQD/XEMWTBemCzv2tJ6sD5mlEy+o/Wxn8ZAqG1V0cPngmQ8=
=E3/1
-----END PGP SIGNATURE-----


W
W
Wil deBeest wrote on 29 Apr 01:17 +0200
(name . Maxime Devos)(address . maximedevos@telenet.be)
32AB7591-1B34-4AA9-B503-5CAFBCE10D60@4tii.de
Hi Maxime,

Toggle quote (7 lines)
> Long term, %outputs, %build-inputs, ... are being phased out, so I'd go
> with, so I'd go with
>
> (arguments (list #:make-flags #~(string-append "PREFIX=" #$output)))
>
> here instead.

I haven't been able to integrate your snippet into the package. Could you
show me how to do so or tell me which part of the handbook would be
relevant?


Toggle quote (3 lines)
> can 'bashtop' and 'bpytop' be removed now? (Using
> '(deprecated-package ...) for a smooth transition).

The projects are all by the same developer and bashtop hasn't changed in two years, so the assumption that the rewrites supersede the older implementations doesn't seem farfetched.


Toggle quote (7 lines)
> What's an UP and DOWN key? I just have a regular up and down keys but
> no fancy uppercase UP and DOWN keys ...
> [...]
> It's a list, so you can use the Texinfo markup @itemize, @item and @end
> itemize here. It's also leaning a bit towards marketing talk with the
> ‘and more ...’ and rather subjective ‘fast and responsive UI’, ...

That was just copy & paste, I had forgotten about cut ;)


Cheers
Wil



|--------------------------|
| [PATCH] added btop 1.2.6 |
|--------------------------|


---
gnu/packages/admin.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

Toggle diff (45 lines)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index a200050d97..7b2e9660e1 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -752,6 +752,36 @@ (define-public bpytop
@command{bashtop}.")
    (license license:asl2.0)))

+(define-public btop
+  (package
+    (name "btop")
+    (version "1.2.6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/aristocratos/btop")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "03nd34q1w01visd2bg7mxrcjn0s6lnbm4s0vsfsj2mfv1rvyjl5b"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:make-flags
+       (list (string-append "PREFIX=" %output))
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure))
+        #:tests? #f))
+    (home-page "https://github.com/aristocratos/btop")
+    (synopsis "Resource monitor")
+    (description "Resource monitor that shows usage and stats
+for processor, memory, disks, network and processes.
+
+C++ version and continuation of bashtop and bpytop.")
+    (license license:asl2.0)))
+
(define-public pies
  (package
    (name "pies")

base-commit: 882cacc1bb5be0df334dd7ce55b385a3a1678728
-- 
2.35.1
M
M
Maxime Devos wrote on 29 Apr 11:37 +0200
(name . Wil deBeest)(address . bovid-19@4tii.de)
e15b639fb4533dbd5a50e26317ca5736c820c785.camel@telenet.be
Wil deBeest schreef op vr 29-04-2022 om 01:17 [+0200]:
Toggle quote (13 lines)
> Hi Maxime,
>
> > Long term, %outputs, %build-inputs, ... are being phased out, so I'd go
> > with, so I'd go with
> >
> >    (arguments (list #:make-flags #~(string-append "PREFIX=" #$output)))
> >
> > here instead.
>
> I haven't been able to integrate your snippet into the package.   Could you
> show me how to do so or tell me which part of the handbook would be
> relevant?

For a good example, see the 'stress-ng' package definition 'guix edit
stress-ng'. #:make-flags is documented in the manual (search for
#:make-flags or go to (guix)Build Systems). #$output is documented in
‘(guix)G-Expressions’.

Very concretely:

(package
[...]
(arguments (list #:tests? #false ; some comment
#:make-flags #~(...)
#:phases
;; [Stuff for replacing the install phase and
;; removing the configure phase]
#~(modify-phases %standard-phases ...))))

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYmux1RccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7kiQAP9dhsDjMNzGM4RAbnyGkovqiupM
y7zYm6xxg6AHTubuTAEA86YMvLueYIqQ5BzokH9rOdk1XHmkElZdrDrwYUoFsgY=
=Krvp
-----END PGP SIGNATURE-----


W
W
Wil deBeest wrote on 28 May 13:21 +0200
(name . Maxime Devos)(address . maximedevos@telenet.be)
C2C2DCDB-F615-47B6-ACDB-1B8E710BD356@4tii.de
Maxime Devos <maximedevos@telenet.be> writes:

Toggle quote (33 lines)
> [[PGP Signed Part:Undecided]]
> Wil deBeest schreef op vr 29-04-2022 om 01:17 [+0200]:
>> Hi Maxime,
>>> Long term, %outputs, %build-inputs, ... are being phased out, so I'd go
>>> with, so I'd go with
>>> (arguments (list #:make-flags #~(string-append "PREFIX=" #$output)))
>>> here instead.
>> I haven't been able to integrate your snippet into the package. Could you
>> show me how to do so or tell me which part of the handbook would be
>> relevant?
>
> For a good example, see the 'stress-ng' package definition 'guix edit
> stress-ng'. #:make-flags is documented in the manual (search for
> #:make-flags or go to (guix)Build Systems). #$output is documented in
> ‘(guix)G-Expressions’.
>
> Very concretely:
>
> (package
> [...]
> (arguments (list #:tests? #false ; some comment
> #:make-flags #~(...)
> #:phases
> ;; [Stuff for replacing the install phase and
> ;; removing the configure phase]
> #~(modify-phases %standard-phases ...))))
>
> Greetings,
> Maxime.
>
> [[End of PGP Signed Part]]


Thank you, I think I got it.

I've also added gcc-12 as a native input for efficiency reasons [1].

Since I'm not familiar with the process of deprecation, I've kept the thoughts I had written down regarding your question on whether bashtop & bpytop could be removed, even though there's probably nothing in there that hasn't at least been discussed before [2]


Cheers!




---
gnu/packages/admin.scm | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)

Toggle diff (79 lines)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index af75dee697..fccc0e8dd3 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -101,6 +101,7 @@ (define-module (gnu packages admin)
  #:use-module (gnu packages file)
  #:use-module (gnu packages flex)
  #:use-module (gnu packages gawk)
+  #:use-module (gnu packages gcc)
  #:use-module (gnu packages gettext)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages glib)
@@ -752,6 +753,37 @@ (define-public bpytop
@command{bashtop}.")
    (license license:asl2.0)))

+(define-public btop
+  (package
+    (name "btop")
+    (version "1.2.6")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/aristocratos/btop")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "03nd34q1w01visd2bg7mxrcjn0s6lnbm4s0vsfsj2mfv1rvyjl5b"))))
+    (native-inputs (list gcc-12))
+    (build-system gnu-build-system)
+    (arguments
+     (list #:make-flags
+       #~(list (string-append "PREFIX=" #$output))
+       #:phases
+       #~(modify-phases %standard-phases
+         (delete 'configure))
+        #:tests? #f))
+    (home-page "https://github.com/aristocratos/btop")
+    (synopsis "Resource monitor")
+    (description "Resource monitor that shows usage and stats
+for processor, memory, disks, network and processes.
+
+C++ version and continuation of bashtop and bpytop.")
+    (license license:asl2.0)))
+
(define-public pies
  (package
    (name "pies")

base-commit: 6e9d99f97f15347f44df0518faa5e3b8b9d5184e
-- 
2.36.1









[1] "Needs GCC 10 or higher, (GCC 11 or above strongly recommended for
better CPU efficiency in the compiled binary)", sayeth the readme

[2] Is there a mechanism to flag these packages so a deprecation warning
would be shown when they are searched for?  (A first look seems to
suggest `gexp->derivation' could be used for that, but I'll have read
that more thoroughly)

If there is I think it would make sense to add a deprecation warning
including that reasons why they shouldn't be replaced can be directed to
e.g. 54974@debbugs.gnu.org and wait for feedback for some set amount of
time before either redefining the package names as aliases for btop or
removing them.  In both cases I think a message would make sense for
those who have installed them.  For others, adding something like
"replaces its predecessors bashtop and bpytop" to the description seems
to be enough.
?