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 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
11 ;;; This file is part of GNU Guix.
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26 (define-module (gnu packages text-editors)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix git-download)
30 #:use-module (guix utils)
31 #:use-module (guix build-system gnu)
32 #:use-module (guix build-system cmake)
33 #:use-module (guix build-system glib-or-gtk)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (gnu packages)
36 #:use-module (gnu packages assembly)
37 #:use-module (gnu packages boost)
38 #:use-module (gnu packages documentation)
39 #:use-module (gnu packages gcc)
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gtk)
42 #:use-module (gnu packages libbsd)
43 #:use-module (gnu packages libreoffice)
44 #:use-module (gnu packages lua)
45 #:use-module (gnu packages ncurses)
46 #:use-module (gnu packages pcre)
47 #:use-module (gnu packages pkg-config)
48 #:use-module (gnu packages qt)
49 #:use-module (gnu packages regex)
50 #:use-module (gnu packages ruby)
51 #:use-module (gnu packages terminals)
52 #:use-module (gnu packages xml))
60 (uri (string-append "https://github.com/martanne/"
61 name "/archive/v" version ".tar.gz"))
62 (file-name (string-append name "-" version ".tar.gz"))
65 "1xbxb3q963s6sav63yw0x30lm0wvxsrzb7hr6a7dh4f8r7mp1skp"))))
66 (build-system gnu-build-system)
68 `(#:test-target "test"
69 #:tests? #f ; no releases; snapshots are missing tests
71 (modify-phases %standard-phases
72 (add-after 'install 'wrap-binary
73 (lambda* (#:key inputs outputs #:allow-other-keys)
74 (let* ((out (assoc-ref outputs "out"))
75 (lpeg (assoc-ref inputs "lua-lpeg"))
76 (lua-version ,(version-major+minor (package-version lua)))
77 (LUA_PATH (string-append lpeg "/share/lua/"
78 lua-version "/?.lua"))
79 (LUA_CPATH (string-append lpeg "/lib/lua/"
80 lua-version "/?.so")))
81 (wrap-program (string-append out "/bin/vis")
82 `("LUA_PATH" ":" prefix (,LUA_PATH))
83 `("LUA_CPATH" ":" prefix (,LUA_CPATH)))
86 (list (search-path-specification
88 (files '("share/vis")))))
89 (inputs `(("lua" ,lua)
91 ("libtermkey" ,libtermkey)
92 ("lua-lpeg" ,lua-lpeg)
94 (synopsis "Vim-like text editor")
96 "Vis aims to be a modern, legacy free, simple yet efficient vim-like text
97 editor. It extends vim's modal editing with built-in support for multiple
98 cursors/selections and combines it with sam's structural regular expression
99 based command language.")
100 (home-page "https://github.com/martanne/vis")
101 (license (list license:isc ; Main distribution.
102 license:public-domain ; map.[ch]
103 license:expat)))) ; lexers and libutf.[ch]
105 (define-public kakoune
108 (version "2019.01.20")
112 (uri (string-append "https://github.com/mawww/kakoune/"
113 "releases/download/v" version "/"
114 "kakoune-" version ".tar.bz2"))
116 (base32 "15drk7i17qdiqxqkjxhrxfclryj9qzb5ymxd20dwl05y4yi064cr"))))
117 (build-system gnu-build-system)
120 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
122 (modify-phases %standard-phases
123 (add-after 'unpack 'patch-source
125 ;; kakoune uses confstr with _CS_PATH to find out where to find
126 ;; a posix shell, but this doesn't work in the build
127 ;; environment. This substitution just replaces that result
128 ;; with the "sh" path.
129 (substitute* "src/shell_manager.cc"
130 (("if \\(m_shell.empty\\(\\)\\)" line)
131 (string-append "m_shell = \"" (which "sh")
134 (delete 'configure) ; no configure script
135 ;; kakoune requires us to be in the src/ directory to build
136 (add-before 'build 'chdir
137 (lambda _ (chdir "src") #t)))))
139 `(("asciidoc" ,asciidoc)
140 ("pkg-config" ,pkg-config)
143 `(("ncurses" ,ncurses)
145 (synopsis "Vim-inspired code editor")
147 "Kakoune is a code editor heavily inspired by Vim, as such most of its
148 commands are similar to Vi's ones, and it shares Vi's \"keystrokes as a text
149 editing language\" model. Kakoune has a strong focus on interactivity, most
150 commands provide immediate and incremental results, while still being
151 competitive (as in keystroke count) with Vim.")
152 (home-page "https://kakoune.org/")
153 (license license:unlicense)))
162 (uri (string-append "https://sourceforge.net/projects/joe-editor/"
163 "files/JOE sources/joe-" version "/"
164 "joe-" version ".tar.gz"))
167 "1pmr598xxxm9j9dl93kq4dv36zyw0q2dh6d7x07hf134y9hhlnj9"))))
168 (build-system gnu-build-system)
169 (inputs `(("ncurses" ,ncurses)))
170 (home-page "http://joe-editor.sourceforge.net/")
171 (synopsis "Console screen editor")
173 "JOE is a powerful console screen editor with a \"mode-less\" user
174 interface similar to many user-friendly editors. JOE has some of the key
175 bindings and many of the powerful features of GNU Emacs.")
176 (license license:gpl3+)))
178 (define-public leafpad
184 (uri (string-append "mirror://savannah/"
185 "leafpad/leafpad-" version ".tar.gz"))
188 "0b0az2wvqgvam7w0ns1j8xp2llslm1rx6h7zcsy06a7j0yp257cm"))))
189 (build-system glib-or-gtk-build-system)
191 `(("intltool" ,intltool)
192 ("pkg-config" ,pkg-config)))
195 (home-page "http://tarot.freeshell.org/leafpad/")
196 (synopsis "GTK+ based text editor")
197 (description "Leafpad is a GTK+ text editor that emphasizes simplicity. As
198 development focuses on keeping weight down to a minimum, only the most essential
199 features are implemented in the editor. Leafpad is simple to use, is easily
200 compiled, requires few libraries, and starts up quickly. ")
201 (license license:gpl2+)))
209 (uri (string-append "https://sites.google.com/site/e3editor/Home/"
210 "e3-" version ".tgz"))
213 "0919kadkas020maqq37852isnzp053q2fnws2zh3mz81d1jiviak"))
214 (modules '((guix build utils)))
216 ;; Remove pre-built binaries.
218 (delete-file-recursively "bin")
220 (build-system gnu-build-system)
223 #:make-flags (list (string-append "PREFIX="
224 (assoc-ref %outputs "out")))
225 #:phases (modify-phases %standard-phases
226 (delete 'configure))))
229 (home-page "https://sites.google.com/site/e3editor/")
230 (synopsis "Tiny text editor written in assembly")
232 "e3 is a micro text editor with an executable code size between 3800 and
233 35000 bytes. Except for ``syntax highlighting'', the e3 binary supports all
234 of the basic functions one expects plus built in arithmetic calculations.
235 UTF-8 coding of unicode characters is supported as well. e3 can use
236 Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings. e3 can be used on
237 16, 32, and 64-bit CPUs.")
238 (supported-systems '("x86_64-linux" "i686-linux"))
239 (license license:gpl2+)))
248 (url "https://github.com/hboetes/mg")
250 (file-name (git-file-name name version))
253 "06w86xk7sjl2x2h3z6msn8kpmwj05qdimcym77wzhz5s94dzh1bl"))
254 (modules '((guix build utils)))
256 (substitute* "GNUmakefile"
259 (build-system gnu-build-system)
261 `(("pkg-config" ,pkg-config)))
264 ("ncurses" ,ncurses)))
266 ;; No test suite available.
268 #:make-flags (list (string-append "prefix=" %output)
270 #:phases (modify-phases %standard-phases
271 (delete 'configure) ; no configure script
272 (add-before 'build 'correct-location-of-difftool
274 (substitute* "buffer.c"
278 (add-before 'install 'patch-tutorial-location
279 (lambda* (#:key outputs #:allow-other-keys)
281 (("/usr") (assoc-ref outputs "out")))
283 (add-after 'install 'install-tutorial
284 (lambda* (#:key outputs #:allow-other-keys)
285 (let* ((out (assoc-ref outputs "out"))
286 (doc (string-append out "/share/doc/mg")))
287 (install-file "tutorial" doc)
289 (home-page "https://homepage.boetes.org/software/mg/")
290 (synopsis "Microscopic GNU Emacs clone")
292 "Mg (mg) is a GNU Emacs style editor, with which it is \"broadly\"
293 compatible. This is a portable version of the mg maintained by the OpenBSD
295 (license license:public-domain)))
297 (define-public ghostwriter
304 (url "https://github.com/wereturtle/ghostwriter.git")
305 (commit (string-append "v" version))))
306 (file-name (git-file-name name version))
309 "1pqlr08z5syqcq5p282asxwzrrm7c1w94baxyb467swh8yp3fj5m"))))
310 (build-system gnu-build-system)
312 `(("pkg-config" ,pkg-config)
313 ("qttools" ,qttools))) ; for lrelease
315 `(("hunspell" ,hunspell)
317 ("qtmultimedia" ,qtmultimedia)
319 ("qtwebkit" ,qtwebkit)))
322 (modify-phases %standard-phases
324 (lambda* (#:key outputs #:allow-other-keys)
325 (let ((out (assoc-ref outputs "out")))
326 (invoke "qmake" (string-append "PREFIX=" out)))))
327 (add-after 'configure 'create-translations
329 ;; `lrelease` will not overwrite, so delete existing .qm files
330 (for-each delete-file (find-files "translations" ".*\\.qm"))
331 (apply invoke "lrelease" (find-files "translations" ".*\\.ts"))))
332 ;; Ensure that icons are found at runtime.
333 (add-after 'install 'wrap-executable
334 (lambda* (#:key inputs outputs #:allow-other-keys)
335 (let ((out (assoc-ref outputs "out")))
336 (wrap-program (string-append out "/bin/ghostwriter")
337 `("QT_PLUGIN_PATH" ":" prefix
338 ,(map (lambda (label)
339 (string-append (assoc-ref inputs label)
340 "/lib/qt5/plugins/"))
341 '("qtsvg" "qtmultimedia"))))))))))
342 (home-page "https://wereturtle.github.io/ghostwriter/")
343 (synopsis "Write without distractions")
345 "@code{ghostwriter} provides a relaxing, distraction-free writing
346 environment with Markdown markup.")
347 (license license:gpl3+))) ; icons/* under CC-BY-SA3
349 (define-public editorconfig-core-c
351 (name "editorconfig-core-c")
357 (url "https://github.com/editorconfig/editorconfig-core-c.git")
358 (commit (string-append "v" version))))
359 (file-name (git-file-name name version))
362 "0jkc69r4jwn4rih6h6cqvgljjc3ff49cxj8286mi515aczr48cm1"))))
363 (build-system cmake-build-system)
366 (modify-phases %standard-phases
367 (add-after 'unpack 'insert-tests
368 (lambda* (#:key inputs #:allow-other-keys)
369 (let ((tests (assoc-ref inputs "tests")))
370 (copy-recursively tests "tests"))
376 (url "https://github.com/editorconfig/editorconfig-core-test")
377 (commit "6ea1d8ece62cac9cf72c79dce4879b046abe1fe7"))) ; matches version
378 (file-name (git-file-name "editorconfig-core-test" version))
381 "1sf6910idnd4bgzbj8w8f9ldsbkaqa0lh6syymwy3hfqda63acj7"))))))
384 (home-page "https://editorconfig.org/")
385 (synopsis "EditorConfig core library written in C")
386 (description "EditorConfig makes it easy to maintain the correct coding
387 style when switching between different text editors and between different
388 projects. The EditorConfig project maintains a file format and plugins for
389 various text editors which allow this file format to be read and used by those
391 (license license:bsd-2)))