gnu: linux-libre: Update to 4.16.6.
[jackhill/guix/guix.git] / gnu / packages / text-editors.scm
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, 2018 Eric Bavier <bavier@member.fsf.org>
5 ;;; Copyright © 2017 Feng Shu <tumashu@163.com>
6 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
7 ;;; Copyright © 2014 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.org>
8 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
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.
16 ;;;
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.
21 ;;;
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/>.
24
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 libreoffice)
42 #:use-module (gnu packages lua)
43 #:use-module (gnu packages ncurses)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages qt)
46 #:use-module (gnu packages regex)
47 #:use-module (gnu packages ruby)
48 #:use-module (gnu packages terminals)
49 #:use-module (gnu packages xml))
50
51 (define-public vis
52 (package
53 (name "vis")
54 (version "0.5")
55 (source (origin
56 (method url-fetch)
57 (uri (string-append "https://github.com/martanne/"
58 name "/archive/v" version ".tar.gz"))
59 (file-name (string-append name "-" version ".tar.gz"))
60 (sha256
61 (base32
62 "1xbxb3q963s6sav63yw0x30lm0wvxsrzb7hr6a7dh4f8r7mp1skp"))))
63 (build-system gnu-build-system)
64 (arguments
65 `(#:test-target "test"
66 #:tests? #f ; no releases; snapshots are missing tests
67 #:phases
68 (modify-phases %standard-phases
69 (add-after 'install 'wrap-binary
70 (lambda* (#:key inputs outputs #:allow-other-keys)
71 (let* ((out (assoc-ref outputs "out"))
72 (lpeg (assoc-ref inputs "lua-lpeg"))
73 (lua-version ,(version-major+minor (package-version lua)))
74 (LUA_PATH (string-append lpeg "/share/lua/"
75 lua-version "/?.lua"))
76 (LUA_CPATH (string-append lpeg "/lib/lua/"
77 lua-version "/?.so")))
78 (wrap-program (string-append out "/bin/vis")
79 `("LUA_PATH" ":" prefix (,LUA_PATH))
80 `("LUA_CPATH" ":" prefix (,LUA_CPATH)))
81 #t))))))
82 (native-search-paths
83 (list (search-path-specification
84 (variable "VIS_PATH")
85 (files '("share/vis")))))
86 (inputs `(("lua" ,lua)
87 ("ncurses" ,ncurses)
88 ("libtermkey" ,libtermkey)
89 ("lua-lpeg" ,lua-lpeg)
90 ("tre" ,tre)))
91 (synopsis "Vim-like text editor")
92 (description
93 "Vis aims to be a modern, legacy free, simple yet efficient vim-like text
94 editor. It extends vim's modal editing with built-in support for multiple
95 cursors/selections and combines it with sam's structural regular expression
96 based command language.")
97 (home-page "https://github.com/martanne/vis")
98 (license (list license:isc ; Main distribution.
99 license:public-domain ; map.[ch]
100 license:expat)))) ; lexers and libutf.[ch]
101
102 (define-public kakoune
103 (package
104 (name "kakoune")
105 (version "2018.04.13")
106 (source
107 (origin
108 (method url-fetch)
109 (uri (string-append "https://github.com/mawww/kakoune/"
110 "releases/download/v" version "/"
111 name "-" version ".tar.bz2"))
112 (sha256
113 (base32
114 "1kkzs5nrjxzd1jq7a4k7qfb5kg05871z0r3d9c0yhz9shf6wz36d"))))
115 (build-system gnu-build-system)
116 (arguments
117 `(#:make-flags
118 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
119 #:phases
120 (modify-phases %standard-phases
121 (add-after 'unpack 'patch-source
122 (lambda _
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")
130 "\";\n " line)))
131 #t))
132 (delete 'configure) ; no configure script
133 ;; kakoune requires us to be in the src/ directory to build
134 (add-before 'build 'chdir
135 (lambda _ (chdir "src") #t)))))
136 (native-inputs
137 `(("asciidoc" ,asciidoc)
138 ("pkg-config" ,pkg-config)
139 ("ruby" ,ruby)))
140 (inputs
141 `(("ncurses" ,ncurses)
142 ("boost" ,boost)))
143 (synopsis "Vim-inspired code editor")
144 (description
145 "Kakoune is a code editor heavily inspired by Vim, as such most of its
146 commands are similar to Vi's ones, and it shares Vi's \"keystrokes as a text
147 editing language\" model. Kakoune has a strong focus on interactivity, most
148 commands provide immediate and incremental results, while still being
149 competitive (as in keystroke count) with Vim.")
150 (home-page "http://kakoune.org/")
151 (license license:unlicense)))
152
153 (define-public joe
154 (package
155 (name "joe")
156 (version "4.6")
157 (source
158 (origin
159 (method url-fetch)
160 (uri (string-append "https://sourceforge.net/projects/joe-editor/"
161 "files/JOE sources/joe-" version "/"
162 "joe-" version ".tar.gz"))
163 (sha256
164 (base32
165 "1pmr598xxxm9j9dl93kq4dv36zyw0q2dh6d7x07hf134y9hhlnj9"))))
166 (build-system gnu-build-system)
167 (inputs `(("ncurses" ,ncurses)))
168 (home-page "http://joe-editor.sourceforge.net/")
169 (synopsis "Console screen editor")
170 (description
171 "JOE is a powerful console screen editor with a \"mode-less\" user
172 interface similar to many user-friendly editors. JOE has some of the key
173 bindings and many of the powerful features of GNU Emacs.")
174 (license license:gpl3+)))
175
176 (define-public leafpad
177 (package
178 (name "leafpad")
179 (version "0.8.18.1")
180 (source (origin
181 (method url-fetch)
182 (uri (string-append "mirror://savannah/"
183 "leafpad/leafpad-" version ".tar.gz"))
184 (sha256
185 (base32
186 "0b0az2wvqgvam7w0ns1j8xp2llslm1rx6h7zcsy06a7j0yp257cm"))))
187 (build-system glib-or-gtk-build-system)
188 (native-inputs
189 `(("intltool" ,intltool)
190 ("pkg-config" ,pkg-config)))
191 (inputs
192 `(("gtk+" ,gtk+-2)))
193 (home-page "http://tarot.freeshell.org/leafpad/")
194 (synopsis "GTK+ based text editor")
195 (description "Leafpad is a GTK+ text editor that emphasizes simplicity. As
196 development focuses on keeping weight down to a minimum, only the most essential
197 features are implemented in the editor. Leafpad is simple to use, is easily
198 compiled, requires few libraries, and starts up quickly. ")
199 (license license:gpl2+)))
200
201 (define-public e3
202 (package
203 (name "e3")
204 (version "2.82")
205 (source (origin
206 (method url-fetch)
207 (uri (string-append "https://sites.google.com/site/e3editor/Home/"
208 "e3-" version ".tgz"))
209 (sha256
210 (base32
211 "0919kadkas020maqq37852isnzp053q2fnws2zh3mz81d1jiviak"))
212 (modules '((guix build utils)))
213
214 ;; Remove pre-built binaries.
215 (snippet '(delete-file-recursively "bin"))))
216 (build-system gnu-build-system)
217 (arguments
218 `(#:tests? #f
219 #:make-flags (list (string-append "PREFIX="
220 (assoc-ref %outputs "out")))
221 #:phases (modify-phases %standard-phases
222 (delete 'configure))))
223 (native-inputs
224 `(("nasm" ,nasm)))
225 (home-page "https://sites.google.com/site/e3editor/")
226 (synopsis "Tiny text editor written in assembly")
227 (description
228 "e3 is a micro text editor with an executable code size between 3800 and
229 35000 bytes. Except for ``syntax highlighting'', the e3 binary supports all
230 of the basic functions one expects plus built in arithmetic calculations.
231 UTF-8 coding of unicode characters is supported as well. e3 can use
232 Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings. e3 can be used on
233 16, 32, and 64-bit CPUs.")
234 (supported-systems '("x86_64-linux" "i686-linux"))
235 (license license:gpl2+)))
236
237 (define-public mg
238 (package
239 (name "mg")
240 (version "20180408")
241 (source (origin
242 (method git-fetch)
243 (uri (git-reference
244 (url "https://github.com/hboetes/mg")
245 (commit version)))
246 (file-name (git-file-name name version))
247 (sha256
248 (base32
249 "06w86xk7sjl2x2h3z6msn8kpmwj05qdimcym77wzhz5s94dzh1bl"))
250 (modules '((guix build utils)))
251 (snippet
252 '(begin
253 (substitute* "GNUmakefile"
254 (("/usr/bin/") ""))))))
255 (build-system gnu-build-system)
256 (native-inputs
257 `(("pkg-config" ,pkg-config)))
258 (inputs
259 `(("libbsd" ,libbsd)
260 ("ncurses" ,ncurses)))
261 (arguments
262 ;; No test suite available.
263 '(#:tests? #f
264 #:make-flags (list (string-append "prefix=" %output)
265 "CC=gcc")
266 #:phases (modify-phases %standard-phases
267 (delete 'configure) ; no configure script
268 (add-before 'build 'correct-location-of-difftool
269 (lambda _
270 (substitute* "buffer.c"
271 (("/usr/bin/diff")
272 (which "diff")))
273 #t))
274 (add-before 'install 'patch-tutorial-location
275 (lambda* (#:key outputs #:allow-other-keys)
276 (substitute* "mg.1"
277 (("/usr") (assoc-ref outputs "out")))
278 #t))
279 (add-after 'install 'install-tutorial
280 (lambda* (#:key outputs #:allow-other-keys)
281 (let* ((out (assoc-ref outputs "out"))
282 (doc (string-append out "/share/doc/mg")))
283 (install-file "tutorial" doc)
284 #t))))))
285 (home-page "https://homepage.boetes.org/software/mg/")
286 (synopsis "Microscopic GNU Emacs clone")
287 (description
288 "Mg (mg) is a GNU Emacs style editor, with which it is \"broadly\"
289 compatible. This is a portable version of the mg maintained by the OpenBSD
290 team.")
291 (license license:public-domain)))
292
293 (define-public ghostwriter
294 (package
295 (name "ghostwriter")
296 (version "1.6.2")
297 (source (origin
298 (method git-fetch)
299 (uri (git-reference
300 (url "https://github.com/wereturtle/ghostwriter.git")
301 (commit (string-append "v" version))))
302 (file-name (git-file-name name version))
303 (sha256
304 (base32
305 "0251563zy0q69fzfacvalpx43y15cshb0bhshyd4w37061gh1c12"))))
306 (build-system gnu-build-system)
307 (native-inputs
308 `(("pkg-config" ,pkg-config)
309 ("qttools" ,qttools))) ;for lrelease
310 (inputs
311 `(("hunspell" ,hunspell)
312 ("qtbase" ,qtbase)
313 ("qtmultimedia" ,qtmultimedia)
314 ("qtsvg" ,qtsvg)
315 ("qtwebkit" ,qtwebkit)))
316 (arguments
317 `(#:phases
318 (modify-phases %standard-phases
319 (replace 'configure
320 (lambda* (#:key outputs #:allow-other-keys)
321 (let ((out (assoc-ref outputs "out")))
322 (invoke "qmake" (string-append "PREFIX=" out)))))
323 (add-after 'configure 'create-translations
324 (lambda _
325 ;; `lrelease` will not overwrite, so delete existing .qm files
326 (for-each delete-file (find-files "translations" ".*\\.qm"))
327 (apply invoke "lrelease" (find-files "translations" ".*\\.ts"))))
328 ;; Ensure that icons are found at runtime.
329 (add-after 'install 'wrap-executable
330 (lambda* (#:key inputs outputs #:allow-other-keys)
331 (let ((out (assoc-ref outputs "out")))
332 (wrap-program (string-append out "/bin/ghostwriter")
333 `("QT_PLUGIN_PATH" ":" prefix
334 ,(map (lambda (label)
335 (string-append (assoc-ref inputs label)
336 "/lib/qt5/plugins/"))
337 '("qtsvg" "qtmultimedia"))))))))))
338 (home-page "https://wereturtle.github.io/ghostwriter/")
339 (synopsis "Write without distractions")
340 (description
341 "@code{ghostwriter} provides a relaxing, distraction-free writing
342 environment with Markdown markup.")
343 (license license:gpl3+))) ;icons/* under CC-BY-SA3