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 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages text-editors)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix utils)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system glib-or-gtk)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages assembly)
35 #:use-module (gnu packages boost)
36 #:use-module (gnu packages documentation)
37 #:use-module (gnu packages gcc)
38 #:use-module (gnu packages glib)
39 #:use-module (gnu packages gtk)
40 #:use-module (gnu packages libbsd)
41 #:use-module (gnu packages lua)
42 #:use-module (gnu packages ncurses)
43 #:use-module (gnu packages pkg-config)
44 #:use-module (gnu packages regex)
45 #:use-module (gnu packages ruby)
46 #:use-module (gnu packages terminals)
47 #:use-module (gnu packages xml))
55 (uri (string-append "https://github.com/martanne/"
56 name "/archive/v" version ".tar.gz"))
57 (file-name (string-append name "-" version ".tar.gz"))
60 "1iclfsc9vn40fqfiz56vrw6dmr4x8q9gvav0b53kkpc6zcfa86zi"))))
61 (build-system gnu-build-system)
63 `(#:test-target "test"
64 #:tests? #f ; no releases; snapshots are missing tests
66 (modify-phases %standard-phases
67 (add-after 'install 'wrap-binary
68 (lambda* (#:key inputs outputs #:allow-other-keys)
69 (let* ((out (assoc-ref outputs "out"))
70 (lpeg (assoc-ref inputs "lua-lpeg"))
71 (lua-version ,(version-major+minor (package-version lua)))
72 (LUA_PATH (string-append lpeg "/share/lua/"
73 lua-version "/?.lua"))
74 (LUA_CPATH (string-append lpeg "/lib/lua/"
75 lua-version "/?.so")))
76 (wrap-program (string-append out "/bin/vis")
77 `("LUA_PATH" ":" prefix (,LUA_PATH))
78 `("LUA_CPATH" ":" prefix (,LUA_CPATH)))
81 (list (search-path-specification
83 (files '("share/vis")))))
84 (inputs `(("lua", lua)
86 ("libtermkey", libtermkey)
87 ("lua-lpeg", lua-lpeg)
89 (synopsis "Vim-like text editor")
91 "Vis aims to be a modern, legacy free, simple yet efficient vim-like text
92 editor. It extends vim's modal editing with built-in support for multiple
93 cursors/selections and combines it with sam's structural regular expression
94 based command language.")
95 (home-page "https://github.com/martanne/vis")
96 (license (list license:isc ; Main distribution.
97 license:public-domain ; map.[ch]
98 license:expat)))) ; lexers and libutf.[ch]
100 (define-public kakoune
101 (let ((commit "125c8b7e80995732e0d8c87b82040025748f1b4f")
105 (version (string-append "0.0.0-" revision "." (string-take commit 7)))
108 (file-name (string-append "kakoune-" version "-checkout"))
111 (url "https://github.com/mawww/kakoune.git")
115 "19qs99l8r9p1vi5pxxx9an22fvi7xx40qw3jh2cnh2mbacawvdyb"))))
116 (build-system gnu-build-system)
118 `(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
120 (modify-phases %standard-phases
121 (add-after 'unpack 'patch-source
123 ;; kakoune uses confstr with _CS_PATH to find out where to find
124 ;; a posix shell, but this doesn't work in the build
125 ;; environment. This substitution just replaces that result
126 ;; with the "sh" path.
127 (substitute* "src/shell_manager.cc"
128 (("if \\(m_shell.empty\\(\\)\\)" line)
129 (string-append "m_shell = \"" (which "sh")
133 ;; kakoune requires us to be in the src/ directory to build
134 (add-before 'build 'chdir
135 (lambda _ (chdir "src") #t))
136 (add-before 'check 'fix-test-permissions
138 ;; Out git downloader doesn't give us write permissions, but
139 ;; without them the tests fail.
140 (zero? (system* "chmod" "-R" "u+w" "../test")))))))
141 (native-inputs `(("asciidoc" ,asciidoc)
143 (inputs `(("ncurses" ,ncurses)
145 (synopsis "Vim-inspired code editor")
147 "Kakoune is a code editor heavily inspired by Vim, as such most of its
148 commands are similar to Vi's ones, and it shares Vi's \"keystrokes as a text
149 editing language\" model. Kakoune has a strong focus on interactivity, most
150 commands provide immediate and incremental results, while still being
151 competitive (as in keystroke count) with Vim.")
152 (home-page "http://kakoune.org/")
153 (license license:unlicense))))
162 (uri (string-append "https://sourceforge.net/projects/joe-editor/"
163 "files/JOE sources/joe-" version "/"
164 "joe-" version ".tar.gz"))
167 "0y898r1xlrv75m00y598rvwwsricabplyh80wawsqafapcl4hw55"))))
168 (build-system gnu-build-system)
169 (inputs `(("ncurses" ,ncurses)))
170 (home-page "http://joe-editor.sourceforge.net/")
171 (synopsis "Console screen editor")
173 "JOE is a powerful console screen editor with a \"mode-less\" user
174 interface similar to many user-friendly editors. JOE has some of the key
175 bindings and many of the powerful features of GNU Emacs.")
176 (license license:gpl3+)))
178 (define-public leafpad
184 (uri (string-append "https://download.savannah.gnu.org/releases/"
185 "leafpad/leafpad-" version ".tar.gz"))
188 "0b0az2wvqgvam7w0ns1j8xp2llslm1rx6h7zcsy06a7j0yp257cm"))))
189 (build-system glib-or-gtk-build-system)
191 `(("intltool" ,intltool)
192 ("pkg-config" ,pkg-config)))
195 (home-page "http://tarot.freeshell.org/leafpad/")
196 (synopsis "GTK+ based text editor")
197 (description "Leafpad is a GTK+ text editor that emphasizes simplicity. As
198 development focuses on keeping weight down to a minimum, only the most essential
199 features are implemented in the editor. Leafpad is simple to use, is easily
200 compiled, requires few libraries, and starts up quickly. ")
201 (license license:gpl2+)))
209 (uri (string-append "https://sites.google.com/site/e3editor/Home/"
210 "e3-" version ".tgz"))
213 "0919kadkas020maqq37852isnzp053q2fnws2zh3mz81d1jiviak"))
214 (modules '((guix build utils)))
216 ;; Remove pre-built binaries.
217 (snippet '(delete-file-recursively "bin"))))
218 (build-system gnu-build-system)
221 #:make-flags (list (string-append "PREFIX="
222 (assoc-ref %outputs "out")))
223 #:phases (modify-phases %standard-phases
224 (delete 'configure))))
227 (home-page "https://sites.google.com/site/e3editor/")
228 (synopsis "Tiny text editor written in assembly")
230 "e3 is a micro text editor with an executable code size between 3800 and
231 35000 bytes. Except for ``syntax highlighting'', the e3 binary supports all
232 of the basic functions one expects plus built in arithmetic calculations.
233 UTF-8 coding of unicode characters is supported as well. e3 can use
234 Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings. e3 can be used on
235 16, 32, and 64-bit CPUs.")
236 (supported-systems '("x86_64-linux" "i686-linux"))
237 (license license:gpl2+)))
245 (uri (string-append "https://homepage.boetes.org/software/mg/mg-"
249 "1arasswgdadbb265rahq3867r9s54jva6k4m3p5n0f8mgjqhhdha"))
250 (modules '((guix build utils)))
253 (substitute* "GNUmakefile"
254 (("/usr/bin/") ""))))))
255 (build-system gnu-build-system)
257 `(("pkg-config" ,pkg-config)))
260 ("ncurses" ,ncurses)))
262 ;; No test suite available.
264 #:make-flags (list (string-append "prefix=" %output)
265 "CURSES_LIBS=-lncurses"
267 #:phases (modify-phases %standard-phases
269 (add-before 'build 'correct-location-of-difftool
271 (substitute* "buffer.c"
275 (add-before 'install 'patch-tutorial-location
276 (lambda* (#:key outputs #:allow-other-keys)
278 (("/usr") (assoc-ref outputs "out")))
280 (add-after 'install 'install-tutorial
281 (lambda* (#:key outputs #:allow-other-keys)
282 (let* ((out (assoc-ref outputs "out"))
283 (doc (string-append out "/share/doc/mg")))
284 (install-file "tutorial" doc)
286 (home-page "http://homepage.boetes.org/software/mg/")
287 (synopsis "Microscopic GNU Emacs clone")
289 "Mg (mg) is a GNU Emacs style editor, with which it is \"broadly\"
290 compatible. This is a portable version of the mg maintained by the OpenBSD
292 (license license:public-domain)))