Subject: Re: [bug#41040] [PATCH] Package Definition for QDirStat

From: Thovthe <[email-masked]>
Date: Sat, 13 Jun 2020 21:51:29 +0000

> This is another thing that I got wrong. It looks like having the newline
> is a common thing to do in Guix, probably for the reasons you describe.
> Feel free to put this back as it was. Sorry for creating extra work.

Not a problem.  I'm happy that it's ok for it to closer match my sense of
aesthetics.

I've also moved some things around and added a line of white space for readability
and separation of concerns.

> > > I think that perl should be added as input, so that the #! line of
> > > qdirstat-cache-writer can be patched to refer to a perl in the store.
> >
> > I'm leaving this for once I've moved qdirstat-cache-writer into a
> > separate package/output since this definition works for the essential
> > functionality.
>
> Ok.
> -------------------------
> > > For bonus points, it might be nice to move qdirstat-cache-writer to its
> > > own output since it is made to be run independently of QDirStat and that
> > > way it could be installed without pulling in all the C++ and Graphical
> > > dependencies.
> >
> > How do you think this should look? Would I make another output in this
> > qdirstat.scm?
>
> Yes, adding another output is what I was thinking. The bind package is an
> example of this.

I've added some comments about this but right now I'm not interested in figuring
out how this package is built at a lower level since with this definition
provides the essential functionality and all tests pass.

> To summarize:
>
> Can you squash your squash all your changes together to send one patch?
>
> A more experienced Guix reviewer will have to answer the questions about
> the ordering of the module imports and the right thing to do with
> qdirstat-cache-writer.
>
> Once that's all done, they should be able to commit QDirStat to Guix!

Alright, it should look like it's popped into being from the very aether.

>From 159a4f8b44537c8b76db52b65cd9571962cb58e4 Mon Sep 17 00:00:00 2001
From: Thovthe <[email-masked]>
Date: Sat, 13 Jun 2020 21:42:38 +0000
Subject: [PATCH] gnu: Add qdirstat.

* gnu/packages/qdirstat.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
---
 gnu/local.mk              |  1 +
 gnu/packages/qdirstat.scm | 49 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 50 insertions(+)
 create mode 100644 gnu/packages/qdirstat.scm

diff --git a/gnu/local.mk b/gnu/local.mk
index aa5b67ab5f..2d06d1030c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -447,6 +447,7 @@ GNU_SYSTEM_MODULES =				\
   %D%/packages/python-xyz.scm			\
   %D%/packages/toys.scm				\
   %D%/packages/tryton.scm			\
+  %D%/packages/qdirstat.scm			\
   %D%/packages/qt.scm				\
   %D%/packages/radio.scm			\
   %D%/packages/ragel.scm			\
diff --git a/gnu/packages/qdirstat.scm b/gnu/packages/qdirstat.scm
new file mode 100644
index 0000000000..8188357855
--- /dev/null
+++ b/gnu/packages/qdirstat.scm
@@ -0,0 +1,49 @@
+(define-module (gnu packages qdirstat)
+  #:use-module (gnu packages compression)
+  #:use-module (gnu packages qt)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix git-download)
+  #:use-module (guix packages)
+  #:use-module ((guix licenses) #:prefix license:))
+
+
+(define-public qdirstat
+  (package
+    (name "qdirstat")
+    (version "1.6.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/shundhammer/qdirstat.git")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0q77a347qv1aka6sni6l03zh5jzyy9s74aygg554r73g01kxczpb"))))
+
+    (outputs `("out"))			; "cache-writer" could be made an output
+    (inputs
+     `(("qtbase" ,qtbase)		; Could add ("perl" ,perl) as an input
+       ("zlib" ,zlib)))			; for the cache-writer see debbug#41040
+    (native-inputs
+     `(("qttools" ,qttools)))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           (lambda* (#:key outputs #:allow-other-keys)
+             (invoke "qmake"
+                     (string-append "PREFIX="
+                                    (assoc-ref outputs "out"))
+                     (string-append "INSTALL_PREFIX="
+                                    (assoc-ref outputs "out"))))))))
+
+    (home-page "https://github.com/shundhammer/qdirstat")
+    (synopsis "Graphical disk space inspection utility")
+    (description
+     "QDirStat is a graphical application for analysing disk usage.  It shows
+where your disk space has gone and helps you clean it up.  Shaded boxes
+represent files and files are grouped by directory structure.")
+    (license (list license:gpl2+
+                   license:non-copyleft)))) ; scripts/qdirstat-cache-writer
--
2.26.2