unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#49058] [PATCH] gnu: Add duc.
@ 2021-06-16  6:43 Brice Waegeneire
  2021-06-18 14:25 ` Xinglu Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Brice Waegeneire @ 2021-06-16  6:43 UTC (permalink / raw)
  To: 49058

* gnu/packages/disk.scm (duc): New variable.
---
 gnu/packages/disk.scm | 53 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index ccda71b268..ab9c29f081 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2020 Raghav Gururajan <raghavgururajan@disroot.org>
 ;;; Copyright © 2021 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2021 Mathieu Othacehe <othacehe@gnu.org>
+;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -46,6 +47,7 @@
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crypto)
   #:use-module (gnu packages cryptsetup)
+  #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages elf)
@@ -1303,3 +1305,54 @@ like raw system image files, can be copied or flashed a lot faster and more
 reliably with @code{bmaptool} than with traditional tools, like @code{dd} or
 @code{cp}.")
     (license license:gpl2)))
+
+(define-public duc
+  (package
+    (name "duc")
+    (version "1.4.4")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/zevv/duc")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1i7ry25xzy027g6ysv6qlf09ax04q4vy0kikl8h0aq5jbxsl9q52"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'patch
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out")))
+               (substitute* "src/duc/cmd-ui.c"
+                 (("ncursesw/ncurses.h") "ncurses.h"))
+               (substitute* "examples/index.cgi"
+                 (("/usr/local/bin/duc")
+                  (string-append out "/bin/duc")))
+               #t)))
+         (add-after 'install 'install-examples
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (doc (string-append out "/share/doc/" ,name "-" ,version)))
+               (copy-recursively "examples" (string-append doc "/examples"))))))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("cairo" ,cairo)
+       ("pango" ,pango)
+       ("tokyocabinet" ,tokyocabinet)
+       ("ncurses" ,ncurses)))
+    (synopsis "Library and suite of tools for inspecting disk usage")
+    (description " Duc maintains a database of accumulated sizes of
+directories of the file system, and allows you to query this database with
+some tools, or create fancy graphs showing you where your bytes are.
+
+Duc comes with console utilities, ncurses and X11 user interfaces and a CGI
+wrapper for disk usage querying and visualisation.")
+    (license license:lgpl3+)
+    (home-page "http://duc.zevv.nl")))
-- 
2.31.1





^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#49058] [PATCH] gnu: Add duc.
  2021-06-16  6:43 [bug#49058] [PATCH] gnu: Add duc Brice Waegeneire
@ 2021-06-18 14:25 ` Xinglu Chen
  2021-06-19 20:10   ` Brice Waegeneire
  0 siblings, 1 reply; 4+ messages in thread
From: Xinglu Chen @ 2021-06-18 14:25 UTC (permalink / raw)
  To: Brice Waegeneire, 49058

[-- Attachment #1: Type: text/plain, Size: 2534 bytes --]

On Wed, Jun 16 2021, Brice Waegeneire wrote:

> +(define-public duc
> +  (package
> +    (name "duc")
> +    (version "1.4.4")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/zevv/duc")
> +                    (commit version)))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +                "1i7ry25xzy027g6ysv6qlf09ax04q4vy0kikl8h0aq5jbxsl9q52"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:phases
> +       (modify-phases %standard-phases
> +         (add-after 'unpack 'patch
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out")))
> +               (substitute* "src/duc/cmd-ui.c"
> +                 (("ncursesw/ncurses.h") "ncurses.h"))
> +               (substitute* "examples/index.cgi"
> +                 (("/usr/local/bin/duc")
> +                  (string-append out "/bin/duc")))
> +               #t)))

The trailing #t can be dropped, phases don’t need to end with #t once
the ‘core-updates’ branch gets merged (hopefully soon :)).

> +         (add-after 'install 'install-examples
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (doc (string-append out "/share/doc/" ,name "-" ,version)))
> +               (copy-recursively "examples" (string-append doc "/examples"))))))))
> +    (native-inputs
> +     `(("autoconf" ,autoconf)
> +       ("automake" ,automake)
> +       ("libtool" ,libtool)
> +       ("pkg-config" ,pkg-config)))
> +    (inputs
> +     `(("cairo" ,cairo)
> +       ("pango" ,pango)
> +       ("tokyocabinet" ,tokyocabinet)
> +       ("ncurses" ,ncurses)))
> +    (synopsis "Library and suite of tools for inspecting disk usage")
> +    (description " Duc maintains a database of accumulated sizes of
                    ^^
Redundant whitespace

> +directories of the file system, and allows you to query this database with
> +some tools, or create fancy graphs showing you where your bytes are.
> +
> +Duc comes with console utilities, ncurses and X11 user interfaces and a CGI
> +wrapper for disk usage querying and visualisation.")
> +    (license license:lgpl3+)
> +    (home-page "http://duc.zevv.nl")))

Nit: the ‘home-page’ field usually comes before ‘synopsis’

Otherwise, LGTM.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#49058] [PATCH] gnu: Add duc.
  2021-06-18 14:25 ` Xinglu Chen
@ 2021-06-19 20:10   ` Brice Waegeneire
  2021-06-19 20:52     ` Xinglu Chen
  0 siblings, 1 reply; 4+ messages in thread
From: Brice Waegeneire @ 2021-06-19 20:10 UTC (permalink / raw)
  To: Xinglu Chen; +Cc: 49058

Hello Xinglu,

Thank you for the review!

Xinglu Chen <public@yoctocell.xyz> writes:

> The trailing #t can be dropped, phases don’t need to end with #t once
> the ‘core-updates’ branch gets merged (hopefully soon :)).

Removed.

>> +    (description " Duc maintains a database of accumulated sizes of
>                     ^^
> Redundant whitespace

Fixed.  I wanted to to factorize your checker
`check-no-trailing-whitespace description` to include leading
whitespaces but I didn't find how to does it nicely.

>> +    (license license:lgpl3+)
>> +    (home-page "http://duc.zevv.nl")))
>
> Nit: the ‘home-page’ field usually comes before ‘synopsis’

Moved over synopsis.

> Otherwise, LGTM.

Pused as 9fd9364492b95baf48baf054a326145fde5bc21b.

Cheers,
- Bricec




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [bug#49058] [PATCH] gnu: Add duc.
  2021-06-19 20:10   ` Brice Waegeneire
@ 2021-06-19 20:52     ` Xinglu Chen
  0 siblings, 0 replies; 4+ messages in thread
From: Xinglu Chen @ 2021-06-19 20:52 UTC (permalink / raw)
  To: Brice Waegeneire; +Cc: 49058

[-- Attachment #1: Type: text/plain, Size: 474 bytes --]

On Sat, Jun 19 2021, Brice Waegeneire wrote:

> Hello Xinglu,
>
> Thank you for the review!

You are welcome!

>>> +    (description " Duc maintains a database of accumulated sizes of
>>                     ^^
>> Redundant whitespace
>
> Fixed.  I wanted to to factorize your checker
> `check-no-trailing-whitespace description` to include leading
> whitespaces but I didn't find how to does it nicely.

Yeah, it would be nice to also make it check for leading whitespace.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-19 20:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16  6:43 [bug#49058] [PATCH] gnu: Add duc Brice Waegeneire
2021-06-18 14:25 ` Xinglu Chen
2021-06-19 20:10   ` Brice Waegeneire
2021-06-19 20:52     ` Xinglu Chen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).