Commit | Line | Data |
---|---|---|
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> |
47956fa0 | 4 | ;;; Copyright © 2016, 2017 ng0 <ng0@n0.is> |
0257294a | 5 | ;;; Copyright © 2018, 2019 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) | |
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) | |
45433bb0 | 34 | #:use-module (gnu packages perl) |
148585c2 | 35 | #:use-module (gnu packages compression)) |
5da64c7d EB |
36 | |
37 | (define-public mc | |
38 | (package | |
39 | (name "mc") | |
59b98b48 | 40 | (version "4.8.23") |
5da64c7d EB |
41 | (source |
42 | (origin | |
43 | (method url-fetch) | |
44 | (uri (string-append "http://ftp.midnight-commander.org/mc-" | |
45 | version ".tar.xz")) | |
46 | (sha256 | |
59b98b48 | 47 | (base32 "077z7phzq3m1sxyz7li77lyzv4rjmmh3wp2vy86pnc4387kpqzyx")))) |
5da64c7d EB |
48 | (build-system gnu-build-system) |
49 | (native-inputs `(("pkg-config" ,pkg-config) | |
5da64c7d EB |
50 | ("perl" ,perl))) |
51 | (inputs `(("aspell" ,aspell) | |
52 | ("ncurses" ,ncurses) | |
53 | ("libssh2" ,libssh2) | |
54 | ("glib" ,glib) | |
45433bb0 | 55 | ("check" ,check) |
56 | ("unzip" ,unzip))) | |
5da64c7d EB |
57 | (arguments |
58 | `(#:configure-flags | |
da62a4a1 | 59 | '("--with-screen=ncurses" "--enable-aspell") |
60 | #:phases | |
61 | (modify-phases %standard-phases | |
889b4af7 | 62 | (add-after 'patch-source-shebangs 'patch-FHS-file-names |
da62a4a1 | 63 | (lambda _ |
b2d00af7 | 64 | ;; Patch files to refer to executables in the store or $PATH. |
da62a4a1 | 65 | (substitute* "misc/mcedit.menu.in" |
66 | (("#! /bin/sh") (string-append "#!" (which "sh"))) | |
67 | (("/bin/bash") (which "bash"))) | |
68 | (substitute* "misc/ext.d/misc.sh.in" | |
69 | (("/bin/cat") "cat")) | |
b2d00af7 TGR |
70 | (substitute* (list "lib/utilunix.c" |
71 | "src/usermenu.c" | |
72 | "src/vfs/fish/fish.c" | |
73 | "tests/src/vfs/extfs/helpers-list/Makefile.in") | |
889b4af7 | 74 | (("/bin/sh") (which "sh"))) |
b2d00af7 TGR |
75 | (substitute* "src/filemanager/ext.c" |
76 | (("/bin/rm") "rm") | |
77 | (("/bin/sh") (which "sh"))) | |
78 | ||
79 | ;; There are other /bin/<shell>s hard-coded in this file, but they | |
80 | ;; are never tried after bash (mc's first choice) is found. | |
81 | (substitute* "lib/shell.c" | |
82 | (("/bin/bash") (which "bash"))) | |
889b4af7 TGR |
83 | #t)) |
84 | (add-before 'check 'fix-tests | |
85 | (lambda _ | |
86 | ;; Don't expect a UID or GID of ‘0’ in the build environment. | |
87 | (with-directory-excursion "tests/src/vfs/extfs/helpers-list/data" | |
88 | (substitute* (list "rpm.custom.output" | |
89 | "rpm.glib.output") | |
90 | ((" 0 0") "<<uid>> <<gid>>"))) | |
0257294a TGR |
91 | ;; XXX ERROR:mc_realpath.c:99:realpath_test: assertion failed |
92 | ;; (resolved_path == data->expected_string): ("" == "/usr/bin") | |
93 | (substitute* "tests/lib/mc_realpath.c" | |
94 | (("/usr/bin") "/") | |
95 | (("usr/bin") "/")) | |
da62a4a1 | 96 | #t))))) |
10db64e1 | 97 | (home-page "https://www.midnight-commander.org") |
5da64c7d EB |
98 | (synopsis "Graphical file manager") |
99 | (description | |
100 | "GNU Midnight Commander is a command-line file manager laid out in a | |
101 | common two-pane format. In addition to standard file management tasks such as | |
102 | copying and moving, Midnight Commander also supports viewing the contents of | |
103 | RPM package files and other archives and managing files on other computers via | |
104 | FTP or FISH. It also includes a powerful text editor for opening text | |
105 | files.") | |
451c1436 | 106 | (license gpl3+))) |