zile.scm 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
  4. ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
  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. (define-module (gnu packages zile)
  22. #:use-module (guix licenses)
  23. #:use-module (guix download)
  24. #:use-module (guix git-download)
  25. #:use-module (guix packages)
  26. #:use-module (guix utils)
  27. #:use-module (guix build-system gnu)
  28. #:use-module (gnu packages autotools)
  29. #:use-module (gnu packages bash)
  30. #:use-module (gnu packages bdw-gc)
  31. #:use-module (gnu packages guile)
  32. #:use-module (gnu packages gnupg)
  33. #:use-module (gnu packages m4)
  34. #:use-module (gnu packages man)
  35. #:use-module (gnu packages ncurses)
  36. #:use-module (gnu packages perl)
  37. #:use-module (gnu packages pkg-config)
  38. #:use-module (gnu packages version-control))
  39. (define-public zile
  40. (package
  41. (name "zile")
  42. (version "2.4.14")
  43. (source (origin
  44. (method url-fetch)
  45. (uri (string-append "mirror://gnu/zile/zile-"
  46. version ".tar.gz"))
  47. (sha256
  48. (base32
  49. "0x3byaddms8l3g7igx6njycqsq98wgapysdb5c7lhcnajlkp8y3s"))))
  50. (build-system gnu-build-system)
  51. (arguments
  52. '(#:phases
  53. (modify-phases %standard-phases
  54. (add-before 'configure 'patch-/bin/sh
  55. (lambda* (#:key inputs #:allow-other-keys)
  56. (let ((bash (assoc-ref inputs "bash")))
  57. ;; Refer to the actual shell.
  58. (substitute* '("lib/spawni.c" "src/funcs.c")
  59. (("/bin/sh")
  60. (string-append bash "/bin/sh")))
  61. #t))))))
  62. (inputs
  63. `(("boehm-gc" ,libgc)
  64. ("ncurses" ,ncurses)
  65. ("bash" ,bash)))
  66. (native-inputs
  67. `(("perl" ,perl)
  68. ("help2man" ,help2man)
  69. ("pkg-config" ,pkg-config)))
  70. (home-page "https://www.gnu.org/software/zile/")
  71. (synopsis "Lightweight Emacs clone")
  72. (description
  73. "GNU Zile is a lightweight Emacs clone. It usage is similar to the
  74. default Emacs configuration, but it carries a much lighter feature set.")
  75. (license gpl3+)))
  76. (define-public zile-on-guile
  77. ;; This is a fork of Zile that uses Guile, announced here:
  78. ;; <http://lists.gnu.org/archive/html/guile-user/2012-02/msg00033.html>.
  79. (let ((commit "fd097811a60e58696d734c35b0eb7da3afc1adb7")
  80. (revision "0"))
  81. (package
  82. (inherit zile)
  83. (name "zile-on-guile")
  84. (version (string-append (package-version zile)
  85. "-" revision "."
  86. (string-take commit 7)))
  87. (home-page "https://github.com/spk121/zile")
  88. (source (origin
  89. (method git-fetch)
  90. (uri (git-reference
  91. (url home-page)
  92. (commit commit)
  93. (recursive? #t))) ;for the Gnulib sub-module
  94. (sha256
  95. (base32
  96. "0wlli8hqal9ikmbl3a49kyhzyf164jk6mdbir3bclq2gxszs532d"))
  97. (file-name (string-append name "-" version "-checkout"))))
  98. (inputs
  99. `(("guile" ,guile-2.0)
  100. ,@(package-inputs zile)))
  101. (native-inputs
  102. `(("m4" ,m4) ;for 'bootstrap'
  103. ("autoconf" ,autoconf-wrapper)
  104. ("automake" ,automake)
  105. ;; For some reason, 'bootstrap' insists on having these.
  106. ("git" ,git)
  107. ("gpg" ,gnupg)
  108. ,@(package-native-inputs zile)))
  109. (arguments
  110. (substitute-keyword-arguments (package-arguments zile)
  111. ((#:phases phases)
  112. `(modify-phases ,phases
  113. (replace 'bootstrap
  114. (lambda _
  115. ;; Make sure all the files are writable so that ./bootstrap
  116. ;; can proceed.
  117. (for-each (lambda (file)
  118. (chmod file #o755))
  119. (find-files "."))
  120. (patch-shebang "gnulib/gnulib-tool")
  121. (invoke "sh" "./bootstrap"
  122. "--gnulib-srcdir=gnulib"
  123. "--skip-git" "--skip-po"
  124. "--verbose")))
  125. (add-after 'install 'wrap-command
  126. (lambda* (#:key outputs #:allow-other-keys)
  127. ;; Add zile.scm to the search path.
  128. (let* ((out (assoc-ref outputs "out"))
  129. (scheme (dirname
  130. (car (find-files out "^zile\\.scm$")))))
  131. (wrap-program (string-append out "/bin/zile-on-guile")
  132. `("GUILE_LOAD_PATH" ":" prefix (,scheme)))
  133. #t)))))))
  134. (synopsis "Lightweight clone of the Emacs editor using Guile")
  135. (description
  136. "GNU Zile is a lightweight clone of the Emacs editor, and Zile-on-Guile
  137. is a variant of Zile that can be extended in Guile Scheme. Hitting
  138. @kbd{M-C} (or: @kbd{Alt} and @kbd{C}) brings up a Guile REPL from which
  139. interactive functions akin to those of Emacs can be invoked."))))