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 Nils Gillmann <ng0@n0.is>
7 ;;; Copyright © 2014 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.org>
8 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; This file is part of GNU Guix.
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25 (define-module (gnu packages text-editors)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix utils)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system glib-or-gtk)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages assembly)
35 #:use-module (gnu packages boost)
36 #:use-module (gnu packages documentation)
37 #:use-module (gnu packages gcc)
38 #:use-module (gnu packages glib)
39 #:use-module (gnu packages gtk)
40 #:use-module (gnu packages libbsd)
41 #:use-module (gnu packages libreoffice)
42 #:use-module (gnu packages lua)
43 #:use-module (gnu packages ncurses)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages qt)
46 #:use-module (gnu packages regex)
47 #:use-module (gnu packages ruby)
48 #:use-module (gnu packages terminals)
49 #:use-module (gnu packages xml))
57 (uri (string-append "https://github.com/martanne/"
58 name "/archive/v" version ".tar.gz"))
59 (file-name (string-append name "-" version ".tar.gz"))
62 "1xbxb3q963s6sav63yw0x30lm0wvxsrzb7hr6a7dh4f8r7mp1skp"))))
63 (build-system gnu-build-system)
65 `(#:test-target "test"
66 #:tests? #f ; no releases; snapshots are missing tests
68 (modify-phases %standard-phases
69 (add-after 'install 'wrap-binary
70 (lambda* (#:key inputs outputs #:allow-other-keys)
71 (let* ((out (assoc-ref outputs "out"))
72 (lpeg (assoc-ref inputs "lua-lpeg"))
73 (lua-version ,(version-major+minor (package-version lua)))
74 (LUA_PATH (string-append lpeg "/share/lua/"
75 lua-version "/?.lua"))
76 (LUA_CPATH (string-append lpeg "/lib/lua/"
77 lua-version "/?.so")))
78 (wrap-program (string-append out "/bin/vis")
79 `("LUA_PATH" ":" prefix (,LUA_PATH))
80 `("LUA_CPATH" ":" prefix (,LUA_CPATH)))
83 (list (search-path-specification
85 (files '("share/vis")))))
86 (inputs `(("lua" ,lua)
88 ("libtermkey" ,libtermkey)
89 ("lua-lpeg" ,lua-lpeg)
91 (synopsis "Vim-like text editor")
93 "Vis aims to be a modern, legacy free, simple yet efficient vim-like text
94 editor. It extends vim's modal editing with built-in support for multiple
95 cursors/selections and combines it with sam's structural regular expression
96 based command language.")
97 (home-page "https://github.com/martanne/vis")
98 (license (list license:isc ; Main distribution.
99 license:public-domain ; map.[ch]
100 license:expat)))) ; lexers and libutf.[ch]
102 (define-public kakoune
105 (version "2018.04.13")
109 (uri (string-append "https://github.com/mawww/kakoune/"
110 "releases/download/v" version "/"
111 name "-" version ".tar.bz2"))
114 "1kkzs5nrjxzd1jq7a4k7qfb5kg05871z0r3d9c0yhz9shf6wz36d"))))
115 (build-system gnu-build-system)
118 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
120 (modify-phases %standard-phases
121 (add-after 'unpack 'patch-source
123 ;; kakoune uses confstr with _CS_PATH to find out where to find
124 ;; a posix shell, but this doesn't work in the build
125 ;; environment. This substitution just replaces that result
126 ;; with the "sh" path.
127 (substitute* "src/shell_manager.cc"
128 (("if \\(m_shell.empty\\(\\)\\)" line)
129 (string-append "m_shell = \"" (which "sh")
132 (delete 'configure) ; no configure script
133 ;; kakoune requires us to be in the src/ directory to build
134 (add-before 'build 'chdir
135 (lambda _ (chdir "src") #t)))))
137 `(("asciidoc" ,asciidoc)
138 ("pkg-config" ,pkg-config)
141 `(("ncurses" ,ncurses)
143 (synopsis "Vim-inspired code editor")
145 "Kakoune is a code editor heavily inspired by Vim, as such most of its
146 commands are similar to Vi's ones, and it shares Vi's \"keystrokes as a text
147 editing language\" model. Kakoune has a strong focus on interactivity, most
148 commands provide immediate and incremental results, while still being
149 competitive (as in keystroke count) with Vim.")
150 (home-page "http://kakoune.org/")
151 (license license:unlicense)))
160 (uri (string-append "https://sourceforge.net/projects/joe-editor/"
161 "files/JOE sources/joe-" version "/"
162 "joe-" version ".tar.gz"))
165 "1pmr598xxxm9j9dl93kq4dv36zyw0q2dh6d7x07hf134y9hhlnj9"))))
166 (build-system gnu-build-system)
167 (inputs `(("ncurses" ,ncurses)))
168 (home-page "http://joe-editor.sourceforge.net/")
169 (synopsis "Console screen editor")
171 "JOE is a powerful console screen editor with a \"mode-less\" user
172 interface similar to many user-friendly editors. JOE has some of the key
173 bindings and many of the powerful features of GNU Emacs.")
174 (license license:gpl3+)))
176 (define-public leafpad
182 (uri (string-append "mirror://savannah/"
183 "leafpad/leafpad-" version ".tar.gz"))
186 "0b0az2wvqgvam7w0ns1j8xp2llslm1rx6h7zcsy06a7j0yp257cm"))))
187 (build-system glib-or-gtk-build-system)
189 `(("intltool" ,intltool)
190 ("pkg-config" ,pkg-config)))
193 (home-page "http://tarot.freeshell.org/leafpad/")
194 (synopsis "GTK+ based text editor")
195 (description "Leafpad is a GTK+ text editor that emphasizes simplicity. As
196 development focuses on keeping weight down to a minimum, only the most essential
197 features are implemented in the editor. Leafpad is simple to use, is easily
198 compiled, requires few libraries, and starts up quickly. ")
199 (license license:gpl2+)))
207 (uri (string-append "https://sites.google.com/site/e3editor/Home/"
208 "e3-" version ".tgz"))
211 "0919kadkas020maqq37852isnzp053q2fnws2zh3mz81d1jiviak"))
212 (modules '((guix build utils)))
214 ;; Remove pre-built binaries.
216 (delete-file-recursively "bin")
218 (build-system gnu-build-system)
221 #:make-flags (list (string-append "PREFIX="
222 (assoc-ref %outputs "out")))
223 #:phases (modify-phases %standard-phases
224 (delete 'configure))))
227 (home-page "https://sites.google.com/site/e3editor/")
228 (synopsis "Tiny text editor written in assembly")
230 "e3 is a micro text editor with an executable code size between 3800 and
231 35000 bytes. Except for ``syntax highlighting'', the e3 binary supports all
232 of the basic functions one expects plus built in arithmetic calculations.
233 UTF-8 coding of unicode characters is supported as well. e3 can use
234 Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings. e3 can be used on
235 16, 32, and 64-bit CPUs.")
236 (supported-systems '("x86_64-linux" "i686-linux"))
237 (license license:gpl2+)))
246 (url "https://github.com/hboetes/mg")
248 (file-name (git-file-name name version))
251 "06w86xk7sjl2x2h3z6msn8kpmwj05qdimcym77wzhz5s94dzh1bl"))
252 (modules '((guix build utils)))
254 (substitute* "GNUmakefile"
257 (build-system gnu-build-system)
259 `(("pkg-config" ,pkg-config)))
262 ("ncurses" ,ncurses)))
264 ;; No test suite available.
266 #:make-flags (list (string-append "prefix=" %output)
268 #:phases (modify-phases %standard-phases
269 (delete 'configure) ; no configure script
270 (add-before 'build 'correct-location-of-difftool
272 (substitute* "buffer.c"
276 (add-before 'install 'patch-tutorial-location
277 (lambda* (#:key outputs #:allow-other-keys)
279 (("/usr") (assoc-ref outputs "out")))
281 (add-after 'install 'install-tutorial
282 (lambda* (#:key outputs #:allow-other-keys)
283 (let* ((out (assoc-ref outputs "out"))
284 (doc (string-append out "/share/doc/mg")))
285 (install-file "tutorial" doc)
287 (home-page "https://homepage.boetes.org/software/mg/")
288 (synopsis "Microscopic GNU Emacs clone")
290 "Mg (mg) is a GNU Emacs style editor, with which it is \"broadly\"
291 compatible. This is a portable version of the mg maintained by the OpenBSD
293 (license license:public-domain)))
295 (define-public ghostwriter
302 (url "https://github.com/wereturtle/ghostwriter.git")
303 (commit (string-append "v" version))))
304 (file-name (git-file-name name version))
307 "0251563zy0q69fzfacvalpx43y15cshb0bhshyd4w37061gh1c12"))))
308 (build-system gnu-build-system)
310 `(("pkg-config" ,pkg-config)
311 ("qttools" ,qttools))) ;for lrelease
313 `(("hunspell" ,hunspell)
315 ("qtmultimedia" ,qtmultimedia)
317 ("qtwebkit" ,qtwebkit)))
320 (modify-phases %standard-phases
322 (lambda* (#:key outputs #:allow-other-keys)
323 (let ((out (assoc-ref outputs "out")))
324 (invoke "qmake" (string-append "PREFIX=" out)))))
325 (add-after 'configure 'create-translations
327 ;; `lrelease` will not overwrite, so delete existing .qm files
328 (for-each delete-file (find-files "translations" ".*\\.qm"))
329 (apply invoke "lrelease" (find-files "translations" ".*\\.ts"))))
330 ;; Ensure that icons are found at runtime.
331 (add-after 'install 'wrap-executable
332 (lambda* (#:key inputs outputs #:allow-other-keys)
333 (let ((out (assoc-ref outputs "out")))
334 (wrap-program (string-append out "/bin/ghostwriter")
335 `("QT_PLUGIN_PATH" ":" prefix
336 ,(map (lambda (label)
337 (string-append (assoc-ref inputs label)
338 "/lib/qt5/plugins/"))
339 '("qtsvg" "qtmultimedia"))))))))))
340 (home-page "https://wereturtle.github.io/ghostwriter/")
341 (synopsis "Write without distractions")
343 "@code{ghostwriter} provides a relaxing, distraction-free writing
344 environment with Markdown markup.")
345 (license license:gpl3+))) ;icons/* under CC-BY-SA3