gnu: nnn: Don't use NAME in source URI.
[jackhill/guix/guix.git] / gnu / packages / mc.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
5 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages mc)
23 #:use-module (guix packages)
24 #:use-module (guix licenses)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages aspell)
29 #:use-module (gnu packages ncurses)
30 #:use-module (gnu packages glib)
31 #:use-module (gnu packages ssh)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages check)
34 #:use-module (gnu packages perl)
35 #:use-module (gnu packages compression))
36
37 (define-public mc
38 (package
39 (name "mc")
40 (version "4.8.20")
41 (source
42 (origin
43 (method url-fetch)
44 (uri (string-append "http://ftp.midnight-commander.org/mc-"
45 version ".tar.xz"))
46 (sha256
47 (base32
48 "072h7n9b3j79fqn48xaw0xhlcjavpsmfpz6nyh20lhmfz3sffzh1"))))
49 (build-system gnu-build-system)
50 (native-inputs `(("pkg-config" ,pkg-config)
51 ("perl" ,perl)))
52 (inputs `(("aspell" ,aspell)
53 ("ncurses" ,ncurses)
54 ("libssh2" ,libssh2)
55 ("glib" ,glib)
56 ("check" ,check)
57 ("unzip" ,unzip)))
58 (arguments
59 `(#:configure-flags
60 '("--with-screen=ncurses" "--enable-aspell")
61 #:phases
62 (modify-phases %standard-phases
63 (add-after 'patch-source-shebangs 'patch-FHS-file-names
64 (lambda _
65 ;; Patch files to refer to executables in the store or $PATH.
66 (substitute* "misc/mcedit.menu.in"
67 (("#! /bin/sh") (string-append "#!" (which "sh")))
68 (("/bin/bash") (which "bash")))
69 (substitute* "misc/ext.d/misc.sh.in"
70 (("/bin/cat") "cat"))
71 (substitute* (list "lib/utilunix.c"
72 "src/usermenu.c"
73 "src/vfs/fish/fish.c"
74 "tests/src/vfs/extfs/helpers-list/Makefile.in")
75 (("/bin/sh") (which "sh")))
76 (substitute* "src/filemanager/ext.c"
77 (("/bin/rm") "rm")
78 (("/bin/sh") (which "sh")))
79
80 ;; There are other /bin/<shell>s hard-coded in this file, but they
81 ;; are never tried after bash (mc's first choice) is found.
82 (substitute* "lib/shell.c"
83 (("/bin/bash") (which "bash")))
84 #t))
85 (add-before 'check 'fix-tests
86 (lambda _
87 ;; Don't expect a UID or GID of ‘0’ in the build environment.
88 (with-directory-excursion "tests/src/vfs/extfs/helpers-list/data"
89 (substitute* (list "rpm.custom.output"
90 "rpm.glib.output")
91 ((" 0 0") "<<uid>> <<gid>>")))
92 #t)))))
93 (home-page "https://www.midnight-commander.org")
94 (synopsis "Graphical file manager")
95 (description
96 "GNU Midnight Commander is a command-line file manager laid out in a
97 common two-pane format. In addition to standard file management tasks such as
98 copying and moving, Midnight Commander also supports viewing the contents of
99 RPM package files and other archives and managing files on other computers via
100 FTP or FISH. It also includes a powerful text editor for opening text
101 files.")
102 (license gpl3+)))