gnu: Add python-keras-preprocessing.
[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 (synopsis "Vim-inspired code editor")
145 (description
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)))
153
154 (define-public joe
155 (package
156 (name "joe")
157 (version "4.6")
158 (source
159 (origin
160 (method url-fetch)
161 (uri (string-append "https://sourceforge.net/projects/joe-editor/"
162 "files/JOE sources/joe-" version "/"
163 "joe-" version ".tar.gz"))
164 (sha256
165 (base32
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")
171 (description
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+)))
176
177 (define-public leafpad
178 (package
179 (name "leafpad")
180 (version "0.8.18.1")
181 (source (origin
182 (method url-fetch)
183 (uri (string-append "mirror://savannah/"
184 "leafpad/leafpad-" version ".tar.gz"))
185 (sha256
186 (base32
187 "0b0az2wvqgvam7w0ns1j8xp2llslm1rx6h7zcsy06a7j0yp257cm"))))
188 (build-system glib-or-gtk-build-system)
189 (native-inputs
190 `(("intltool" ,intltool)
191 ("pkg-config" ,pkg-config)))
192 (inputs
193 `(("gtk+" ,gtk+-2)))
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+)))
201
202 (define-public e3
203 (package
204 (name "e3")
205 (version "2.82")
206 (source (origin
207 (method url-fetch)
208 (uri (string-append "https://sites.google.com/site/e3editor/Home/"
209 "e3-" version ".tgz"))
210 (sha256
211 (base32
212 "0919kadkas020maqq37852isnzp053q2fnws2zh3mz81d1jiviak"))
213 (modules '((guix build utils)))
214
215 ;; Remove pre-built binaries.
216 (snippet '(begin
217 (delete-file-recursively "bin")
218 #t))))
219 (build-system gnu-build-system)
220 (arguments
221 `(#:tests? #f
222 #:make-flags (list (string-append "PREFIX="
223 (assoc-ref %outputs "out")))
224 #:phases (modify-phases %standard-phases
225 (delete 'configure))))
226 (native-inputs
227 `(("nasm" ,nasm)))
228 (home-page "https://sites.google.com/site/e3editor/")
229 (synopsis "Tiny text editor written in assembly")
230 (description
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+)))
239
240 (define-public mg
241 (package
242 (name "mg")
243 (version "20180408")
244 (source (origin
245 (method git-fetch)
246 (uri (git-reference
247 (url "https://github.com/hboetes/mg")
248 (commit version)))
249 (file-name (git-file-name name version))
250 (sha256
251 (base32
252 "06w86xk7sjl2x2h3z6msn8kpmwj05qdimcym77wzhz5s94dzh1bl"))
253 (modules '((guix build utils)))
254 (snippet '(begin
255 (substitute* "GNUmakefile"
256 (("/usr/bin/") ""))
257 #t))))
258 (build-system gnu-build-system)
259 (native-inputs
260 `(("pkg-config" ,pkg-config)))
261 (inputs
262 `(("libbsd" ,libbsd)
263 ("ncurses" ,ncurses)))
264 (arguments
265 ;; No test suite available.
266 '(#:tests? #f
267 #:make-flags (list (string-append "prefix=" %output)
268 "CC=gcc")
269 #:phases (modify-phases %standard-phases
270 (delete 'configure) ; no configure script
271 (add-before 'build 'correct-location-of-difftool
272 (lambda _
273 (substitute* "buffer.c"
274 (("/usr/bin/diff")
275 (which "diff")))
276 #t))
277 (add-before 'install 'patch-tutorial-location
278 (lambda* (#:key outputs #:allow-other-keys)
279 (substitute* "mg.1"
280 (("/usr") (assoc-ref outputs "out")))
281 #t))
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)
287 #t))))))
288 (home-page "https://homepage.boetes.org/software/mg/")
289 (synopsis "Microscopic GNU Emacs clone")
290 (description
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
293 team.")
294 (license license:public-domain)))
295
296 (define-public ghostwriter
297 (package
298 (name "ghostwriter")
299 (version "1.7.4")
300 (source (origin
301 (method git-fetch)
302 (uri (git-reference
303 (url "https://github.com/wereturtle/ghostwriter.git")
304 (commit (string-append "v" version))))
305 (file-name (git-file-name name version))
306 (sha256
307 (base32
308 "1pqlr08z5syqcq5p282asxwzrrm7c1w94baxyb467swh8yp3fj5m"))))
309 (build-system gnu-build-system)
310 (native-inputs
311 `(("pkg-config" ,pkg-config)
312 ("qttools" ,qttools))) ; for lrelease
313 (inputs
314 `(("hunspell" ,hunspell)
315 ("qtbase" ,qtbase)
316 ("qtmultimedia" ,qtmultimedia)
317 ("qtsvg" ,qtsvg)
318 ("qtwebkit" ,qtwebkit)))
319 (arguments
320 `(#:phases
321 (modify-phases %standard-phases
322 (replace 'configure
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
327 (lambda _
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")
343 (description
344 "@code{ghostwriter} provides a relaxing, distraction-free writing
345 environment with Markdown markup.")
346 (license license:gpl3+))) ; icons/* under CC-BY-SA3
347
348 (define-public editorconfig-core-c
349 (package
350 (name "editorconfig-core-c")
351 (version "0.12.3")
352 (source
353 (origin
354 (method git-fetch)
355 (uri (git-reference
356 (url "https://github.com/editorconfig/editorconfig-core-c.git")
357 (commit (string-append "v" version))))
358 (file-name (git-file-name name version))
359 (sha256
360 (base32
361 "0jkc69r4jwn4rih6h6cqvgljjc3ff49cxj8286mi515aczr48cm1"))))
362 (build-system cmake-build-system)
363 (arguments
364 '(#:phases
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"))
370 #t)))))
371 (native-inputs
372 `(("tests" ,(origin
373 (method git-fetch)
374 (uri (git-reference
375 (url "https://github.com/editorconfig/editorconfig-core-test")
376 (commit "6ea1d8ece62cac9cf72c79dce4879b046abe1fe7"))) ; matches version
377 (file-name (git-file-name "editorconfig-core-test" version))
378 (sha256
379 (base32
380 "1sf6910idnd4bgzbj8w8f9ldsbkaqa0lh6syymwy3hfqda63acj7"))))))
381 (inputs
382 `(("pcre2" ,pcre2)))
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
389 editors.")
390 (license license:bsd-2)))