gnu: Add wlgreet.
[jackhill/guix/guix.git] / gnu / packages / mc.scm
CommitLineData
5da64c7d
EB
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
451c1436 3;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
3c986a7d 4;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
94381414 5;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
5da64c7d
EB
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)
5da64c7d 23 #:use-module (gnu packages aspell)
5da64c7d 24 #:use-module (gnu packages check)
11e4ccc6
TGR
25 #:use-module (gnu packages compression)
26 #:use-module (gnu packages glib)
ef5c6f90 27 #:use-module (gnu packages linux)
11e4ccc6 28 #:use-module (gnu packages ncurses)
45433bb0 29 #:use-module (gnu packages perl)
11e4ccc6
TGR
30 #:use-module (gnu packages pkg-config)
31 #:use-module (gnu packages ssh)
32 #:use-module (gnu packages)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix download)
35 #:use-module (guix licenses)
36 #:use-module (guix packages))
5da64c7d
EB
37
38(define-public mc
39 (package
40 (name "mc")
d1d92061 41 (version "4.8.27")
5da64c7d
EB
42 (source
43 (origin
44 (method url-fetch)
d1d92061 45 (uri (string-append "https://ftp.osuosl.org/pub/midnightcommander/mc-"
5da64c7d
EB
46 version ".tar.xz"))
47 (sha256
d1d92061 48 (base32 "1x2g5ahgzg951y4ldbsgkv8icni2mgh3p2wsds0j16gsbwi5kgii"))))
5da64c7d 49 (build-system gnu-build-system)
8394619b
LC
50 (native-inputs (list perl pkg-config))
51 (inputs (list aspell
52 check
53 glib
54 gpm
55 libssh2
56 ncurses
57 unzip))
5da64c7d
EB
58 (arguments
59 `(#:configure-flags
da62a4a1 60 '("--with-screen=ncurses" "--enable-aspell")
61 #:phases
62 (modify-phases %standard-phases
889b4af7 63 (add-after 'patch-source-shebangs 'patch-FHS-file-names
da62a4a1 64 (lambda _
b2d00af7 65 ;; Patch files to refer to executables in the store or $PATH.
da62a4a1 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"))
b2d00af7
TGR
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")
889b4af7 75 (("/bin/sh") (which "sh")))
b2d00af7
TGR
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")))
889b4af7
TGR
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>>")))
0257294a
TGR
92 ;; XXX ERROR:mc_realpath.c:99:realpath_test: assertion failed
93 ;; (resolved_path == data->expected_string): ("" == "/usr/bin")
94 (substitute* "tests/lib/mc_realpath.c"
95 (("/usr/bin") "/")
96 (("usr/bin") "/"))
da62a4a1 97 #t)))))
10db64e1 98 (home-page "https://www.midnight-commander.org")
d1d92061
ST
99 (properties
100 `((release-monitoring-url . "https://ftp.osuosl.org/pub/midnightcommander/")))
5da64c7d
EB
101 (synopsis "Graphical file manager")
102 (description
103 "GNU Midnight Commander is a command-line file manager laid out in a
104common two-pane format. In addition to standard file management tasks such as
105copying and moving, Midnight Commander also supports viewing the contents of
106RPM package files and other archives and managing files on other computers via
107FTP or FISH. It also includes a powerful text editor for opening text
108files.")
451c1436 109 (license gpl3+)))