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