gnu: rust: Update to 1.34.1.
[jackhill/guix/guix.git] / gnu / packages / text-editors.scm
CommitLineData
a2c1dcea
JMSG
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 José Miguel Sánchez García <jmi2k@openmailbox.org>
5613ea79 3;;; Copyright © 2016 Carlo Zancanaro <carlo@zancanaro.id.au>
bc111d39 4;;; Copyright © 2017, 2018 Eric Bavier <bavier@member.fsf.org>
0bf11648 5;;; Copyright © 2017 Feng Shu <tumashu@163.com>
47956fa0 6;;; Copyright © 2017 ng0 <ng0@n0.is>
bcd757fd 7;;; Copyright © 2014 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.org>
98e7307d 8;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
2238211a 9;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
a2c1dcea
JMSG
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)
5613ea79 29 #:use-module (guix git-download)
a2c1dcea
JMSG
30 #:use-module (guix utils)
31 #:use-module (guix build-system gnu)
2238211a 32 #:use-module (guix build-system cmake)
4f038621 33 #:use-module (guix build-system glib-or-gtk)
a2c1dcea
JMSG
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (gnu packages)
3312fda0 36 #:use-module (gnu packages assembly)
5613ea79
CZ
37 #:use-module (gnu packages boost)
38 #:use-module (gnu packages documentation)
39 #:use-module (gnu packages gcc)
0bf11648
FS
40 #:use-module (gnu packages glib)
41 #:use-module (gnu packages gtk)
bcd757fd 42 #:use-module (gnu packages libbsd)
04918a00 43 #:use-module (gnu packages libreoffice)
a2c1dcea
JMSG
44 #:use-module (gnu packages lua)
45 #:use-module (gnu packages ncurses)
2238211a 46 #:use-module (gnu packages pcre)
0bf11648 47 #:use-module (gnu packages pkg-config)
04918a00 48 #:use-module (gnu packages qt)
852ba10a 49 #:use-module (gnu packages regex)
5613ea79 50 #:use-module (gnu packages ruby)
264ccbb3 51 #:use-module (gnu packages terminals)
5613ea79 52 #:use-module (gnu packages xml))
a2c1dcea
JMSG
53
54(define-public vis
55 (package
56 (name "vis")
dadc8610 57 (version "0.5")
a2c1dcea
JMSG
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
852ba10a 64 (base32
dadc8610 65 "1xbxb3q963s6sav63yw0x30lm0wvxsrzb7hr6a7dh4f8r7mp1skp"))))
a2c1dcea
JMSG
66 (build-system gnu-build-system)
67 (arguments
852ba10a
TGR
68 `(#:test-target "test"
69 #:tests? #f ; no releases; snapshots are missing tests
a2c1dcea
JMSG
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")))))
c695fb76
TGR
89 (inputs `(("lua" ,lua)
90 ("ncurses" ,ncurses)
91 ("libtermkey" ,libtermkey)
92 ("lua-lpeg" ,lua-lpeg)
852ba10a 93 ("tre" ,tre)))
a2c1dcea
JMSG
94 (synopsis "Vim-like text editor")
95 (description
96 "Vis aims to be a modern, legacy free, simple yet efficient vim-like text
97editor. It extends vim's modal editing with built-in support for multiple
98cursors/selections and combines it with sam's structural regular expression
99based 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]
5613ea79
CZ
104
105(define-public kakoune
fbe8ebec
TGR
106 (package
107 (name "kakoune")
98e7307d 108 (version "2019.01.20")
fbe8ebec
TGR
109 (source
110 (origin
111 (method url-fetch)
112 (uri (string-append "https://github.com/mawww/kakoune/"
113 "releases/download/v" version "/"
a1cb6928 114 "kakoune-" version ".tar.bz2"))
fbe8ebec 115 (sha256
98e7307d 116 (base32 "15drk7i17qdiqxqkjxhrxfclryj9qzb5ymxd20dwl05y4yi064cr"))))
fbe8ebec
TGR
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
5613ea79
CZ
148commands are similar to Vi's ones, and it shares Vi's \"keystrokes as a text
149editing language\" model. Kakoune has a strong focus on interactivity, most
150commands provide immediate and incremental results, while still being
151competitive (as in keystroke count) with Vim.")
27405497 152 (home-page "https://kakoune.org/")
fbe8ebec 153 (license license:unlicense)))
f255a6db
EB
154
155(define-public joe
156 (package
157 (name "joe")
bc111d39 158 (version "4.6")
f255a6db
EB
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
bc111d39 167 "1pmr598xxxm9j9dl93kq4dv36zyw0q2dh6d7x07hf134y9hhlnj9"))))
f255a6db
EB
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
7904f18a
EB
173 "JOE is a powerful console screen editor with a \"mode-less\" user
174interface similar to many user-friendly editors. JOE has some of the key
175bindings and many of the powerful features of GNU Emacs.")
f255a6db 176 (license license:gpl3+)))
0bf11648
FS
177
178(define-public leafpad
179 (package
180 (name "leafpad")
181 (version "0.8.18.1")
182 (source (origin
183 (method url-fetch)
b7fd77ef 184 (uri (string-append "mirror://savannah/"
0bf11648
FS
185 "leafpad/leafpad-" version ".tar.gz"))
186 (sha256
187 (base32
188 "0b0az2wvqgvam7w0ns1j8xp2llslm1rx6h7zcsy06a7j0yp257cm"))))
4f038621 189 (build-system glib-or-gtk-build-system)
0bf11648
FS
190 (native-inputs
191 `(("intltool" ,intltool)
192 ("pkg-config" ,pkg-config)))
193 (inputs
194 `(("gtk+" ,gtk+-2)))
dde5831c 195 (home-page "http://tarot.freeshell.org/leafpad/")
0bf11648
FS
196 (synopsis "GTK+ based text editor")
197 (description "Leafpad is a GTK+ text editor that emphasizes simplicity. As
198development focuses on keeping weight down to a minimum, only the most essential
199features are implemented in the editor. Leafpad is simple to use, is easily
200compiled, requires few libraries, and starts up quickly. ")
201 (license license:gpl2+)))
3312fda0 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.
6cbee49d
MW
217 (snippet '(begin
218 (delete-file-recursively "bin")
219 #t))))
3312fda0 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
23335000 bytes. Except for ``syntax highlighting'', the e3 binary supports all
234of the basic functions one expects plus built in arithmetic calculations.
235UTF-8 coding of unicode characters is supported as well. e3 can use
236Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings. e3 can be used on
23716, 32, and 64-bit CPUs.")
238 (supported-systems '("x86_64-linux" "i686-linux"))
239 (license license:gpl2+)))
bcd757fd
LC
240
241(define-public mg
242 (package
243 (name "mg")
a4d8b386 244 (version "20180408")
bcd757fd 245 (source (origin
a4d8b386
TGR
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))
bcd757fd
LC
251 (sha256
252 (base32
a4d8b386 253 "06w86xk7sjl2x2h3z6msn8kpmwj05qdimcym77wzhz5s94dzh1bl"))
bcd757fd 254 (modules '((guix build utils)))
6cbee49d
MW
255 (snippet '(begin
256 (substitute* "GNUmakefile"
257 (("/usr/bin/") ""))
258 #t))))
bcd757fd
LC
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)
bcd757fd
LC
269 "CC=gcc")
270 #:phases (modify-phases %standard-phases
a4d8b386 271 (delete 'configure) ; no configure script
217ce570 272 (add-before 'build 'correct-location-of-difftool
273 (lambda _
274 (substitute* "buffer.c"
275 (("/usr/bin/diff")
276 (which "diff")))
277 #t))
bcd757fd
LC
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))))))
c3d82885 289 (home-page "https://homepage.boetes.org/software/mg/")
bcd757fd
LC
290 (synopsis "Microscopic GNU Emacs clone")
291 (description
292 "Mg (mg) is a GNU Emacs style editor, with which it is \"broadly\"
293compatible. This is a portable version of the mg maintained by the OpenBSD
294team.")
295 (license license:public-domain)))
04918a00
EB
296
297(define-public ghostwriter
298 (package
299 (name "ghostwriter")
58ab7f29 300 (version "1.7.4")
04918a00
EB
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
58ab7f29 309 "1pqlr08z5syqcq5p282asxwzrrm7c1w94baxyb467swh8yp3fj5m"))))
04918a00
EB
310 (build-system gnu-build-system)
311 (native-inputs
312 `(("pkg-config" ,pkg-config)
58ab7f29 313 ("qttools" ,qttools))) ; for lrelease
04918a00
EB
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
346environment with Markdown markup.")
58ab7f29 347 (license license:gpl3+))) ; icons/* under CC-BY-SA3
2238211a
EF
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
387style when switching between different text editors and between different
388projects. The EditorConfig project maintains a file format and plugins for
389various text editors which allow this file format to be read and used by those
390editors.")
391 (license license:bsd-2)))