gnu: gf2x: Update to 1.3.0.
[jackhill/guix/guix.git] / gnu / packages / ncdu.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 John Darrington <jmd@gnu.org>
3 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; Copyright © 2022 Efraim Flashner <efraim@flashner.co.il>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages ncdu)
22 #:use-module (gnu packages)
23 #:use-module (gnu packages ncurses)
24 #:use-module (guix licenses)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix utils)
28 #:use-module (guix gexp)
29 #:use-module (guix build-system gnu)
30 #:use-module (gnu packages perl)
31 #:use-module (gnu packages zig))
32
33 (define-public ncdu
34 (package
35 (name "ncdu")
36 (version "1.17")
37 (source (origin
38 (method url-fetch)
39 (uri (string-append "https://dev.yorhel.nl/download/ncdu-"
40 version ".tar.gz"))
41 (sha256
42 (base32
43 "1wfvdajln0iy7364nxkg4bpgdv8l3b6a9bnkhy67icqsxnl4a1w1"))))
44 (build-system gnu-build-system)
45 (inputs (list ncurses))
46 (synopsis "Ncurses-based disk usage analyzer")
47 (description
48 "Ncdu is a disk usage analyzer with an ncurses interface, aimed to be
49 run on a remote server where you don't have an entire graphical setup, but have
50 to do with a simple SSH connection. ncdu aims to be fast, simple and easy to
51 use, and should be able to run in any minimal POSIX-like environment with
52 ncurses installed.")
53 (license (x11-style
54 (string-append "https://g.blicky.net/ncdu.git/plain/COPYING?id=v"
55 version)))
56 (home-page "https://dev.yorhel.nl/ncdu")))
57
58 (define-public ncdu-2
59 (package
60 (inherit ncdu)
61 (name "ncdu2") ; To destinguish it from the C based version.
62 (version "2.1.2")
63 (source (origin
64 (method url-fetch)
65 (uri (string-append "https://dev.yorhel.nl/download/ncdu-"
66 version ".tar.gz"))
67 (sha256
68 (base32
69 "1p66691xgpljx1y92b4bfpn5rr7gnwbr5x3bf8bc78qq6vq6w3cy"))))
70 (arguments
71 (list
72 #:make-flags
73 #~(list (string-append "PREFIX=" #$output)
74 (string-append "CC=" #$(cc-for-target)))
75 #:phases
76 #~(modify-phases %standard-phases
77 (delete 'configure) ; No configure script.
78 (add-before 'build 'pre-build
79 (lambda _
80 (setenv "ZIG_GLOBAL_CACHE_DIR"
81 (mkdtemp "/tmp/zig-cache-XXXXXX"))))
82 (add-after 'build 'build-manpage
83 (lambda _
84 (delete-file "ncdu.1")
85 (invoke "make" "doc")))
86 (replace 'check
87 (lambda* (#:key tests? #:allow-other-keys)
88 (when tests?
89 (invoke "zig" "test" "build.zig")))))))
90 (native-inputs
91 (list perl zig))
92 (properties `((upstream-name . "ncdu")))))