gnu: sbcl-trivial-backtrace: Fix 'license' field.
[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 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>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
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.
17 ;;;
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.
22 ;;;
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/>.
25
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))
53
54 (define-public vis
55 (package
56 (name "vis")
57 (version "0.5")
58 (source (origin
59 (method url-fetch)
60 (uri (string-append "https://github.com/martanne/"
61 name "/archive/v" version ".tar.gz"))
62 (file-name (string-append name "-" version ".tar.gz"))
63 (sha256
64 (base32
65 "1xbxb3q963s6sav63yw0x30lm0wvxsrzb7hr6a7dh4f8r7mp1skp"))))
66 (build-system gnu-build-system)
67 (arguments
68 `(#:test-target "test"
69 #:tests? #f ; no releases; snapshots are missing tests
70 #:phases
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)))
84 #t))))))
85 (native-search-paths
86 (list (search-path-specification
87 (variable "VIS_PATH")
88 (files '("share/vis")))))
89 (inputs `(("lua" ,lua)
90 ("ncurses" ,ncurses)
91 ("libtermkey" ,libtermkey)
92 ("lua-lpeg" ,lua-lpeg)
93 ("tre" ,tre)))
94 (synopsis "Vim-like text editor")
95 (description
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]
104
105 (define-public kakoune
106 (package
107 (name "kakoune")
108 (version "2019.01.20")
109 (source
110 (origin
111 (method url-fetch)
112 (uri (string-append "https://github.com/mawww/kakoune/"
113 "releases/download/v" version "/"
114 "kakoune-" version ".tar.bz2"))
115 (sha256
116 (base32 "15drk7i17qdiqxqkjxhrxfclryj9qzb5ymxd20dwl05y4yi064cr"))))
117 (build-system gnu-build-system)
118 (arguments
119 `(#:make-flags
120 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
121 #:phases
122 (modify-phases %standard-phases
123 (add-after 'unpack 'patch-source
124 (lambda _
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")
132 "\";\n " line)))
133 #t))
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)))))
138 (native-inputs
139 `(("asciidoc" ,asciidoc)
140 ("pkg-config" ,pkg-config)
141 ("ruby" ,ruby)))
142 (inputs
143 `(("ncurses" ,ncurses)
144 ("boost" ,boost)))
145 (synopsis "Vim-inspired code editor")
146 (description
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)))
154
155 (define-public joe
156 (package
157 (name "joe")
158 (version "4.6")
159 (source
160 (origin
161 (method url-fetch)
162 (uri (string-append "https://sourceforge.net/projects/joe-editor/"
163 "files/JOE sources/joe-" version "/"
164 "joe-" version ".tar.gz"))
165 (sha256
166 (base32
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")
172 (description
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+)))
177
178 (define-public leafpad
179 (package
180 (name "leafpad")
181 (version "0.8.18.1")
182 (source (origin
183 (method url-fetch)
184 (uri (string-append "mirror://savannah/"
185 "leafpad/leafpad-" version ".tar.gz"))
186 (sha256
187 (base32
188 "0b0az2wvqgvam7w0ns1j8xp2llslm1rx6h7zcsy06a7j0yp257cm"))))
189 (build-system glib-or-gtk-build-system)
190 (native-inputs
191 `(("intltool" ,intltool)
192 ("pkg-config" ,pkg-config)))
193 (inputs
194 `(("gtk+" ,gtk+-2)))
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+)))
202
203 (define-public e3
204 (package
205 (name "e3")
206 (version "2.82")
207 (source (origin
208 (method url-fetch)
209 (uri (string-append "https://sites.google.com/site/e3editor/Home/"
210 "e3-" version ".tgz"))
211 (sha256
212 (base32
213 "0919kadkas020maqq37852isnzp053q2fnws2zh3mz81d1jiviak"))
214 (modules '((guix build utils)))
215
216 ;; Remove pre-built binaries.
217 (snippet '(begin
218 (delete-file-recursively "bin")
219 #t))))
220 (build-system gnu-build-system)
221 (arguments
222 `(#:tests? #f
223 #:make-flags (list (string-append "PREFIX="
224 (assoc-ref %outputs "out")))
225 #:phases (modify-phases %standard-phases
226 (delete 'configure))))
227 (native-inputs
228 `(("nasm" ,nasm)))
229 (home-page "https://sites.google.com/site/e3editor/")
230 (synopsis "Tiny text editor written in assembly")
231 (description
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+)))
240
241 (define-public mg
242 (package
243 (name "mg")
244 (version "20180408")
245 (source (origin
246 (method git-fetch)
247 (uri (git-reference
248 (url "https://github.com/hboetes/mg")
249 (commit version)))
250 (file-name (git-file-name name version))
251 (sha256
252 (base32
253 "06w86xk7sjl2x2h3z6msn8kpmwj05qdimcym77wzhz5s94dzh1bl"))
254 (modules '((guix build utils)))
255 (snippet '(begin
256 (substitute* "GNUmakefile"
257 (("/usr/bin/") ""))
258 #t))))
259 (build-system gnu-build-system)
260 (native-inputs
261 `(("pkg-config" ,pkg-config)))
262 (inputs
263 `(("libbsd" ,libbsd)
264 ("ncurses" ,ncurses)))
265 (arguments
266 ;; No test suite available.
267 '(#:tests? #f
268 #:make-flags (list (string-append "prefix=" %output)
269 "CC=gcc")
270 #:phases (modify-phases %standard-phases
271 (delete 'configure) ; no configure script
272 (add-before 'build 'correct-location-of-difftool
273 (lambda _
274 (substitute* "buffer.c"
275 (("/usr/bin/diff")
276 (which "diff")))
277 #t))
278 (add-before 'install 'patch-tutorial-location
279 (lambda* (#:key outputs #:allow-other-keys)
280 (substitute* "mg.1"
281 (("/usr") (assoc-ref outputs "out")))
282 #t))
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)
288 #t))))))
289 (home-page "https://homepage.boetes.org/software/mg/")
290 (synopsis "Microscopic GNU Emacs clone")
291 (description
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
294 team.")
295 (license license:public-domain)))
296
297 (define-public ghostwriter
298 (package
299 (name "ghostwriter")
300 (version "1.7.4")
301 (source (origin
302 (method git-fetch)
303 (uri (git-reference
304 (url "https://github.com/wereturtle/ghostwriter.git")
305 (commit (string-append "v" version))))
306 (file-name (git-file-name name version))
307 (sha256
308 (base32
309 "1pqlr08z5syqcq5p282asxwzrrm7c1w94baxyb467swh8yp3fj5m"))))
310 (build-system gnu-build-system)
311 (native-inputs
312 `(("pkg-config" ,pkg-config)
313 ("qttools" ,qttools))) ; for lrelease
314 (inputs
315 `(("hunspell" ,hunspell)
316 ("qtbase" ,qtbase)
317 ("qtmultimedia" ,qtmultimedia)
318 ("qtsvg" ,qtsvg)
319 ("qtwebkit" ,qtwebkit)))
320 (arguments
321 `(#:phases
322 (modify-phases %standard-phases
323 (replace 'configure
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
328 (lambda _
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")
344 (description
345 "@code{ghostwriter} provides a relaxing, distraction-free writing
346 environment with Markdown markup.")
347 (license license:gpl3+))) ; icons/* under CC-BY-SA3
348
349 (define-public editorconfig-core-c
350 (package
351 (name "editorconfig-core-c")
352 (version "0.12.3")
353 (source
354 (origin
355 (method git-fetch)
356 (uri (git-reference
357 (url "https://github.com/editorconfig/editorconfig-core-c.git")
358 (commit (string-append "v" version))))
359 (file-name (git-file-name name version))
360 (sha256
361 (base32
362 "0jkc69r4jwn4rih6h6cqvgljjc3ff49cxj8286mi515aczr48cm1"))))
363 (build-system cmake-build-system)
364 (arguments
365 '(#:phases
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"))
371 #t)))))
372 (native-inputs
373 `(("tests" ,(origin
374 (method git-fetch)
375 (uri (git-reference
376 (url "https://github.com/editorconfig/editorconfig-core-test")
377 (commit "6ea1d8ece62cac9cf72c79dce4879b046abe1fe7"))) ; matches version
378 (file-name (git-file-name "editorconfig-core-test" version))
379 (sha256
380 (base32
381 "1sf6910idnd4bgzbj8w8f9ldsbkaqa0lh6syymwy3hfqda63acj7"))))))
382 (inputs
383 `(("pcre2" ,pcre2)))
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
390 editors.")
391 (license license:bsd-2)))