mc.scm 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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 Nikita <nikita@n0.is>
  5. ;;; Copyright © 2018–2021 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. (define-module (gnu packages mc)
  22. #:use-module (gnu packages aspell)
  23. #:use-module (gnu packages check)
  24. #:use-module (gnu packages compression)
  25. #:use-module (gnu packages glib)
  26. #:use-module (gnu packages linux)
  27. #:use-module (gnu packages ncurses)
  28. #:use-module (gnu packages perl)
  29. #:use-module (gnu packages pkg-config)
  30. #:use-module (gnu packages ssh)
  31. #:use-module (gnu packages)
  32. #:use-module (guix build-system gnu)
  33. #:use-module (guix download)
  34. #:use-module (guix licenses)
  35. #:use-module (guix packages))
  36. (define-public mc
  37. (package
  38. (name "mc")
  39. (version "4.8.27")
  40. (source
  41. (origin
  42. (method url-fetch)
  43. (uri (string-append "https://ftp.osuosl.org/pub/midnightcommander/mc-"
  44. version ".tar.xz"))
  45. (sha256
  46. (base32 "1x2g5ahgzg951y4ldbsgkv8icni2mgh3p2wsds0j16gsbwi5kgii"))))
  47. (build-system gnu-build-system)
  48. (native-inputs `(("perl" ,perl)
  49. ("pkg-config" ,pkg-config)))
  50. (inputs `(("aspell" ,aspell)
  51. ("check" ,check)
  52. ("glib" ,glib)
  53. ("gpm" ,gpm)
  54. ("libssh2" ,libssh2)
  55. ("ncurses" ,ncurses)
  56. ("unzip" ,unzip)))
  57. (arguments
  58. `(#:configure-flags
  59. '("--with-screen=ncurses" "--enable-aspell")
  60. #:phases
  61. (modify-phases %standard-phases
  62. (add-after 'patch-source-shebangs 'patch-FHS-file-names
  63. (lambda _
  64. ;; Patch files to refer to executables in the store or $PATH.
  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"))
  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")
  74. (("/bin/sh") (which "sh")))
  75. (substitute* "src/filemanager/ext.c"
  76. (("/bin/rm") "rm")
  77. (("/bin/sh") (which "sh")))
  78. ;; There are other /bin/<shell>s hard-coded in this file, but they
  79. ;; are never tried after bash (mc's first choice) is found.
  80. (substitute* "lib/shell.c"
  81. (("/bin/bash") (which "bash")))
  82. #t))
  83. (add-before 'check 'fix-tests
  84. (lambda _
  85. ;; Don't expect a UID or GID of ‘0’ in the build environment.
  86. (with-directory-excursion "tests/src/vfs/extfs/helpers-list/data"
  87. (substitute* (list "rpm.custom.output"
  88. "rpm.glib.output")
  89. ((" 0 0") "<<uid>> <<gid>>")))
  90. ;; XXX ERROR:mc_realpath.c:99:realpath_test: assertion failed
  91. ;; (resolved_path == data->expected_string): ("" == "/usr/bin")
  92. (substitute* "tests/lib/mc_realpath.c"
  93. (("/usr/bin") "/")
  94. (("usr/bin") "/"))
  95. #t)))))
  96. (home-page "https://www.midnight-commander.org")
  97. (properties
  98. `((release-monitoring-url . "https://ftp.osuosl.org/pub/midnightcommander/")))
  99. (synopsis "Graphical file manager")
  100. (description
  101. "GNU Midnight Commander is a command-line file manager laid out in a
  102. common two-pane format. In addition to standard file management tasks such as
  103. copying and moving, Midnight Commander also supports viewing the contents of
  104. RPM package files and other archives and managing files on other computers via
  105. FTP or FISH. It also includes a powerful text editor for opening text
  106. files.")
  107. (license gpl3+)))