guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: gnu: Add rmlint.


From: guix-commits
Subject: 01/01: gnu: Add rmlint.
Date: Mon, 7 Jan 2019 08:33:16 -0500 (EST)

ambrevar pushed a commit to branch master
in repository guix.

commit 3b451546ed9d3f858bfb213eabafdfc3dd4c130f
Author: Pierre Neidhardt <address@hidden>
Date:   Mon Jan 7 14:28:46 2019 +0100

    gnu: Add rmlint.
    
    * gnu/packages/disk.scm (rmlint): New variable.
---
 gnu/packages/disk.scm | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 71 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/disk.scm b/gnu/packages/disk.scm
index 4c4a3b8..33dba01 100644
--- a/gnu/packages/disk.scm
+++ b/gnu/packages/disk.scm
@@ -12,7 +12,7 @@
 ;;; Copyright © 2018 Vasile Dumitrascu <address@hidden>
 ;;; Copyright © 2018 Eric Bavier <address@hidden>
 ;;; Copyright © 2018 Rutger Helling <address@hidden>
-;;; Copyright © 2018 Pierre Neidhardt <address@hidden>
+;;; Copyright © 2018, 2019 Pierre Neidhardt <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -41,6 +41,7 @@
   #:use-module (gnu packages databases)
   #:use-module (gnu packages docbook)
   #:use-module (gnu packages documentation)
+  #:use-module (gnu packages elf)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
@@ -63,6 +64,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (guix build-system trivial)
+  #:use-module (guix build-system scons)
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
@@ -748,3 +750,71 @@ technology (like LVM, Btrfs, MD RAID, Swap...) is 
implemented in a separate
 plugin, possibly with multiple implementations (e.g. using LVM CLI or the new
 LVM D-Bus API).")
     (license license:lgpl2.1+)))
+
+(define-public rmlint
+  (package
+    (name "rmlint")
+    (version "2.8.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/sahib/rmlint";)
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1gc7gbnh0qg1kl151cv1ld87vhpm1v3pnkn7prhscdcc21jrg8nz"))))
+    (build-system scons-build-system)
+    (arguments
+     `(#:scons ,scons-python2
+       #:scons-flags (list (string-append "--prefix=" %output)
+                           (string-append "--actual-prefix=" %output))
+       #:tests? #f                      ; No tests?
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'scons-propagate-environment
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; TODO: `rmlint --gui` fails with
+             ;; "Failed to load shredder: No module named 'shredder'".
+             ;; The GUI might also need extra dependencies, such as
+             ;; python-gobject, python-cairo, dconf, librsvg, gtksourceview3.
+             (substitute* "lib/cmdline.c"
+               (("const char \\*commands\\[\\] = \\{\"python3\", \"python\", 
NULL\\};")
+                (string-append
+                 "const char *commands[] = {\""
+                 (assoc-ref inputs "python") "/bin/python"
+                 "\", \"python\", NULL};")))
+             ;; By design, SCons does not, by default, propagate
+             ;; environment variables to subprocesses.  See:
+             ;; 
<http://comments.gmane.org/gmane.linux.distributions.nixos/4969>
+             ;; Here, we modify the SConstruct file to arrange for
+             ;; environment variables to be propagated.
+             (substitute* "SConstruct"
+               (("^env = Environment\\(.*\\)" all)
+                (string-append
+                 all
+                 "\nenv['ENV']=os.environ"))))))))
+    (native-inputs
+     `(("pkg-config" ,pkg-config)
+       ("glib:bin" ,glib "bin")
+       ("python-sphinx" ,python-sphinx)))
+    (inputs
+     `(("python" ,python-wrapper)
+       ("glib" ,glib)
+       ("libelf" ,libelf)
+       ("elfutils" ,elfutils)
+       ("json-glib" ,json-glib)
+       ("libblkid" ,util-linux)))
+    (home-page "https://rmlint.rtfd.org";)
+    (synopsis "Remove duplicates and other lint from the filesystem")
+    (description "@command{rmlint} finds space waste and other broken things
+on your filesystem and offers to remove it.  @command{rmlint} can find:
+
address@hidden
address@hidden duplicate files and duplicate directories,
address@hidden non-stripped binaries (i.e. binaries with debug symbols),
address@hidden broken symbolic links,
address@hidden empty files and directories,
address@hidden files with broken user and/or group ID.
address@hidden itemize\n")
+    (license license:gpl3+)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]