gnu: perl-email-abstract: Update to 3.009.
[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, 2020 Eric Bavier <bavier@posteo.net>
5 ;;; Copyright © 2017 Feng Shu <tumashu@163.com>
6 ;;; Copyright © 2017 Nikita <nikita@n0.is>
7 ;;; Copyright © 2014 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.org>
8 ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
10 ;;; Copyright © 2019 Andreas Enge <andreas@enge.fr>
11 ;;; Copyright © 2019, 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
12 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
13 ;;; Copyright © 2020 Tom Zander <tomz@freedommail.ch>
14 ;;; Copyright © 2020 Mark Meyer <mark@ofosos.org>
15 ;;; Copyright © 2020 Maxime Devos <maximedevos@telenet.be>
16 ;;; Copyright © 2021 aecepoglu <aecepoglu@fastmail.fm>
17 ;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
18 ;;;
19 ;;; This file is part of GNU Guix.
20 ;;;
21 ;;; GNU Guix is free software; you can redistribute it and/or modify it
22 ;;; under the terms of the GNU General Public License as published by
23 ;;; the Free Software Foundation; either version 3 of the License, or (at
24 ;;; your option) any later version.
25 ;;;
26 ;;; GNU Guix is distributed in the hope that it will be useful, but
27 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
28 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29 ;;; GNU General Public License for more details.
30 ;;;
31 ;;; You should have received a copy of the GNU General Public License
32 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33
34 (define-module (gnu packages text-editors)
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix git-download)
38 #:use-module (guix utils)
39 #:use-module (guix build-system cargo)
40 #:use-module (guix build-system cmake)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system glib-or-gtk)
43 #:use-module (guix build-system python)
44 #:use-module ((guix licenses) #:prefix license:)
45 #:use-module (gnu packages)
46 #:use-module (gnu packages aspell)
47 #:use-module (gnu packages assembly)
48 #:use-module (gnu packages autotools)
49 #:use-module (gnu packages boost)
50 #:use-module (gnu packages code)
51 #:use-module (gnu packages crates-io)
52 #:use-module (gnu packages documentation)
53 #:use-module (gnu packages fontutils)
54 #:use-module (gnu packages freedesktop)
55 #:use-module (gnu packages gcc)
56 #:use-module (gnu packages gettext)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gtk)
59 #:use-module (gnu packages guile)
60 #:use-module (gnu packages haskell-xyz)
61 #:use-module (gnu packages libbsd)
62 #:use-module (gnu packages libreoffice)
63 #:use-module (gnu packages llvm)
64 #:use-module (gnu packages lua)
65 #:use-module (gnu packages ncurses)
66 #:use-module (gnu packages pcre)
67 #:use-module (gnu packages perl)
68 #:use-module (gnu packages pkg-config)
69 #:use-module (gnu packages python)
70 #:use-module (gnu packages python-web)
71 #:use-module (gnu packages python-xyz)
72 #:use-module (gnu packages qt)
73 #:use-module (gnu packages regex)
74 #:use-module (gnu packages ruby)
75 #:use-module (gnu packages terminals)
76 #:use-module (gnu packages texinfo)
77 #:use-module (gnu packages version-control)
78 #:use-module (gnu packages xml)
79 #:use-module (gnu packages xorg))
80
81 (define-public vis
82 (package
83 (name "vis")
84 (version "0.7") ; also update the vis-test input
85 (source
86 (origin
87 (method git-fetch)
88 (uri (git-reference
89 (url "https://git.sr.ht/~martanne/vis")
90 (commit (string-append "v" version))))
91 (sha256
92 (base32 "1g05ncsnk57kcqm9wsv6sz8b24kyzj8r5rfpa1wfwj8qkjzx3vji"))
93 (file-name (git-file-name name version))))
94 (build-system gnu-build-system)
95 (arguments
96 `(#:test-target "test"
97 #:phases
98 (modify-phases %standard-phases
99 (add-after 'unpack 'unpack-test-suite
100 (lambda* (#:key inputs #:allow-other-keys)
101 (let ((vis-test (assoc-ref inputs "vis-test")))
102 (copy-recursively vis-test "test")
103 #t)))
104 (delete 'check) ; the tests need a wrapped vis
105 (add-after 'install 'wrap-binary
106 (lambda* (#:key inputs outputs #:allow-other-keys)
107 (let* ((out (assoc-ref outputs "out"))
108 (lpeg (assoc-ref inputs "lua-lpeg"))
109 (lua-version ,(version-major+minor (package-version lua)))
110 (LUA_PATH (string-append lpeg "/share/lua/"
111 lua-version "/?.lua"))
112 (LUA_CPATH (string-append lpeg "/lib/lua/"
113 lua-version "/?.so")))
114 (wrap-program (string-append out "/bin/vis")
115 `("LUA_PATH" ":" prefix (,LUA_PATH))
116 `("LUA_CPATH" ":" prefix (,LUA_CPATH)))
117 #t)))
118 (add-after 'wrap-binary 'check
119 (assoc-ref %standard-phases 'check))
120 (add-before 'check 'set-up-tests
121 (lambda* (#:key outputs #:allow-other-keys)
122 (let ((out (assoc-ref outputs "out")))
123 ;; DEFAULT_COMPILER is hard-coded here.
124 (substitute* "test/core/ccan-config.c"
125 (("\"cc\"")
126 (format #f "\"~a\"" ,(cc-for-target))))
127
128 ;; Use the ‘vis’ executable that we wrapped above.
129 (install-file (string-append out "/bin/vis") ".")
130
131 ;; XXX Delete 2 failing tests. TODO: make them not fail. :-)
132 (for-each delete-file
133 (find-files "test/vis/selections" "^complement"))
134 #t))))))
135 (native-inputs
136 `(("vis-test"
137 ,(origin
138 (method git-fetch)
139 (uri (git-reference
140 (url "https://git.sr.ht/~martanne/vis-test")
141 (commit "bbd2f34ff788e87a51a74069069273ad83c44f1f")))
142 (sha256
143 (base32 "1jsvg2lg3xqfgi79x08kx94mc34mh62ivca10vsci6fqsk68jbd0"))
144 (file-name (git-file-name "vis-test" version))))))
145 (inputs `(("lua" ,lua)
146 ("ncurses" ,ncurses)
147 ("libtermkey" ,libtermkey)
148 ("lua-lpeg" ,lua-lpeg)
149 ("tre" ,tre)))
150 (synopsis "Vim-like text editor")
151 (description
152 "Vis aims to be a modern, legacy free, simple yet efficient vim-like text
153 editor. It extends vim's modal editing with built-in support for multiple
154 cursors/selections and combines it with sam's structural regular expression
155 based command language.")
156 (home-page "https://github.com/martanne/vis")
157 (license (list license:isc ; Main distribution.
158 license:public-domain ; map.[ch]
159 license:expat)))) ; lexers and libutf.[ch]
160
161 (define-public kakoune
162 (package
163 (name "kakoune")
164 (version "2020.09.01")
165 (source
166 (origin
167 (method url-fetch)
168 (uri (string-append "https://github.com/mawww/kakoune/"
169 "releases/download/v" version "/"
170 "kakoune-" version ".tar.bz2"))
171 (sha256
172 (base32 "0x81rxy7bqnhd9374g5ypy4w4nxmm0vnqw6b52bf62jxdg2qj6l6"))))
173 (build-system gnu-build-system)
174 (arguments
175 `(#:make-flags
176 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
177 #:phases
178 (modify-phases %standard-phases
179 (add-after 'unpack 'patch-source
180 (lambda _
181 ;; kakoune uses confstr with _CS_PATH to find out where to find
182 ;; a posix shell, but this doesn't work in the build
183 ;; environment. This substitution just replaces that result
184 ;; with the "sh" path.
185 (substitute* "src/shell_manager.cc"
186 (("if \\(m_shell.empty\\(\\)\\)" line)
187 (string-append "m_shell = \"" (which "sh")
188 "\";\n " line)))
189 #t))
190 (delete 'configure) ; no configure script
191 ;; kakoune requires us to be in the src/ directory to build.
192 (add-before 'build 'chdir
193 (lambda _ (chdir "src") #t)))))
194 (native-inputs
195 `(("asciidoc" ,asciidoc)
196 ("pkg-config" ,pkg-config)
197 ("ruby" ,ruby)))
198 (inputs
199 `(("ncurses" ,ncurses)))
200 (synopsis "Vim-inspired code editor")
201 (description
202 "Kakoune is a code editor heavily inspired by Vim, as such most of its
203 commands are similar to Vi's ones, and it shares Vi's \"keystrokes as a text
204 editing language\" model. Kakoune has a strong focus on interactivity, most
205 commands provide immediate and incremental results, while still being
206 competitive (as in keystroke count) with Vim.")
207 (home-page "https://kakoune.org/")
208 (license license:unlicense)))
209
210 (define-public kak-lsp
211 (package
212 (name "kak-lsp")
213 (version "9.0.0")
214 (source
215 (origin
216 (method git-fetch)
217 (uri (git-reference
218 (url "https://github.com/kak-lsp/kak-lsp")
219 (commit (string-append "v" version))))
220 (file-name (git-file-name name version))
221 (sha256 "1wfv2fy5ga6kc51zka3pak0hq97csm2l11bz74w3n1hrf5q9nnf8")))
222 (build-system cargo-build-system)
223 (arguments
224 `(#:cargo-inputs
225 (("rust-crossbeam-channel" ,rust-crossbeam-channel-0.4)
226 ("rust-clap" ,rust-clap-2)
227 ("rust-daemonize" ,rust-daemonize-0.4)
228 ("rust-dirs" ,rust-dirs-2)
229 ("rust-enum_primitive" ,rust-enum-primitive-0.1)
230 ("rust-glob" ,rust-glob-0.3)
231 ("rust-itertools" ,rust-itertools-0.9)
232 ("rust-lsp-types" ,rust-lsp-types-0.80)
233 ("rust-jsonrpc-core" ,rust-jsonrpc-core-14)
234 ("rust-libc" ,rust-libc-0.2)
235 ("rust-rand" ,rust-rand-0.7)
236 ("rust-regex" ,rust-regex-1)
237 ("rust-ropey" ,rust-ropey-1)
238 ("rust-serde" ,rust-serde-1)
239 ("rust-serde_derive" ,rust-serde-derive-1)
240 ("rust-serde_json" ,rust-serde-json-1)
241 ("rust-slog" ,rust-slog-2)
242 ("rust-slog-scope" ,rust-slog-scope-4)
243 ("rust-sloggers" ,rust-sloggers-1)
244 ("rust-toml" ,rust-toml-0.5)
245 ("rust-url" ,rust-url-2)
246 ("rust-whoami" ,rust-whoami-0.8))))
247 (home-page "https://github.com/kak-lsp/kak-lsp")
248 (synopsis "Language Server Protocol (LSP) client for Kakoune")
249 (description
250 "kak-lsp is a Language Server Protocol client for Kakoune implemented in
251 Rust.")
252 (license license:unlicense)))
253
254 (define-public joe
255 (package
256 (name "joe")
257 (version "4.6")
258 (source
259 (origin
260 (method url-fetch)
261 (uri (string-append "https://sourceforge.net/projects/joe-editor/"
262 "files/JOE sources/joe-" version "/"
263 "joe-" version ".tar.gz"))
264 (sha256
265 (base32
266 "1pmr598xxxm9j9dl93kq4dv36zyw0q2dh6d7x07hf134y9hhlnj9"))))
267 (build-system gnu-build-system)
268 (inputs `(("ncurses" ,ncurses)))
269 (home-page "http://joe-editor.sourceforge.net/")
270 (synopsis "Console screen editor")
271 (description
272 "JOE is a powerful console screen editor with a \"mode-less\" user
273 interface similar to many user-friendly editors. JOE has some of the key
274 bindings and many of the powerful features of GNU Emacs.")
275 (license license:gpl3+)))
276
277 (define-public jucipp
278 (package
279 (name "jucipp")
280 (version "1.6.3")
281 (home-page "https://gitlab.com/cppit/jucipp")
282 (source (origin
283 (method git-fetch)
284 (uri (git-reference (url home-page)
285 (commit (string-append "v" version))
286 ;; Two submodules are required which are
287 ;; developed alongside JuCi++ and difficult
288 ;; to package separately.
289 (recursive? #t)))
290 (file-name (git-file-name name version))
291 (sha256
292 (base32 "1gy2xb5rm7q4zx9rl23h96b1i46fz27v25nklj50fvqp8ax2gxqy"))))
293 (build-system cmake-build-system)
294 (arguments
295 `(#:configure-flags '("-DBUILD_TESTING=ON"
296
297 ;; These arguments are here to facilitate an "in-source"
298 ;; build using "./build" instead of the default "../build".
299 ;; The test suite expects that to be the case.
300 "..")
301 #:out-of-source? #f
302 #:phases (modify-phases %standard-phases
303 (add-before 'configure 'enter-build-directory
304 (lambda _
305 (mkdir "build")
306 (chdir "build")
307 #t))
308
309 (add-after 'unpack 'patch-tiny-process-library
310 (lambda _
311 (with-directory-excursion "lib/tiny-process-library"
312 (substitute* '("process_unix.cpp"
313 "tests/io_test.cpp")
314 (("/bin/sh") (which "sh"))))
315 #t))
316 (add-after 'unpack 'disable-git-test
317 (lambda _
318 (substitute* "tests/CMakeLists.txt"
319 ;; Disable the git test, as it requires the full checkout.
320 (("add_test\\(git_test.*\\)") ""))
321 #t))
322 (add-before 'check 'pre-check
323 (lambda* (#:key inputs #:allow-other-keys)
324 ;; Tests do not expect HOME to be empty.
325 (setenv "HOME" "/etc")
326
327 ;; Most tests require an X server.
328 (let ((xorg-server (assoc-ref inputs "xorg-server"))
329 (display ":1"))
330 (setenv "DISPLAY" display)
331 (system (string-append xorg-server "/bin/Xvfb "
332 display " &")))
333 #t))
334 (add-after 'install 'wrap
335 (lambda* (#:key inputs outputs #:allow-other-keys)
336 ;; The package needs GTK+ and GtkSourceView on XDG_DATA_DIRS
337 ;; for syntax highlighting to work. shared-mime-info is
338 ;; necessary for MIME handling.
339 ;; XXX: Ideally we'd reuse glib-or-gtk-wrap here, but it
340 ;; does not pick up $gtksourceview/share/gtksourceview-3.0.
341 (let ((out (assoc-ref outputs "out"))
342 (gtk+ (assoc-ref inputs "gtk+"))
343 (gtksourceview (assoc-ref inputs "gtksourceview"))
344 (shared-mime-info (assoc-ref inputs "shared-mime-info")))
345 (wrap-program (string-append out "/bin/juci")
346 `("XDG_DATA_DIRS" ":" prefix
347 (,(string-join
348 (map (lambda (pkg)
349 (string-append pkg "/share"))
350 (list out gtk+ gtksourceview shared-mime-info))
351 ":"))))
352 #t))))))
353 (native-inputs
354 `(("pkg-config" ,pkg-config)
355 ("xorg-server" ,xorg-server-for-tests)))
356 (inputs
357 `(("aspell" ,aspell)
358 ("boost" ,boost)
359 ("ctags" ,universal-ctags)
360 ("gtkmm" ,gtkmm)
361 ("gtksourceviewmm" ,gtksourceviewmm)
362 ("libclang" ,clang-11) ;XXX: must be the same version as Mesas LLVM
363 ("libgit2" ,libgit2)))
364 (synopsis "Lightweight C++ IDE")
365 (description
366 "juCi++ is a small @acronym{IDE, Integrated Development Environment}
367 designed especially towards libclang with speed, stability, and ease of use
368 in mind.
369
370 It supports autocompletion, on-the-fly warnings and errors, syntax
371 highlighting, and integrates with Git as well as the CMake and Meson build
372 systems.")
373 (license license:expat)))
374
375 (define-public leafpad
376 (package
377 (name "leafpad")
378 (version "0.8.18.1")
379 (source (origin
380 (method url-fetch)
381 (uri (string-append "mirror://savannah/"
382 "leafpad/leafpad-" version ".tar.gz"))
383 (sha256
384 (base32
385 "0b0az2wvqgvam7w0ns1j8xp2llslm1rx6h7zcsy06a7j0yp257cm"))))
386 (build-system glib-or-gtk-build-system)
387 (native-inputs
388 `(("intltool" ,intltool)
389 ("pkg-config" ,pkg-config)))
390 (inputs
391 `(("gtk+" ,gtk+-2)))
392 (home-page "http://tarot.freeshell.org/leafpad/")
393 (synopsis "GTK+ based text editor")
394 (description "Leafpad is a GTK+ text editor that emphasizes simplicity. As
395 development focuses on keeping weight down to a minimum, only the most essential
396 features are implemented in the editor. Leafpad is simple to use, is easily
397 compiled, requires few libraries, and starts up quickly. ")
398 (license license:gpl2+)))
399
400 (define-public l3afpad
401 (let ((commit "5235c9e13bbf0d31a902c6776918c2d7cdbb61ff")
402 (revision "0"))
403 (package
404 (name "l3afpad")
405 (version (git-version "0.8.18.1.11" revision commit))
406 (source (origin
407 (method git-fetch)
408 (file-name (git-file-name name version))
409 (uri (git-reference
410 (url "https://github.com/stevenhoneyman/l3afpad")
411 (commit commit)))
412 (sha256
413 (base32
414 "1alyghm2wpakzdfag0g4g8gb1h9l4wdg7mnhq8bk0iq5ryqia16a"))))
415 (build-system glib-or-gtk-build-system)
416 (native-inputs
417 `(("intltool" ,intltool)
418 ("autoconf" ,autoconf)
419 ("automake" ,automake)
420 ("pkg-config" ,pkg-config)))
421 (inputs
422 `(("gtk+" ,gtk+)))
423 (home-page "http://tarot.freeshell.org/leafpad/")
424 (synopsis "GTK+ 3 based text editor")
425 (description "L3afpad is a GTK+ 3 text editor that emphasizes simplicity. As
426 development focuses on keeping weight down to a minimum, only the most essential
427 features are implemented in the editor. L3afpad is simple to use, is easily
428 compiled, requires few libraries, and starts up quickly. L3afpad is a
429 fork of Leafpad that uses GTK+ 3 instead of GTK+ 2.")
430 (license license:gpl2+))))
431
432 (define-public e3
433 (package
434 (name "e3")
435 (version "2.82")
436 (source (origin
437 (method url-fetch)
438 (uri (string-append "https://sites.google.com/site/e3editor/Home/"
439 "e3-" version ".tgz"))
440 (sha256
441 (base32
442 "0919kadkas020maqq37852isnzp053q2fnws2zh3mz81d1jiviak"))
443 (modules '((guix build utils)))
444
445 ;; Remove pre-built binaries.
446 (snippet '(begin
447 (delete-file-recursively "bin")
448 #t))))
449 (build-system gnu-build-system)
450 (arguments
451 `(#:tests? #f
452 #:make-flags (list (string-append "PREFIX="
453 (assoc-ref %outputs "out")))
454 #:phases (modify-phases %standard-phases
455 (delete 'configure))))
456 (native-inputs
457 `(("nasm" ,nasm)))
458 (home-page "https://sites.google.com/site/e3editor/")
459 (synopsis "Tiny text editor written in assembly")
460 (description
461 "e3 is a micro text editor with an executable code size between 3800 and
462 35000 bytes. Except for ``syntax highlighting'', the e3 binary supports all
463 of the basic functions one expects plus built in arithmetic calculations.
464 UTF-8 coding of unicode characters is supported as well. e3 can use
465 Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings. e3 can be used on
466 16, 32, and 64-bit CPUs.")
467 (supported-systems '("x86_64-linux" "i686-linux"))
468 (license license:gpl2+)))
469
470 (define-public mg
471 (package
472 (name "mg")
473 (version "20180927")
474 (source (origin
475 (method git-fetch)
476 (uri (git-reference
477 (url "https://github.com/hboetes/mg")
478 (commit version)))
479 (file-name (git-file-name name version))
480 (sha256
481 (base32
482 "14vrm8lvwksf697sqks7xfd1xaqjlqjc9afjk33sksq5p27wr203"))
483 (modules '((guix build utils)))
484 (snippet '(begin
485 (substitute* "GNUmakefile"
486 (("/usr/bin/") ""))
487 #t))))
488 (build-system gnu-build-system)
489 (native-inputs
490 `(("pkg-config" ,pkg-config)))
491 (inputs
492 `(("libbsd" ,libbsd)
493 ("ncurses" ,ncurses)))
494 (arguments
495 ;; No test suite available.
496 '(#:tests? #f
497 #:make-flags (list (string-append "prefix=" %output)
498 "CC=gcc")
499 #:phases (modify-phases %standard-phases
500 (delete 'configure) ; no configure script
501 (add-before 'build 'correct-location-of-difftool
502 (lambda _
503 (substitute* "buffer.c"
504 (("/usr/bin/diff")
505 (which "diff")))
506 #t))
507 (add-before 'install 'patch-tutorial-location
508 (lambda* (#:key outputs #:allow-other-keys)
509 (substitute* "mg.1"
510 (("/usr") (assoc-ref outputs "out")))
511 #t))
512 (add-after 'install 'install-tutorial
513 (lambda* (#:key outputs #:allow-other-keys)
514 (let* ((out (assoc-ref outputs "out"))
515 (doc (string-append out "/share/doc/mg")))
516 (install-file "tutorial" doc)
517 #t))))))
518 (home-page "https://homepage.boetes.org/software/mg/")
519 (synopsis "Microscopic GNU Emacs clone")
520 (description
521 "Mg (@command{mg}) is a GNU Emacs style editor, with which it is
522 \"broadly\" compatible. This is a portable version of the mg maintained by the
523 OpenBSD team.")
524 (license license:public-domain)))
525
526 (define-public qemacs
527 (package
528 (name "qemacs")
529 (version "0.3.3")
530 (source
531 (origin
532 (method url-fetch)
533 (uri (string-append "https://bellard.org/qemacs/"
534 "qemacs-" version ".tar.gz"))
535 (sha256
536 (base32 "156z4wpj49i6j388yjird5qvrph7hz0grb4r44l4jf3q8imadyrg"))))
537 (build-system gnu-build-system)
538 (arguments
539 `(#:tests? #f ;no test
540 #:phases
541 (modify-phases %standard-phases
542 (add-before 'build 'build-qhtml
543 ;; Build fails without first creating qHTML library.
544 (lambda _ (invoke "make" "-C" "libqhtml")))
545 (add-before 'install 'fix-man-pages-directory
546 ;; Install in $out/share/man instead of $out/man.
547 (lambda _
548 (substitute* "Makefile"
549 (("/man/man1" all) (string-append "/share" all)))
550 #t))
551 (add-before 'install 'create-directories
552 ;; Ensure directories exist before installing files.
553 (lambda* (#:key outputs #:allow-other-keys)
554 (let ((out (assoc-ref outputs "out")))
555 (for-each (lambda (d) (mkdir-p (string-append out d)))
556 '("/bin" "/share/man/man1" "/share/qe"))
557 #t)))
558 (add-after 'install 'install-extra-documentation
559 ;; Install sample configuration file, Info, and HTML manual.
560 (lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
561 (let* ((share (string-append (assoc-ref outputs "out") "/share"))
562 (doc (string-append share "/doc/" ,name "-" ,version))
563 (html (string-append share "/html"))
564 (info (string-append share "/info"))
565 (makeinfo (string-append
566 (assoc-ref (or native-inputs inputs) "texinfo")
567 "/bin/makeinfo")))
568 ;; First fix Texinfo documentation, create appropriate
569 ;; directories, then generate Info and HTML files there.
570 (substitute* "qe-doc.texi"
571 (("^M-([{}])" _ bracket) (string-append "M-@" bracket)))
572 (for-each (lambda (d) (mkdir-p d)) (list html info))
573 (invoke makeinfo "qe-doc.texi" "-o" info)
574 (invoke makeinfo "qe-doc.texi" "--html" "--no-split" "-o" html)
575 ;; Install sample configuration file.
576 (install-file "config.eg" doc)
577 #t))))))
578 (native-inputs
579 `(("texinfo" ,texinfo)))
580 (inputs
581 `(("libx11" ,libx11)
582 ("libxext" ,libxext)
583 ("libxv" ,libxv)))
584 (home-page "https://bellard.org/qemacs/")
585 (synopsis "Small but powerful text editor")
586 (description "QEmacs (for Quick Emacs) is a very small but
587 powerful editor. It has features that even big editors lack:
588
589 @itemize
590
591 @item Full screen editor with an Emacs look and feel with all Emacs
592 common features: multi-buffer, multi-window, command mode, universal
593 argument, keyboard macros, config file with C-like syntax, minibuffer
594 with completion and history.
595
596 @item Can edit files of hundreds of Megabytes without being slow by
597 using a highly optimized internal representation and by mmaping the
598 file.
599
600 @item Full Unicode support, including multi charset handling (8859-x,
601 UTF8, SJIS, EUC-JP, ...) and bidirectional editing respecting the
602 Unicode bidi algorithm. Arabic and Indic scripts handling (in
603 progress).
604
605 @item WYSIWYG HTML/XML/CSS2 mode graphical editing. Also supports
606 Lynx like rendering on VT100 terminals.
607
608 @item WYSIWYG DocBook mode based on XML/CSS2 renderer.
609
610 @item C mode: coloring with immediate update. Emacs like auto-indent.
611
612 @item Shell mode: colorized VT100 emulation so that your shell work
613 exactly as you expect. Compile mode with next/prev error.
614
615 @item Input methods for most languages, including Chinese (input
616 methods come from the Yudit editor).
617
618 @item Hexadecimal editing mode with insertion and block commands.
619 Unicode hexa editing is also supported.
620
621 @item Works on any VT100 terminals without termcap. UTF8 VT100
622 support included with double width glyphs.
623
624 @item X11 support. Support multiple proportional fonts at the same
625 time (as XEmacs). X Input methods supported. Xft extension supported
626 for anti aliased font display.
627
628 @item Small! Full version (including HTML/XML/CSS2/DocBook rendering
629 and all charsets): 200KB big. Basic version (without bidir/unicode
630 scripts/input/X11/C/Shell/HTML/Dired): 49KB.
631 @end itemize")
632 (license license:lgpl2.1+)))
633
634 (define-public ghostwriter
635 (package
636 (name "ghostwriter")
637 (version "2.0.2")
638 (source (origin
639 (method git-fetch)
640 (uri (git-reference
641 (url "https://github.com/wereturtle/ghostwriter")
642 (commit version)))
643 (file-name (git-file-name name version))
644 (sha256
645 (base32
646 "19cf55b86yj2b5hdazbyw4iyp6xq155243aiyg4m0vhwh0h79nwh"))))
647 (build-system gnu-build-system)
648 (native-inputs
649 `(("pkg-config" ,pkg-config)
650 ("qttools" ,qttools))) ; for lrelease
651 (inputs
652 `(("hunspell" ,hunspell)
653 ("qtbase" ,qtbase-5)
654 ("qtdeclarative" ,qtdeclarative)
655 ("qtmultimedia" ,qtmultimedia)
656 ("qtquickcontrols" ,qtquickcontrols)
657 ("qtsvg" ,qtsvg)
658 ("qtwebchannel" ,qtwebchannel)))
659 (propagated-inputs ; To get native-search-path
660 `(("qtwebengine" ,qtwebengine)))
661 (arguments
662 `(#:phases
663 (modify-phases %standard-phases
664 (replace 'configure
665 (lambda* (#:key outputs #:allow-other-keys)
666 (let ((out (assoc-ref outputs "out")))
667 (invoke "qmake" (string-append "PREFIX=" out)))))
668 (add-after 'configure 'create-translations
669 (lambda _
670 ;; `lrelease` will not overwrite, so delete existing .qm files
671 (for-each delete-file (find-files "translations" ".*\\.qm"))
672 (apply invoke "lrelease" (find-files "translations" ".*\\.ts"))))
673 ;; Ensure that icons are found at runtime.
674 (add-after 'install 'wrap-executable
675 (lambda* (#:key inputs outputs #:allow-other-keys)
676 (let ((out (assoc-ref outputs "out")))
677 (wrap-program (string-append out "/bin/ghostwriter")
678 `("QT_PLUGIN_PATH" ":" prefix
679 ,(map (lambda (label)
680 (string-append (assoc-ref inputs label)
681 "/lib/qt5/plugins/"))
682 '("qtsvg" "qtmultimedia"))))))))))
683 (home-page "https://wereturtle.github.io/ghostwriter/")
684 (synopsis "Write without distractions")
685 (description
686 "@code{ghostwriter} provides a relaxing, distraction-free writing
687 environment with Markdown markup.")
688 (license license:gpl3+))) ; icons/* under CC-BY-SA3
689
690 (define-public manuskript
691 (package
692 (name "manuskript")
693 (version "0.12.0")
694 (source
695 (origin
696 (method git-fetch)
697 (uri (git-reference
698 (url "https://github.com/olivierkes/manuskript")
699 (commit version)))
700 (file-name (git-file-name name version))
701 (sha256
702 (base32 "0gfwwnpjslb0g8y3v9ha4sd8in6bpy6bhi4rn4hmfd2vmq2flpbd"))))
703 (build-system python-build-system)
704 (arguments
705 `(#:tests? #f ;no test
706 #:phases
707 (modify-phases %standard-phases
708 (delete 'configure)
709 (delete 'build)
710 (replace 'install
711 (lambda* (#:key outputs #:allow-other-keys)
712 (let* ((out (assoc-ref outputs "out"))
713 (share (string-append out "/share/manuskript")))
714 ;; Install data.
715 (mkdir-p share)
716 (for-each
717 (lambda (d)
718 (let ((destination (string-append share "/" d)))
719 (mkdir-p destination)
720 (copy-recursively d destination)))
721 '("bin" "i18n" "icons" "libs" "manuskript" "resources"))
722 ;; Install documentation.
723 (let ((doc (string-append out
724 "/doc/manuskript-" ,version
725 "/sample-projects")))
726 (mkdir-p doc)
727 (copy-recursively "sample-projects" doc))
728 ;; Wrap executable in "$out/share/manuskript/bin" and
729 ;; link to it from "$out/bin".
730 (let ((bin (string-append out "/bin"))
731 (executable (string-append share "/bin/manuskript")))
732 (wrap-program executable
733 (list "PYTHONPATH" 'prefix (list (getenv "PYTHONPATH"))))
734 (mkdir-p bin)
735 (with-directory-excursion bin
736 (symlink (string-append share "/bin/manuskript")
737 "manuskript")))
738 ;; Install icons and create .desktop file.
739 (let ((apps (string-append out "/share/applications"))
740 (icons-dir (string-append out "/share/pixmaps")))
741 (install-file "icons/Manuskript/manuskript.svg" icons-dir)
742 (mkdir-p apps)
743 (make-desktop-entry-file (string-append apps "/manuskript.desktop")
744 #:name "Manuskript"
745 #:mime-type "application/x-manuskript-book;"
746 #:exec (string-append out "/bin/manuskript %f")
747 #:comment '((#f "Tool for writers")
748 ("es" "Herramienta para escritores/as"))
749 #:keywords "manuskript;office;write;edit;novel;text;msk"
750 #:terminal #f
751 #:type "Application"
752 #:icon "manuskript"
753 #:categories "Office;WordProcessor;"))
754 #t))))))
755 (inputs
756 `(("pandoc" ,pandoc)
757 ("python-lxml" ,python-lxml)
758 ("python-markdown" ,python-markdown)
759 ("python-pyqt" ,python-pyqt)
760 ("qtsvg" ,qtsvg)))
761 (home-page "http://www.theologeek.ch/manuskript/")
762 (synopsis "Tool for writers")
763 (description "Manuskript provides a rich environment to help
764 writers create their first draft and then further refine and edit
765 their masterpiece. With Manuskript you can:
766
767 @itemize
768 @item Grow your premise from one sentence, to a paragraph, to a full
769 summary,
770 @item Create characters,
771 @item Conceive plots,
772 @item Construct outlines (Outline mode and/or Index cards),
773 @item Write with focus (Distraction free mode),
774 @item Build worlds,
775 @item Track items,
776 @item Edit and re-organize chapters and scenes,
777 @item View Story line,
778 @item Compose with fiction or non-fiction templates and writing modes,
779 @item Import and export document formats such as HTML, ePub,
780 OpenDocument, DocX, and more.
781 @end itemize
782
783 Additionally Manuskript can help in many more ways with a spell
784 checker, markdown highlighter, frequency analyzer, and automatic save
785 in plain text file format.")
786 (license license:gpl3+)))
787
788 (define-public editorconfig-core-c
789 (package
790 (name "editorconfig-core-c")
791 (version "0.12.5")
792 (source
793 (origin
794 (method git-fetch)
795 (uri (git-reference
796 (url "https://github.com/editorconfig/editorconfig-core-c")
797 (commit (string-append "v" version))))
798 (file-name (git-file-name name version))
799 (sha256
800 (base32 "073sh18y0v8wm10iphaia54pkdmwylalccpn1k5i9dwyfjzgj7yg"))))
801 (build-system cmake-build-system)
802 (arguments
803 '(#:phases
804 (modify-phases %standard-phases
805 (add-after 'unpack 'insert-tests
806 (lambda* (#:key inputs #:allow-other-keys)
807 (let ((tests (assoc-ref inputs "tests")))
808 (copy-recursively tests "tests"))
809 #t))
810 (add-after 'install 'delete-static-library
811 (lambda* (#:key outputs #:allow-other-keys)
812 (let* ((out (assoc-ref outputs "out"))
813 (lib (string-append out "/lib")))
814 (with-directory-excursion lib
815 (delete-file "libeditorconfig_static.a"))
816 #t))))))
817 (native-inputs
818 `(("tests"
819 ,(origin
820 (method git-fetch)
821 (uri (git-reference
822 (url "https://github.com/editorconfig/editorconfig-core-test")
823 ;; The tests submodule commit matching this package's version.
824 (commit "48610d43b7455af12195473377f93c4ceea654f5")))
825 (file-name (git-file-name "editorconfig-core-test" version))
826 (sha256
827 (base32 "1s29p4brmcsc3xsww3gk85dg45f1kk3iykh1air3ij0hymf5dyqy"))))))
828 (inputs
829 `(("pcre2" ,pcre2)))
830 (home-page "https://editorconfig.org/")
831 (synopsis "EditorConfig core library written in C")
832 (description "EditorConfig makes it easy to maintain the correct coding
833 style when switching between different text editors and between different
834 projects. The EditorConfig project maintains a file format and plugins for
835 various text editors which allow this file format to be read and used by those
836 editors.")
837 (license license:bsd-2)))
838
839 (define-public texmacs
840 (package
841 (name "texmacs")
842 (version "2.1")
843 (source
844 (origin
845 (method url-fetch)
846 (uri (string-append "https://www.texmacs.org/Download/ftp/tmftp/"
847 "source/TeXmacs-" version "-src.tar.gz"))
848 (sha256
849 (base32 "1gl6k1bwrk1y7hjyl4xvlqvmk5crl4jvsk8wrfp7ynbdin6n2i48"))))
850 (build-system gnu-build-system)
851 (native-inputs
852 `(("pkg-config" ,pkg-config)
853 ("xdg-utils" ,xdg-utils))) ;for xdg-icon-resource
854 (inputs
855 `(("freetype" ,freetype)
856 ("guile" ,guile-1.8)
857 ("perl" ,perl)
858 ("python" ,python-wrapper)
859 ("qt" ,qtbase-5)
860 ("qtsvg" ,qtsvg)))
861 (arguments
862 `(#:tests? #f ; no check target
863 #:phases
864 (modify-phases %standard-phases
865 (add-after 'unpack 'fix-icon-directory
866 (lambda* (#:key outputs #:allow-other-keys)
867 (let ((out (assoc-ref outputs "out")))
868 (substitute* "packages/linux/icons.sh"
869 (("/usr/share")
870 (string-append out "/share"))))))
871 (add-after 'install 'install-desktop-file
872 (lambda* (#:key outputs #:allow-other-keys)
873 ;; Install desktop file.
874 (let* ((out (assoc-ref outputs "out"))
875 (apps (string-append out "/share/applications"))
876 (source "TeXmacs/misc/mime/texmacs.desktop"))
877 (install-file source apps))))
878 (add-before 'configure 'gzip-flags
879 (lambda _
880 (substitute* "Makefile.in"
881 (("^GZIP = gzip -f") "GZIP = gzip -f -n")))))))
882 (synopsis "Editing platform with special features for scientists")
883 (description
884 "GNU TeXmacs is a text editing platform which is specialized for
885 scientists. It is ideal for editing structured documents with different types
886 of content. It has robust support for mathematical formulas and plots. It
887 can also act as an interface to external mathematical programs such as R and
888 Octave. TeXmacs is completely extensible via Guile.")
889 (license license:gpl3+)
890 (home-page "https://www.texmacs.org/tmweb/home/welcome.en.html")))
891
892 (define-public scintilla
893 (package
894 (name "scintilla")
895 (version "5.1.0")
896 (source
897 (origin
898 (method url-fetch)
899 (uri (let ((v (apply string-append (string-split version #\.))))
900 (string-append "https://www.scintilla.org/scintilla" v ".tgz")))
901 (sha256
902 (base32 "0figd543inpi00yr6han73qd2fzx99r099vzcbg9mhpzsgxfwz4f"))))
903 (build-system gnu-build-system)
904 (arguments
905 `(#:make-flags (list "GTK3=1" "CC=gcc" "-Cgtk")
906 #:tests? #f ;require un-packaged Pyside
907 #:phases
908 (modify-phases %standard-phases
909 (delete 'configure) ;no configure script
910 (replace 'install
911 ;; Upstream provides no install script.
912 (lambda* (#:key outputs #:allow-other-keys)
913 (let* ((out (assoc-ref outputs "out"))
914 (lib (string-append out "/lib"))
915 (include (string-append out "/include")))
916 (for-each (lambda (f) (install-file f lib))
917 (find-files "bin/" "\\.so$"))
918 (for-each (lambda (f) (install-file f include))
919 (find-files "include/" "."))))))))
920 (native-inputs
921 `(("gcc" ,gcc-9) ;Code has C++17 requirements
922 ("pkg-config" ,pkg-config)
923 ("python" ,python-wrapper)))
924 (inputs
925 `(("gtk+" ,gtk+)))
926 (home-page "https://www.scintilla.org/")
927 (synopsis "Code editor for GTK+")
928 (description "Scintilla is a source code editing component for
929 GTK+. It has the usual features found in text editing components, as
930 well as some that are especially useful for editing and debugging
931 source code; these include support for syntax styling, error
932 indicators, code completion and call tips. Styling choices are more
933 open than with many editors: Scintilla lets you use proportional
934 fonts, bold and italics, multiple foreground and background colours,
935 and multiple fonts.")
936 (license license:hpnd)))
937
938 (define-public geany
939 (package
940 (name "geany")
941 (version "1.37.1")
942 (source
943 (origin
944 (method url-fetch)
945 (uri (string-append "https://download.geany.org/"
946 "geany-" version ".tar.bz2"))
947 (sha256
948 (base32 "060sachn33xpx3a609f09y97qq5ky17gvv686zbvrn618ij7bi8q"))))
949 (build-system gnu-build-system)
950 (native-inputs
951 `(("autoconf" ,autoconf)
952 ("automake" ,automake)
953 ("doxygen" ,doxygen)
954 ("glib" ,glib "bin")
955 ("intltool" ,intltool)
956 ("libtool" ,libtool)
957 ("pkg-config" ,pkg-config)
958 ("python-docutils" ,python-docutils))) ;for rst2html
959 (inputs
960 `(("gtk+" ,gtk+)
961 ;; FIXME: Geany bundles a 3.X release of Scintilla. It is not
962 ;; currently possible to replace it with our Scintilla package.
963 ;; ("scintilla" ,scintilla)
964 ))
965 (arguments
966 `(#:imported-modules ((guix build glib-or-gtk-build-system)
967 ,@%gnu-build-system-modules)
968 #:modules (((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
969 (guix build gnu-build-system)
970 (guix build utils))
971 #:phases
972 (modify-phases %standard-phases
973 (add-after 'install 'glib-or-gtk-wrap
974 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
975 (home-page "https://www.geany.org")
976 (synopsis "Fast and lightweight IDE")
977 (description "Geany is a small and fast Integrated Development
978 Environment (IDE) that only has a few dependencies on other packages and is as
979 independent as possible from special desktop environments like KDE or GNOME.
980
981 The basic features of Geany are:
982 @itemize
983 @item syntax highlighting
984 @item code completion
985 @item auto completion of often constructed constructs like if, for and while
986 @item auto completion of XML and HTML tags
987 @item call tips
988 @item folding
989 @item many supported filetypes like C, Java, PHP, HTML, Python, Perl, Pascal
990 @item symbol lists
991 @item embedded terminal emulation
992 @item extensibility through plugins
993 @end itemize")
994 (license license:gpl2+)))
995
996 (define-public fe
997 (package
998 (name "fe")
999 ;; Stable release is 1.9. However, this development version
1000 ;; introduces support for UTF-8.
1001 (version "2.0")
1002 (source (origin
1003 (method url-fetch)
1004 (uri (string-append "http://www.moria.de/~michael/fe/"
1005 "fe-" version ".tar.gz"))
1006 (sha256
1007 (base32
1008 "10mk5wc3dsdp46b3hkjyd740gcdv6m1gvlr3p8xjxf55b3vfs0la"))))
1009 (build-system gnu-build-system)
1010 (arguments
1011 `(#:tests? #f ;no test
1012 ;; Sendmail is only used to send a crash log. Disable the
1013 ;; feature since it is (1) undocumented (2) not very useful.
1014 #:configure-flags (list "--disable-sendmail")
1015 #:phases
1016 (modify-phases %standard-phases
1017 (add-after 'install 'install-doc
1018 (lambda* (#:key outputs #:allow-other-keys)
1019 (let* ((out (assoc-ref outputs "out"))
1020 (doc (string-append out "/share/doc/" ,name "-" ,version)))
1021 (for-each (lambda (f) (install-file f doc))
1022 '("fe.doc" "fe.html" "fe.ps" "feref.ps" "README"))
1023 #t))))))
1024 (native-inputs
1025 `(("gettext" ,gettext-minimal)))
1026 (inputs
1027 `(("ncurses" ,ncurses)))
1028 (home-page "http://www.moria.de/~michael/fe/")
1029 (synopsis "Small folding editor")
1030 (description "Fe is a small folding editor. It folds
1031 arbitrary text regions; it is not bound to syntactic units.
1032
1033 Fe has no configuration or extension language and requires no setup.
1034 Its user interface is emacs-like and it has menus for the very most
1035 important functions to help beginners. Further there is a reference
1036 card. It offers:
1037
1038 @itemize
1039 @item Regions and Emacs-like kill ring
1040 @item Incremental search
1041 @item Keyboard macros
1042 @item Editing binary files
1043 @item Multiple windows and views
1044 @item Compose function for Latin 1 characters
1045 @end itemize")
1046 (license license:gpl2+)))
1047
1048 (define-public ne
1049 (package
1050 (name "ne")
1051 (version "3.3.0")
1052 (source (origin
1053 (method git-fetch)
1054 (uri (git-reference
1055 (url "https://github.com/vigna/ne")
1056 (commit version)))
1057 (file-name (git-file-name name version))
1058 (sha256
1059 (base32
1060 "01aglnsfljlvx0wvyvpjfn4y88jf450a06qnj9a8lgdqv1hdkq1a"))))
1061 (build-system gnu-build-system)
1062 (native-inputs
1063 `(("perl" ,perl)
1064 ("texinfo" ,texinfo)))
1065 (inputs
1066 `(("ncurses" ,ncurses)))
1067 (arguments
1068 `(#:tests? #f
1069 #:make-flags
1070 (list "CC=gcc"
1071 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1072 (string-append "LDFLAGS=-L" (assoc-ref %build-inputs "ncurses")
1073 "/lib"))
1074 #:phases
1075 (modify-phases %standard-phases
1076 (replace 'configure
1077 (lambda _
1078 (substitute* "src/makefile"
1079 (("-lcurses") "-lncurses"))
1080 #t)))))
1081 (home-page "https://ne.di.unimi.it/")
1082 (synopsis "Text editor with menu bar")
1083 (description "This package provides a modeless text editor with menu bar.
1084 It supports syntax highlighting, regular expressions, configurable menus,
1085 keybindings, autocomplete and unlimited undo. It can pipe a marked block
1086 of text through any command line filter. It can also open very large binary
1087 files. It was originally developed on the Amiga 3000T.")
1088 (license license:gpl3+)))
1089
1090 (define-public hexer
1091 (package
1092 (name "hexer")
1093 (version "1.0.6")
1094 (source
1095 (origin
1096 (method url-fetch)
1097 (uri (string-append "https://devel.ringlet.net/files/editors/hexer/"
1098 "hexer-" version ".tar.xz"))
1099 (sha256
1100 (base32 "157z17z8qivdin2km2wp86x1bv1nx15frrwcz11mk0l3ab74mf76"))))
1101 (build-system gnu-build-system)
1102 (arguments
1103 `(#:tests? #f ;no upstream tests
1104 #:make-flags
1105 (list "CC=gcc"
1106 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1107 (string-append "LTERMCAP=-lncurses")
1108 (string-append "LDFLAGS=-L" (assoc-ref %build-inputs "ncurses")
1109 "/lib"))
1110 #:phases
1111 (modify-phases %standard-phases
1112 (delete 'configure)))) ;no configure script
1113 (inputs
1114 `(("ncurses" ,ncurses)))
1115 (home-page "https://devel.ringlet.net/editors/hexer/")
1116 (synopsis "Multi buffer editor for binary files with vi-like interface")
1117 (description "Hexer is a multi-buffer editor for binary files for Unix-like
1118 systems that displays its buffer(s) as a hex dump. The user interface is kept
1119 similar to vi/ex.")
1120 (license license:bsd-3)))
1121
1122 (define-public virtaal
1123 (package
1124 (name "virtaal")
1125 (version "0.7.1")
1126 (source (origin
1127 (method url-fetch)
1128 (uri (string-append "mirror://sourceforge/translate/Virtaal/"
1129 version "/virtaal-" version ".tar.bz2"))
1130 (sha256
1131 (base32
1132 "0cyimjp3191qlmw6n0ipqdr9xr0cq4f6dqvz4rl9q31h6l3kywf9"))))
1133 (build-system python-build-system)
1134 (arguments
1135 `(#:python ,python-2
1136 #:use-setuptools? #f
1137 #:tests? #f ;; Failing tests
1138 #:phases
1139 (modify-phases %standard-phases
1140 (add-before 'build 'configure
1141 (lambda* (#:key outputs #:allow-other-keys)
1142 ;; Set data file path to absolute store path.
1143 (substitute* "virtaal/common/pan_app.py"
1144 (("file_discovery\\.get_abs_data_filename.*")
1145 (string-append "os.path.join('"
1146 (assoc-ref outputs "out")
1147 "/share', *path_parts)"))))))))
1148 (inputs
1149 `(("python2-lxml" ,python2-lxml)
1150 ("python2-pygtk" ,python2-pygtk)
1151 ("python2-simplejson" ,python2-simplejson)
1152 ("python2-translate-toolkit" ,python2-translate-toolkit)
1153 ("python2-pycurl" ,python2-pycurl)))
1154 (synopsis "Graphical translation tool")
1155 (description "Virtaal is a powerful yet simple translation tool with an
1156 uncluttered user interface. It supports a multitude of translation formats
1157 provided by the Translate Toolkit, including XLIFF and PO.")
1158 (home-page "https://virtaal.translatehouse.org/")
1159 (license license:gpl2+)))