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)))
144 (synopsis "Vim-inspired code editor")
146 "Kakoune is a code editor heavily inspired by Vim, as such most of its
147 commands are similar to Vi's ones, and it shares Vi's \"keystrokes as a text
148 editing language\" model. Kakoune has a strong focus on interactivity, most
149 commands provide immediate and incremental results, while still being
150 competitive (as in keystroke count) with Vim.")
151 (home-page "https://kakoune.org/")
152 (license license:unlicense)))
161 (uri (string-append "https://sourceforge.net/projects/joe-editor/"
162 "files/JOE sources/joe-" version "/"
163 "joe-" version ".tar.gz"))
166 "1pmr598xxxm9j9dl93kq4dv36zyw0q2dh6d7x07hf134y9hhlnj9"))))
167 (build-system gnu-build-system)
168 (inputs `(("ncurses" ,ncurses)))
169 (home-page "http://joe-editor.sourceforge.net/")
170 (synopsis "Console screen editor")
172 "JOE is a powerful console screen editor with a \"mode-less\" user
173 interface similar to many user-friendly editors. JOE has some of the key
174 bindings and many of the powerful features of GNU Emacs.")
175 (license license:gpl3+)))
177 (define-public leafpad
183 (uri (string-append "mirror://savannah/"
184 "leafpad/leafpad-" version ".tar.gz"))
187 "0b0az2wvqgvam7w0ns1j8xp2llslm1rx6h7zcsy06a7j0yp257cm"))))
188 (build-system glib-or-gtk-build-system)
190 `(("intltool" ,intltool)
191 ("pkg-config" ,pkg-config)))
194 (home-page "http://tarot.freeshell.org/leafpad/")
195 (synopsis "GTK+ based text editor")
196 (description "Leafpad is a GTK+ text editor that emphasizes simplicity. As
197 development focuses on keeping weight down to a minimum, only the most essential
198 features are implemented in the editor. Leafpad is simple to use, is easily
199 compiled, requires few libraries, and starts up quickly. ")
200 (license license:gpl2+)))
208 (uri (string-append "https://sites.google.com/site/e3editor/Home/"
209 "e3-" version ".tgz"))
212 "0919kadkas020maqq37852isnzp053q2fnws2zh3mz81d1jiviak"))
213 (modules '((guix build utils)))
215 ;; Remove pre-built binaries.
217 (delete-file-recursively "bin")
219 (build-system gnu-build-system)
222 #:make-flags (list (string-append "PREFIX="
223 (assoc-ref %outputs "out")))
224 #:phases (modify-phases %standard-phases
225 (delete 'configure))))
228 (home-page "https://sites.google.com/site/e3editor/")
229 (synopsis "Tiny text editor written in assembly")
231 "e3 is a micro text editor with an executable code size between 3800 and
232 35000 bytes. Except for ``syntax highlighting'', the e3 binary supports all
233 of the basic functions one expects plus built in arithmetic calculations.
234 UTF-8 coding of unicode characters is supported as well. e3 can use
235 Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings. e3 can be used on
236 16, 32, and 64-bit CPUs.")
237 (supported-systems '("x86_64-linux" "i686-linux"))
238 (license license:gpl2+)))
247 (url "https://github.com/hboetes/mg")
249 (file-name (git-file-name name version))
252 "06w86xk7sjl2x2h3z6msn8kpmwj05qdimcym77wzhz5s94dzh1bl"))
253 (modules '((guix build utils)))
255 (substitute* "GNUmakefile"
258 (build-system gnu-build-system)
260 `(("pkg-config" ,pkg-config)))
263 ("ncurses" ,ncurses)))
265 ;; No test suite available.
267 #:make-flags (list (string-append "prefix=" %output)
269 #:phases (modify-phases %standard-phases
270 (delete 'configure) ; no configure script
271 (add-before 'build 'correct-location-of-difftool
273 (substitute* "buffer.c"
277 (add-before 'install 'patch-tutorial-location
278 (lambda* (#:key outputs #:allow-other-keys)
280 (("/usr") (assoc-ref outputs "out")))
282 (add-after 'install 'install-tutorial
283 (lambda* (#:key outputs #:allow-other-keys)
284 (let* ((out (assoc-ref outputs "out"))
285 (doc (string-append out "/share/doc/mg")))
286 (install-file "tutorial" doc)
288 (home-page "https://homepage.boetes.org/software/mg/")
289 (synopsis "Microscopic GNU Emacs clone")
291 "Mg (mg) is a GNU Emacs style editor, with which it is \"broadly\"
292 compatible. This is a portable version of the mg maintained by the OpenBSD
294 (license license:public-domain)))
296 (define-public ghostwriter
303 (url "https://github.com/wereturtle/ghostwriter.git")
304 (commit (string-append "v" version))))
305 (file-name (git-file-name name version))
308 "1pqlr08z5syqcq5p282asxwzrrm7c1w94baxyb467swh8yp3fj5m"))))
309 (build-system gnu-build-system)
311 `(("pkg-config" ,pkg-config)
312 ("qttools" ,qttools))) ; for lrelease
314 `(("hunspell" ,hunspell)
316 ("qtmultimedia" ,qtmultimedia)
318 ("qtwebkit" ,qtwebkit)))
321 (modify-phases %standard-phases
323 (lambda* (#:key outputs #:allow-other-keys)
324 (let ((out (assoc-ref outputs "out")))
325 (invoke "qmake" (string-append "PREFIX=" out)))))
326 (add-after 'configure 'create-translations
328 ;; `lrelease` will not overwrite, so delete existing .qm files
329 (for-each delete-file (find-files "translations" ".*\\.qm"))
330 (apply invoke "lrelease" (find-files "translations" ".*\\.ts"))))
331 ;; Ensure that icons are found at runtime.
332 (add-after 'install 'wrap-executable
333 (lambda* (#:key inputs outputs #:allow-other-keys)
334 (let ((out (assoc-ref outputs "out")))
335 (wrap-program (string-append out "/bin/ghostwriter")
336 `("QT_PLUGIN_PATH" ":" prefix
337 ,(map (lambda (label)
338 (string-append (assoc-ref inputs label)
339 "/lib/qt5/plugins/"))
340 '("qtsvg" "qtmultimedia"))))))))))
341 (home-page "https://wereturtle.github.io/ghostwriter/")
342 (synopsis "Write without distractions")
344 "@code{ghostwriter} provides a relaxing, distraction-free writing
345 environment with Markdown markup.")
346 (license license:gpl3+))) ; icons/* under CC-BY-SA3
348 (define-public editorconfig-core-c
350 (name "editorconfig-core-c")
356 (url "https://github.com/editorconfig/editorconfig-core-c.git")
357 (commit (string-append "v" version))))
358 (file-name (git-file-name name version))
361 "0jkc69r4jwn4rih6h6cqvgljjc3ff49cxj8286mi515aczr48cm1"))))
362 (build-system cmake-build-system)
365 (modify-phases %standard-phases
366 (add-after 'unpack 'insert-tests
367 (lambda* (#:key inputs #:allow-other-keys)
368 (let ((tests (assoc-ref inputs "tests")))
369 (copy-recursively tests "tests"))
375 (url "https://github.com/editorconfig/editorconfig-core-test")
376 (commit "6ea1d8ece62cac9cf72c79dce4879b046abe1fe7"))) ; matches version
377 (file-name (git-file-name "editorconfig-core-test" version))
380 "1sf6910idnd4bgzbj8w8f9ldsbkaqa0lh6syymwy3hfqda63acj7"))))))
383 (home-page "https://editorconfig.org/")
384 (synopsis "EditorConfig core library written in C")
385 (description "EditorConfig makes it easy to maintain the correct coding
386 style when switching between different text editors and between different
387 projects. The EditorConfig project maintains a file format and plugins for
388 various text editors which allow this file format to be read and used by those
390 (license license:bsd-2)))