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 ng0 <ng0@n0.is>
7 ;;; Copyright © 2014 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.org>
8 ;;; Copyright © 2017, 2018, 2019, 2020 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 Nicolas Goaziou <mail@nicolasgoaziou.fr>
13 ;;; This file is part of GNU Guix.
15 ;;; GNU Guix is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; GNU Guix is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
28 (define-module (gnu packages text-editors)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix git-download)
32 #:use-module (guix utils)
33 #:use-module (guix build-system gnu)
34 #:use-module (guix build-system cmake)
35 #:use-module (guix build-system glib-or-gtk)
36 #:use-module ((guix licenses) #:prefix license:)
37 #:use-module (gnu packages)
38 #:use-module (gnu packages assembly)
39 #:use-module (gnu packages autotools)
40 #:use-module (gnu packages boost)
41 #:use-module (gnu packages documentation)
42 #:use-module (gnu packages fontutils)
43 #:use-module (gnu packages gcc)
44 #:use-module (gnu packages gettext)
45 #:use-module (gnu packages glib)
46 #:use-module (gnu packages gtk)
47 #:use-module (gnu packages guile)
48 #:use-module (gnu packages libbsd)
49 #:use-module (gnu packages libreoffice)
50 #:use-module (gnu packages lua)
51 #:use-module (gnu packages ncurses)
52 #:use-module (gnu packages pcre)
53 #:use-module (gnu packages perl)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages python)
56 #:use-module (gnu packages python-xyz)
57 #:use-module (gnu packages qt)
58 #:use-module (gnu packages regex)
59 #:use-module (gnu packages ruby)
60 #:use-module (gnu packages terminals)
61 #:use-module (gnu packages xml))
69 (uri (string-append "https://github.com/martanne/vis/releases"
71 "/vis-v" version ".tar.gz"))
74 "0aw35n8xk7ir84ckvczc6yshj9ynishrlz0qlv4yc1afbra1gxmn"))))
75 (build-system gnu-build-system)
77 `(#:test-target "test"
78 #:tests? #f ; no releases; snapshots are missing tests
80 (modify-phases %standard-phases
81 (add-after 'install 'wrap-binary
82 (lambda* (#:key inputs outputs #:allow-other-keys)
83 (let* ((out (assoc-ref outputs "out"))
84 (lpeg (assoc-ref inputs "lua-lpeg"))
85 (lua-version ,(version-major+minor (package-version lua)))
86 (LUA_PATH (string-append lpeg "/share/lua/"
87 lua-version "/?.lua"))
88 (LUA_CPATH (string-append lpeg "/lib/lua/"
89 lua-version "/?.so")))
90 (wrap-program (string-append out "/bin/vis")
91 `("LUA_PATH" ":" prefix (,LUA_PATH))
92 `("LUA_CPATH" ":" prefix (,LUA_CPATH)))
95 (list (search-path-specification
97 (files '("share/vis")))))
98 (inputs `(("lua" ,lua)
100 ("libtermkey" ,libtermkey)
101 ("lua-lpeg" ,lua-lpeg)
103 (synopsis "Vim-like text editor")
105 "Vis aims to be a modern, legacy free, simple yet efficient vim-like text
106 editor. It extends vim's modal editing with built-in support for multiple
107 cursors/selections and combines it with sam's structural regular expression
108 based command language.")
109 (home-page "https://github.com/martanne/vis")
110 (license (list license:isc ; Main distribution.
111 license:public-domain ; map.[ch]
112 license:expat)))) ; lexers and libutf.[ch]
114 (define-public kakoune
117 (version "2019.12.10")
121 (uri (string-append "https://github.com/mawww/kakoune/"
122 "releases/download/v" version "/"
123 "kakoune-" version ".tar.bz2"))
125 (base32 "1y1gzax2dl7flh676k0rl1vacv10j7p5krkmb67b0afbrql8vbb6"))))
126 (build-system gnu-build-system)
129 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
131 (modify-phases %standard-phases
132 (add-after 'unpack 'patch-source
134 ;; kakoune uses confstr with _CS_PATH to find out where to find
135 ;; a posix shell, but this doesn't work in the build
136 ;; environment. This substitution just replaces that result
137 ;; with the "sh" path.
138 (substitute* "src/shell_manager.cc"
139 (("if \\(m_shell.empty\\(\\)\\)" line)
140 (string-append "m_shell = \"" (which "sh")
143 (delete 'configure) ; no configure script
144 ;; kakoune requires us to be in the src/ directory to build
145 (add-before 'build 'chdir
146 (lambda _ (chdir "src") #t)))))
148 `(("asciidoc" ,asciidoc)
149 ("pkg-config" ,pkg-config)
152 `(("ncurses" ,ncurses)))
153 (synopsis "Vim-inspired code editor")
155 "Kakoune is a code editor heavily inspired by Vim, as such most of its
156 commands are similar to Vi's ones, and it shares Vi's \"keystrokes as a text
157 editing language\" model. Kakoune has a strong focus on interactivity, most
158 commands provide immediate and incremental results, while still being
159 competitive (as in keystroke count) with Vim.")
160 (home-page "https://kakoune.org/")
161 (license license:unlicense)))
170 (uri (string-append "https://sourceforge.net/projects/joe-editor/"
171 "files/JOE sources/joe-" version "/"
172 "joe-" version ".tar.gz"))
175 "1pmr598xxxm9j9dl93kq4dv36zyw0q2dh6d7x07hf134y9hhlnj9"))))
176 (build-system gnu-build-system)
177 (inputs `(("ncurses" ,ncurses)))
178 (home-page "http://joe-editor.sourceforge.net/")
179 (synopsis "Console screen editor")
181 "JOE is a powerful console screen editor with a \"mode-less\" user
182 interface similar to many user-friendly editors. JOE has some of the key
183 bindings and many of the powerful features of GNU Emacs.")
184 (license license:gpl3+)))
186 (define-public leafpad
192 (uri (string-append "mirror://savannah/"
193 "leafpad/leafpad-" version ".tar.gz"))
196 "0b0az2wvqgvam7w0ns1j8xp2llslm1rx6h7zcsy06a7j0yp257cm"))))
197 (build-system glib-or-gtk-build-system)
199 `(("intltool" ,intltool)
200 ("pkg-config" ,pkg-config)))
203 (home-page "http://tarot.freeshell.org/leafpad/")
204 (synopsis "GTK+ based text editor")
205 (description "Leafpad is a GTK+ text editor that emphasizes simplicity. As
206 development focuses on keeping weight down to a minimum, only the most essential
207 features are implemented in the editor. Leafpad is simple to use, is easily
208 compiled, requires few libraries, and starts up quickly. ")
209 (license license:gpl2+)))
217 (uri (string-append "https://sites.google.com/site/e3editor/Home/"
218 "e3-" version ".tgz"))
221 "0919kadkas020maqq37852isnzp053q2fnws2zh3mz81d1jiviak"))
222 (modules '((guix build utils)))
224 ;; Remove pre-built binaries.
226 (delete-file-recursively "bin")
228 (build-system gnu-build-system)
231 #:make-flags (list (string-append "PREFIX="
232 (assoc-ref %outputs "out")))
233 #:phases (modify-phases %standard-phases
234 (delete 'configure))))
237 (home-page "https://sites.google.com/site/e3editor/")
238 (synopsis "Tiny text editor written in assembly")
240 "e3 is a micro text editor with an executable code size between 3800 and
241 35000 bytes. Except for ``syntax highlighting'', the e3 binary supports all
242 of the basic functions one expects plus built in arithmetic calculations.
243 UTF-8 coding of unicode characters is supported as well. e3 can use
244 Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings. e3 can be used on
245 16, 32, and 64-bit CPUs.")
246 (supported-systems '("x86_64-linux" "i686-linux"))
247 (license license:gpl2+)))
256 (url "https://github.com/hboetes/mg")
258 (file-name (git-file-name name version))
261 "14vrm8lvwksf697sqks7xfd1xaqjlqjc9afjk33sksq5p27wr203"))
262 (modules '((guix build utils)))
264 (substitute* "GNUmakefile"
267 (build-system gnu-build-system)
269 `(("pkg-config" ,pkg-config)))
272 ("ncurses" ,ncurses)))
274 ;; No test suite available.
276 #:make-flags (list (string-append "prefix=" %output)
278 #:phases (modify-phases %standard-phases
279 (delete 'configure) ; no configure script
280 (add-before 'build 'correct-location-of-difftool
282 (substitute* "buffer.c"
286 (add-before 'install 'patch-tutorial-location
287 (lambda* (#:key outputs #:allow-other-keys)
289 (("/usr") (assoc-ref outputs "out")))
291 (add-after 'install 'install-tutorial
292 (lambda* (#:key outputs #:allow-other-keys)
293 (let* ((out (assoc-ref outputs "out"))
294 (doc (string-append out "/share/doc/mg")))
295 (install-file "tutorial" doc)
297 (home-page "https://homepage.boetes.org/software/mg/")
298 (synopsis "Microscopic GNU Emacs clone")
300 "Mg (mg) is a GNU Emacs style editor, with which it is \"broadly\"
301 compatible. This is a portable version of the mg maintained by the OpenBSD
303 (license license:public-domain)))
305 (define-public ghostwriter
312 (url "https://github.com/wereturtle/ghostwriter.git")
313 (commit (string-append "v" version))))
314 (file-name (git-file-name name version))
317 "1pqlr08z5syqcq5p282asxwzrrm7c1w94baxyb467swh8yp3fj5m"))))
318 (build-system gnu-build-system)
320 `(("pkg-config" ,pkg-config)
321 ("qttools" ,qttools))) ; for lrelease
323 `(("hunspell" ,hunspell)
325 ("qtmultimedia" ,qtmultimedia)
327 ("qtwebkit" ,qtwebkit)))
330 (modify-phases %standard-phases
332 (lambda* (#:key outputs #:allow-other-keys)
333 (let ((out (assoc-ref outputs "out")))
334 (invoke "qmake" (string-append "PREFIX=" out)))))
335 (add-after 'configure 'create-translations
337 ;; `lrelease` will not overwrite, so delete existing .qm files
338 (for-each delete-file (find-files "translations" ".*\\.qm"))
339 (apply invoke "lrelease" (find-files "translations" ".*\\.ts"))))
340 ;; Ensure that icons are found at runtime.
341 (add-after 'install 'wrap-executable
342 (lambda* (#:key inputs outputs #:allow-other-keys)
343 (let ((out (assoc-ref outputs "out")))
344 (wrap-program (string-append out "/bin/ghostwriter")
345 `("QT_PLUGIN_PATH" ":" prefix
346 ,(map (lambda (label)
347 (string-append (assoc-ref inputs label)
348 "/lib/qt5/plugins/"))
349 '("qtsvg" "qtmultimedia"))))))))))
350 (home-page "https://wereturtle.github.io/ghostwriter/")
351 (synopsis "Write without distractions")
353 "@code{ghostwriter} provides a relaxing, distraction-free writing
354 environment with Markdown markup.")
355 (license license:gpl3+))) ; icons/* under CC-BY-SA3
357 (define-public editorconfig-core-c
359 (name "editorconfig-core-c")
365 (url "https://github.com/editorconfig/editorconfig-core-c.git")
366 (commit (string-append "v" version))))
367 (file-name (git-file-name name version))
370 "0jkc69r4jwn4rih6h6cqvgljjc3ff49cxj8286mi515aczr48cm1"))))
371 (build-system cmake-build-system)
374 (modify-phases %standard-phases
375 (add-after 'unpack 'insert-tests
376 (lambda* (#:key inputs #:allow-other-keys)
377 (let ((tests (assoc-ref inputs "tests")))
378 (copy-recursively tests "tests"))
384 (url "https://github.com/editorconfig/editorconfig-core-test")
385 (commit "6ea1d8ece62cac9cf72c79dce4879b046abe1fe7"))) ; matches version
386 (file-name (git-file-name "editorconfig-core-test" version))
389 "1sf6910idnd4bgzbj8w8f9ldsbkaqa0lh6syymwy3hfqda63acj7"))))))
392 (home-page "https://editorconfig.org/")
393 (synopsis "EditorConfig core library written in C")
394 (description "EditorConfig makes it easy to maintain the correct coding
395 style when switching between different text editors and between different
396 projects. The EditorConfig project maintains a file format and plugins for
397 various text editors which allow this file format to be read and used by those
399 (license license:bsd-2)))
401 (define-public texmacs
408 (uri (string-append "https://www.texmacs.org/Download/ftp/tmftp/"
409 "source/TeXmacs-" version "-src.tar.gz"))
411 (base32 "12bp0f34izzqimz49lfpgf4lyz3h45s9xbmk8v6zsawdjki76alg"))
412 (modules '((guix build utils)))
415 (delete-file-recursively "3rdparty")
417 (build-system gnu-build-system)
419 `(("pkg-config" ,pkg-config)))
421 `(("freetype" ,freetype)
424 ("python" ,python-wrapper)
427 `(#:tests? #f ; no check target
429 (modify-phases %standard-phases
430 (add-before 'configure 'gzip-flags
432 (substitute* "Makefile.in"
433 (("^GZIP = gzip -f") "GZIP = gzip -f -n")))))))
434 (synopsis "Editing platform with special features for scientists")
436 "GNU TeXmacs is a text editing platform which is specialized for
437 scientists. It is ideal for editing structured documents with different
438 types of content. It has robust support for mathematical formulas and plots.
439 It can also act as an interface to external mathematical programs such as R
440 and Octave. TeXmacs is completely extensible via Guile.")
441 (license license:gpl3+)
442 (home-page "https://www.texmacs.org/tmweb/home/welcome.en.html")))
444 (define-public scintilla
450 (uri (let ((v (apply string-append (string-split version #\.))))
452 "https://www.scintilla.org/scintilla" v ".tgz")))
455 "01gq31ggvasw4sy9xs544h7v1dmxrlxs5bzxpasqb9yi3ps3nl0f"))))
456 (build-system gnu-build-system)
458 `(#:make-flags (list "GTK3=1" "CC=gcc" "-Cgtk")
459 #:tests? #f ;require un-packaged Pyside
461 (modify-phases %standard-phases
462 (delete 'configure) ;no configure script
463 (add-after 'unpack 'build-shared-library
465 (substitute* "gtk/makefile"
466 (("scintilla\\.a") "libscintilla.so")
467 (("\\$\\(AR\\) \\$\\(ARFLAGS\\) \\$@ \\$\\^")
468 "$(CC) -shared $^ -o $@")
469 (("\\$\\(RANLIB\\) \\$@") ""))
472 (lambda* (#:key outputs #:allow-other-keys)
473 (let* ((out (assoc-ref outputs "out"))
474 (lib (string-append out "/lib"))
475 (include (string-append out "/include")))
476 (install-file "bin/libscintilla.so" lib)
477 (for-each (lambda (f) (install-file f include))
478 (find-files "include/" "."))
481 `(("pkg-config" ,pkg-config)
482 ("python" ,python-wrapper)))
485 (home-page "https://www.scintilla.org/")
486 (synopsis "Code editor for GTK+")
487 (description "Scintilla is a source code editing component for
488 GTK+. It has the usual features found in text editing components, as
489 well as some that are especially useful for editing and debugging
490 source code; these include support for syntax styling, error
491 indicators, code completion and call tips. Styling choices are more
492 open than with many editors: Scintilla lets you use proportional
493 fonts, bold and italics, multiple foreground and background colours,
494 and multiple fonts.")
495 (license license:hpnd)))
503 (uri (string-append "https://download.geany.org/"
504 "geany-" version ".tar.bz2"))
507 "0gnm17cr4rf3pmkf0axz4a0fxwnvp55ji0q0lzy88yqbshyxv14i"))
508 (modules '((guix build utils)))
510 (delete-file-recursively "scintilla")
512 (build-system gnu-build-system)
514 `(("autoconf" ,autoconf)
515 ("automake" ,automake)
518 ("intltool" ,intltool)
520 ("pkg-config" ,pkg-config)
521 ("python-docutils" ,python-docutils))) ;for rst2html
524 ("scintilla" ,scintilla)))
527 (modify-phases %standard-phases
528 (add-after 'unpack 'use-scintilla-shared-library
529 (lambda* (#:key inputs #:allow-other-keys)
530 (substitute* "configure.ac"
531 (("scintilla/Makefile") "")
532 (("scintilla/include/Makefile") ""))
533 (substitute* "Makefile.am"
535 (substitute* "src/Makefile.am"
536 (("\\$\\(top_builddir\\)/scintilla/libscintilla.la") "")
537 (("geany_LDFLAGS =" all) (string-append all " -lscintilla")))
538 (substitute* "doc/Makefile.am"
539 (("\\$\\(INSTALL_DATA\\) \\$\\(top_srcdir\\)/scintilla/License.txt \\$\\(DOCDIR\\)/ScintillaLicense.txt") ""))
540 (substitute* "tests/Makefile.am"
541 (("AM_LDFLAGS =" all) (string-append all " -lscintilla")))
542 (for-each delete-file (list "autogen.sh" "configure" "Makefile.in"))
544 (home-page "https://www.geany.org")
545 (synopsis "Fast and lightweight IDE")
546 (description "Geany is a small and fast Integrated Development
547 Environment (IDE) that only has a few dependencies on other packages and is as
548 independent as possible from special desktop environments like KDE or GNOME.
550 The basic features of Geany are:
552 @item syntax highlighting
553 @item code completion
554 @item auto completion of often constructed constructs like if, for and while
555 @item auto completion of XML and HTML tags
558 @item many supported filetypes like C, Java, PHP, HTML, Python, Perl, Pascal
560 @item embedded terminal emulation
561 @item extensibility through plugins
563 (license license:gpl2+)))
568 ;; Stable release is 1.8. However, this development version
569 ;; introduces support for UTF-8.
573 (uri (string-append "http://www.moria.de/~michael/fe/"
574 "fe-" version ".tar.gz"))
577 "1hwws7si1752z6hp61zxznvgsb6846lp8zl1hn5ddhsbafwalwb9"))))
578 (build-system gnu-build-system)
580 `(#:tests? #f ;no test
581 ;; Sendmail is only used to send a crash log. Disable the
582 ;; feature since it is (1) undocumented (2) not very useful.
583 #:configure-flags (list "--disable-sendmail")
585 (modify-phases %standard-phases
586 (add-after 'install 'install-doc
587 (lambda* (#:key outputs #:allow-other-keys)
588 (let* ((out (assoc-ref outputs "out"))
589 (doc (string-append out "/share/doc/" ,name "-" ,version)))
590 (for-each (lambda (f) (install-file f doc))
591 '("fe.doc" "fe.html" "fe.ps" "feref.ps" "README"))
594 `(("gettext" ,gettext-minimal)))
596 `(("ncurses" ,ncurses)))
597 (home-page "http://www.moria.de/~michael/fe/")
598 (synopsis "Small folding editor")
599 (description "Fe is a small folding editor. It allows to fold
600 arbitrary text regions; it is not bound to syntactic units.
602 Fe has no configuration or extension language and requires no setup.
603 Its user interface is emacs-like and it has menus for the very most
604 important functions to help beginners. Further there is a reference
608 @item Regions and Emacs-like kill ring
609 @item Incremental search
610 @item Keyboard macros
611 @item Editing binary files
612 @item Multiple windows and views
613 @item Compose function for Latin 1 characters
615 (license license:gpl2+)))