text-editors.scm 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2016 José Miguel Sánchez García <jmi2k@openmailbox.org>
  3. ;;; Copyright © 2016 Carlo Zancanaro <carlo@zancanaro.id.au>
  4. ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
  5. ;;; Copyright © 2017 Feng Shu <tumashu@163.com>
  6. ;;; Copyright © 2017 ng0 <ng0@infotropique.org>
  7. ;;; Copyright © 2014 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.org>
  8. ;;;
  9. ;;; This file is part of GNU Guix.
  10. ;;;
  11. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  12. ;;; under the terms of the GNU General Public License as published by
  13. ;;; the Free Software Foundation; either version 3 of the License, or (at
  14. ;;; your option) any later version.
  15. ;;;
  16. ;;; GNU Guix is distributed in the hope that it will be useful, but
  17. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. ;;; GNU General Public License for more details.
  20. ;;;
  21. ;;; You should have received a copy of the GNU General Public License
  22. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  23. (define-module (gnu packages text-editors)
  24. #:use-module (guix packages)
  25. #:use-module (guix download)
  26. #:use-module (guix git-download)
  27. #:use-module (guix utils)
  28. #:use-module (guix build-system gnu)
  29. #:use-module (guix build-system glib-or-gtk)
  30. #:use-module ((guix licenses) #:prefix license:)
  31. #:use-module (gnu packages)
  32. #:use-module (gnu packages assembly)
  33. #:use-module (gnu packages boost)
  34. #:use-module (gnu packages documentation)
  35. #:use-module (gnu packages gcc)
  36. #:use-module (gnu packages glib)
  37. #:use-module (gnu packages gtk)
  38. #:use-module (gnu packages libbsd)
  39. #:use-module (gnu packages lua)
  40. #:use-module (gnu packages ncurses)
  41. #:use-module (gnu packages pkg-config)
  42. #:use-module (gnu packages ruby)
  43. #:use-module (gnu packages terminals)
  44. #:use-module (gnu packages xml))
  45. (define-public vis
  46. (package
  47. (name "vis")
  48. (version "0.3")
  49. (source (origin
  50. (method url-fetch)
  51. (uri (string-append "https://github.com/martanne/"
  52. name "/archive/v" version ".tar.gz"))
  53. (file-name (string-append name "-" version ".tar.gz"))
  54. (sha256
  55. (base32 "0xvhkj4j8pcmpnsx7f93d6n2f068xnl7wacfs97vr0agxwrfvn5y"))))
  56. (build-system gnu-build-system)
  57. (arguments
  58. `(#:tests? #f ; No tests.
  59. #:phases
  60. (modify-phases %standard-phases
  61. (add-after 'install 'wrap-binary
  62. (lambda* (#:key inputs outputs #:allow-other-keys)
  63. (let* ((out (assoc-ref outputs "out"))
  64. (lpeg (assoc-ref inputs "lua-lpeg"))
  65. (lua-version ,(version-major+minor (package-version lua)))
  66. (LUA_PATH (string-append lpeg "/share/lua/"
  67. lua-version "/?.lua"))
  68. (LUA_CPATH (string-append lpeg "/lib/lua/"
  69. lua-version "/?.so")))
  70. (wrap-program (string-append out "/bin/vis")
  71. `("LUA_PATH" ":" prefix (,LUA_PATH))
  72. `("LUA_CPATH" ":" prefix (,LUA_CPATH)))
  73. #t))))))
  74. (native-search-paths
  75. (list (search-path-specification
  76. (variable "VIS_PATH")
  77. (files '("share/vis")))))
  78. (inputs `(("lua", lua)
  79. ("ncurses", ncurses)
  80. ("libtermkey", libtermkey)
  81. ("lua-lpeg", lua-lpeg)))
  82. (synopsis "Vim-like text editor")
  83. (description
  84. "Vis aims to be a modern, legacy free, simple yet efficient vim-like text
  85. editor. It extends vim's modal editing with built-in support for multiple
  86. cursors/selections and combines it with sam's structural regular expression
  87. based command language.")
  88. (home-page "https://github.com/martanne/vis")
  89. (license (list license:isc ; Main distribution.
  90. license:public-domain ; map.[ch]
  91. license:expat)))) ; lexers and libutf.[ch]
  92. (define-public kakoune
  93. (let ((commit "125c8b7e80995732e0d8c87b82040025748f1b4f")
  94. (revision "1"))
  95. (package
  96. (name "kakoune")
  97. (version (string-append "0.0.0-" revision "." (string-take commit 7)))
  98. (source
  99. (origin
  100. (file-name (string-append "kakoune-" version "-checkout"))
  101. (method git-fetch)
  102. (uri (git-reference
  103. (url "https://github.com/mawww/kakoune.git")
  104. (commit commit)))
  105. (sha256
  106. (base32
  107. "19qs99l8r9p1vi5pxxx9an22fvi7xx40qw3jh2cnh2mbacawvdyb"))))
  108. (build-system gnu-build-system)
  109. (arguments
  110. `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
  111. #:phases
  112. (modify-phases %standard-phases
  113. (add-after 'unpack 'patch-source
  114. (lambda _
  115. ;; kakoune uses confstr with _CS_PATH to find out where to find
  116. ;; a posix shell, but this doesn't work in the build
  117. ;; environment. This substitution just replaces that result
  118. ;; with the "sh" path.
  119. (substitute* "src/shell_manager.cc"
  120. (("if \\(m_shell.empty\\(\\)\\)" line)
  121. (string-append "m_shell = \"" (which "sh")
  122. "\";\n " line)))
  123. #t))
  124. (delete 'configure)
  125. ;; kakoune requires us to be in the src/ directory to build
  126. (add-before 'build 'chdir
  127. (lambda _ (chdir "src") #t))
  128. (add-before 'check 'fix-test-permissions
  129. (lambda _
  130. ;; Out git downloader doesn't give us write permissions, but
  131. ;; without them the tests fail.
  132. (zero? (system* "chmod" "-R" "u+w" "../test")))))))
  133. (native-inputs `(("asciidoc" ,asciidoc)
  134. ("ruby" ,ruby)))
  135. (inputs `(("ncurses" ,ncurses)
  136. ("boost" ,boost)))
  137. (synopsis "Vim-inspired code editor")
  138. (description
  139. "Kakoune is a code editor heavily inspired by Vim, as such most of its
  140. commands are similar to Vi's ones, and it shares Vi's \"keystrokes as a text
  141. editing language\" model. Kakoune has a strong focus on interactivity, most
  142. commands provide immediate and incremental results, while still being
  143. competitive (as in keystroke count) with Vim.")
  144. (home-page "http://kakoune.org/")
  145. (license license:unlicense))))
  146. (define-public joe
  147. (package
  148. (name "joe")
  149. (version "4.4")
  150. (source
  151. (origin
  152. (method url-fetch)
  153. (uri (string-append "https://sourceforge.net/projects/joe-editor/"
  154. "files/JOE sources/joe-" version "/"
  155. "joe-" version ".tar.gz"))
  156. (sha256
  157. (base32
  158. "0y898r1xlrv75m00y598rvwwsricabplyh80wawsqafapcl4hw55"))))
  159. (build-system gnu-build-system)
  160. (inputs `(("ncurses" ,ncurses)))
  161. (home-page "http://joe-editor.sourceforge.net/")
  162. (synopsis "Console screen editor")
  163. (description
  164. "JOE is a powerful console screen editor with a \"mode-less\" user
  165. interface similar to many user-friendly editors. JOE has some of the key
  166. bindings and many of the powerful features of GNU Emacs.")
  167. (license license:gpl3+)))
  168. (define-public leafpad
  169. (package
  170. (name "leafpad")
  171. (version "0.8.18.1")
  172. (source (origin
  173. (method url-fetch)
  174. (uri (string-append "https://download.savannah.gnu.org/releases/"
  175. "leafpad/leafpad-" version ".tar.gz"))
  176. (sha256
  177. (base32
  178. "0b0az2wvqgvam7w0ns1j8xp2llslm1rx6h7zcsy06a7j0yp257cm"))))
  179. (build-system glib-or-gtk-build-system)
  180. (native-inputs
  181. `(("intltool" ,intltool)
  182. ("pkg-config" ,pkg-config)))
  183. (inputs
  184. `(("gtk+" ,gtk+-2)))
  185. (home-page "http://tarot.freeshell.org/leafpad/")
  186. (synopsis "GTK+ based text editor")
  187. (description "Leafpad is a GTK+ text editor that emphasizes simplicity. As
  188. development focuses on keeping weight down to a minimum, only the most essential
  189. features are implemented in the editor. Leafpad is simple to use, is easily
  190. compiled, requires few libraries, and starts up quickly. ")
  191. (license license:gpl2+)))
  192. (define-public e3
  193. (package
  194. (name "e3")
  195. (version "2.82")
  196. (source (origin
  197. (method url-fetch)
  198. (uri (string-append "https://sites.google.com/site/e3editor/Home/"
  199. "e3-" version ".tgz"))
  200. (sha256
  201. (base32
  202. "0919kadkas020maqq37852isnzp053q2fnws2zh3mz81d1jiviak"))
  203. (modules '((guix build utils)))
  204. ;; Remove pre-built binaries.
  205. (snippet '(delete-file-recursively "bin"))))
  206. (build-system gnu-build-system)
  207. (arguments
  208. `(#:tests? #f
  209. #:make-flags (list (string-append "PREFIX="
  210. (assoc-ref %outputs "out")))
  211. #:phases (modify-phases %standard-phases
  212. (delete 'configure))))
  213. (native-inputs
  214. `(("nasm" ,nasm)))
  215. (home-page "https://sites.google.com/site/e3editor/")
  216. (synopsis "Tiny text editor written in assembly")
  217. (description
  218. "e3 is a micro text editor with an executable code size between 3800 and
  219. 35000 bytes. Except for ``syntax highlighting'', the e3 binary supports all
  220. of the basic functions one expects plus built in arithmetic calculations.
  221. UTF-8 coding of unicode characters is supported as well. e3 can use
  222. Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings. e3 can be used on
  223. 16, 32, and 64-bit CPUs.")
  224. (supported-systems '("x86_64-linux" "i686-linux"))
  225. (license license:gpl2+)))
  226. (define-public mg
  227. (package
  228. (name "mg")
  229. (version "20170401")
  230. (source (origin
  231. (method url-fetch)
  232. (uri (string-append "https://homepage.boetes.org/software/mg/mg-"
  233. version ".tar.gz"))
  234. (sha256
  235. (base32
  236. "1arasswgdadbb265rahq3867r9s54jva6k4m3p5n0f8mgjqhhdha"))
  237. (modules '((guix build utils)))
  238. (snippet
  239. '(begin
  240. (substitute* "GNUmakefile"
  241. (("/usr/bin/") ""))))))
  242. (build-system gnu-build-system)
  243. (native-inputs
  244. `(("pkg-config" ,pkg-config)))
  245. (inputs
  246. `(("libbsd" ,libbsd)
  247. ("ncurses" ,ncurses)))
  248. (arguments
  249. ;; No test suite available.
  250. '(#:tests? #f
  251. #:make-flags (list (string-append "prefix=" %output)
  252. "CURSES_LIBS=-lncurses"
  253. "CC=gcc")
  254. #:phases (modify-phases %standard-phases
  255. (delete 'configure)
  256. (add-before 'build 'correct-location-of-difftool
  257. (lambda _
  258. (substitute* "buffer.c"
  259. (("/usr/bin/diff")
  260. (which "diff")))
  261. #t))
  262. (add-before 'install 'patch-tutorial-location
  263. (lambda* (#:key outputs #:allow-other-keys)
  264. (substitute* "mg.1"
  265. (("/usr") (assoc-ref outputs "out")))
  266. #t))
  267. (add-after 'install 'install-tutorial
  268. (lambda* (#:key outputs #:allow-other-keys)
  269. (let* ((out (assoc-ref outputs "out"))
  270. (doc (string-append out "/share/doc/mg")))
  271. (install-file "tutorial" doc)
  272. #t))))))
  273. (home-page "http://homepage.boetes.org/software/mg/")
  274. (synopsis "Microscopic GNU Emacs clone")
  275. (description
  276. "Mg (mg) is a GNU Emacs style editor, with which it is \"broadly\"
  277. compatible. This is a portable version of the mg maintained by the OpenBSD
  278. team.")
  279. (license license:public-domain)))