gnu: vis: Run most tests.
[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>
89d3869b 4;;; Copyright © 2017, 2018, 2020 Eric Bavier <bavier@posteo.net>
0bf11648 5;;; Copyright © 2017 Feng Shu <tumashu@163.com>
3c986a7d 6;;; Copyright © 2017 Nikita <nikita@n0.is>
bcd757fd 7;;; Copyright © 2014 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.org>
77100119 8;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
2238211a 9;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
75a137da 10;;; Copyright © 2019 Andreas Enge <andreas@enge.fr>
1fffba66 11;;; Copyright © 2019, 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
28264388 12;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
8b95f741 13;;; Copyright © 2020 Tom Zander <tomz@freedommail.ch>
a2c1dcea
JMSG
14;;;
15;;; This file is part of GNU Guix.
16;;;
17;;; GNU Guix is free software; you can redistribute it and/or modify it
18;;; under the terms of the GNU General Public License as published by
19;;; the Free Software Foundation; either version 3 of the License, or (at
20;;; your option) any later version.
21;;;
22;;; GNU Guix is distributed in the hope that it will be useful, but
23;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25;;; GNU General Public License for more details.
26;;;
27;;; You should have received a copy of the GNU General Public License
28;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30(define-module (gnu packages text-editors)
31 #:use-module (guix packages)
32 #:use-module (guix download)
5613ea79 33 #:use-module (guix git-download)
a2c1dcea 34 #:use-module (guix utils)
28264388 35 #:use-module (guix build-system cmake)
a2c1dcea 36 #:use-module (guix build-system gnu)
2238211a 37 #:use-module (guix build-system cmake)
4f038621 38 #:use-module (guix build-system glib-or-gtk)
1fffba66 39 #:use-module (guix build-system python)
a2c1dcea
JMSG
40 #:use-module ((guix licenses) #:prefix license:)
41 #:use-module (gnu packages)
28264388 42 #:use-module (gnu packages aspell)
3312fda0 43 #:use-module (gnu packages assembly)
2363ed01 44 #:use-module (gnu packages autotools)
5613ea79 45 #:use-module (gnu packages boost)
ef64f9ca 46 #:use-module (gnu packages code)
5613ea79 47 #:use-module (gnu packages documentation)
75a137da 48 #:use-module (gnu packages fontutils)
eaf5df6b 49 #:use-module (gnu packages freedesktop)
5613ea79 50 #:use-module (gnu packages gcc)
2207d522 51 #:use-module (gnu packages gettext)
0bf11648
FS
52 #:use-module (gnu packages glib)
53 #:use-module (gnu packages gtk)
75a137da 54 #:use-module (gnu packages guile)
1fffba66 55 #:use-module (gnu packages haskell-xyz)
bcd757fd 56 #:use-module (gnu packages libbsd)
04918a00 57 #:use-module (gnu packages libreoffice)
28264388 58 #:use-module (gnu packages llvm)
a2c1dcea
JMSG
59 #:use-module (gnu packages lua)
60 #:use-module (gnu packages ncurses)
2238211a 61 #:use-module (gnu packages pcre)
75a137da 62 #:use-module (gnu packages perl)
0bf11648 63 #:use-module (gnu packages pkg-config)
75a137da 64 #:use-module (gnu packages python)
2363ed01 65 #:use-module (gnu packages python-xyz)
04918a00 66 #:use-module (gnu packages qt)
852ba10a 67 #:use-module (gnu packages regex)
5613ea79 68 #:use-module (gnu packages ruby)
264ccbb3 69 #:use-module (gnu packages terminals)
a78364e9 70 #:use-module (gnu packages texinfo)
28264388 71 #:use-module (gnu packages version-control)
fb85b967
NG
72 #:use-module (gnu packages xml)
73 #:use-module (gnu packages xorg))
a2c1dcea
JMSG
74
75(define-public vis
76 (package
77 (name "vis")
37e64053 78 (version "0.6") ; also update the vis-test input
d198eca0
TGR
79 (source
80 (origin
81 (method git-fetch)
82 (uri (git-reference
83 (url "https://github.com/martanne/vis")
84 (commit (string-append "v" version))))
85 (sha256
86 (base32 "1zjm89cn3rfq8fxpwp66khy53s6vqlmw6q103qyyvix8ydzxdmsh"))
87 (file-name (git-file-name name version))))
a2c1dcea
JMSG
88 (build-system gnu-build-system)
89 (arguments
852ba10a 90 `(#:test-target "test"
a2c1dcea
JMSG
91 #:phases
92 (modify-phases %standard-phases
37e64053
TGR
93 (add-after 'unpack 'unpack-test-suite
94 (lambda* (#:key inputs #:allow-other-keys)
95 (let ((vis-test (assoc-ref inputs "vis-test")))
96 (copy-recursively vis-test "test")
97 #t)))
98 (delete 'check) ; the tests need a wrapped vis
a2c1dcea
JMSG
99 (add-after 'install 'wrap-binary
100 (lambda* (#:key inputs outputs #:allow-other-keys)
101 (let* ((out (assoc-ref outputs "out"))
102 (lpeg (assoc-ref inputs "lua-lpeg"))
103 (lua-version ,(version-major+minor (package-version lua)))
104 (LUA_PATH (string-append lpeg "/share/lua/"
105 lua-version "/?.lua"))
106 (LUA_CPATH (string-append lpeg "/lib/lua/"
107 lua-version "/?.so")))
108 (wrap-program (string-append out "/bin/vis")
109 `("LUA_PATH" ":" prefix (,LUA_PATH))
110 `("LUA_CPATH" ":" prefix (,LUA_CPATH)))
37e64053
TGR
111 #t)))
112 (add-after 'wrap-binary 'check
113 (assoc-ref %standard-phases 'check))
114 (add-before 'check 'set-up-tests
115 (lambda* (#:key outputs #:allow-other-keys)
116 (let ((out (assoc-ref outputs "out")))
117 ;; DEFAULT_COMPILER is hard-coded here.
118 (substitute* "test/core/ccan-config.c"
119 (("\"cc\"")
120 (format #f "\"~a\"" ,(cc-for-target))))
121
122 ;; Use the ‘vis’ executable that we wrapped above.
123 (install-file (string-append out "/bin/vis") ".")
124
125 ;; XXX Delete 2 failing tests. TODO: make them not fail. :-)
126 (for-each delete-file
127 (find-files "test/vis/selections" "^complement"))
a2c1dcea 128 #t))))))
37e64053
TGR
129 (native-inputs
130 `(("vis-test"
131 ,(origin
132 (method git-fetch)
133 (uri (git-reference
134 (url "https://github.com/martanne/vis-test")
135 (commit "4c4f6645de77f697a45899e8645e0c2bbdc7208a")))
136 (sha256
137 (base32 "10vh1pxsqw88a5xwh5irkm85xr66dbycmgpmabyw9h0vm14cvcz2"))
138 (file-name (git-file-name "vis-test" version))))))
c695fb76
TGR
139 (inputs `(("lua" ,lua)
140 ("ncurses" ,ncurses)
141 ("libtermkey" ,libtermkey)
142 ("lua-lpeg" ,lua-lpeg)
852ba10a 143 ("tre" ,tre)))
a2c1dcea
JMSG
144 (synopsis "Vim-like text editor")
145 (description
146 "Vis aims to be a modern, legacy free, simple yet efficient vim-like text
147editor. It extends vim's modal editing with built-in support for multiple
148cursors/selections and combines it with sam's structural regular expression
149based command language.")
150 (home-page "https://github.com/martanne/vis")
151 (license (list license:isc ; Main distribution.
152 license:public-domain ; map.[ch]
153 license:expat)))) ; lexers and libutf.[ch]
5613ea79
CZ
154
155(define-public kakoune
fbe8ebec
TGR
156 (package
157 (name "kakoune")
1c63b397 158 (version "2020.08.04")
fbe8ebec
TGR
159 (source
160 (origin
161 (method url-fetch)
162 (uri (string-append "https://github.com/mawww/kakoune/"
163 "releases/download/v" version "/"
a1cb6928 164 "kakoune-" version ".tar.bz2"))
fbe8ebec 165 (sha256
1c63b397 166 (base32 "08gikjxyvcr415br1g1llzh5pnq737q55yinalb92cgq3yn9yih2"))))
fbe8ebec
TGR
167 (build-system gnu-build-system)
168 (arguments
169 `(#:make-flags
170 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
171 #:phases
172 (modify-phases %standard-phases
173 (add-after 'unpack 'patch-source
174 (lambda _
175 ;; kakoune uses confstr with _CS_PATH to find out where to find
176 ;; a posix shell, but this doesn't work in the build
177 ;; environment. This substitution just replaces that result
178 ;; with the "sh" path.
179 (substitute* "src/shell_manager.cc"
180 (("if \\(m_shell.empty\\(\\)\\)" line)
181 (string-append "m_shell = \"" (which "sh")
182 "\";\n " line)))
183 #t))
184 (delete 'configure) ; no configure script
1c63b397 185 ;; kakoune requires us to be in the src/ directory to build.
fbe8ebec
TGR
186 (add-before 'build 'chdir
187 (lambda _ (chdir "src") #t)))))
188 (native-inputs
189 `(("asciidoc" ,asciidoc)
190 ("pkg-config" ,pkg-config)
191 ("ruby" ,ruby)))
192 (inputs
73eacca8 193 `(("ncurses" ,ncurses)))
fbe8ebec
TGR
194 (synopsis "Vim-inspired code editor")
195 (description
196 "Kakoune is a code editor heavily inspired by Vim, as such most of its
5613ea79
CZ
197commands are similar to Vi's ones, and it shares Vi's \"keystrokes as a text
198editing language\" model. Kakoune has a strong focus on interactivity, most
199commands provide immediate and incremental results, while still being
200competitive (as in keystroke count) with Vim.")
27405497 201 (home-page "https://kakoune.org/")
fbe8ebec 202 (license license:unlicense)))
f255a6db
EB
203
204(define-public joe
205 (package
206 (name "joe")
bc111d39 207 (version "4.6")
f255a6db
EB
208 (source
209 (origin
210 (method url-fetch)
211 (uri (string-append "https://sourceforge.net/projects/joe-editor/"
212 "files/JOE sources/joe-" version "/"
213 "joe-" version ".tar.gz"))
214 (sha256
215 (base32
bc111d39 216 "1pmr598xxxm9j9dl93kq4dv36zyw0q2dh6d7x07hf134y9hhlnj9"))))
f255a6db
EB
217 (build-system gnu-build-system)
218 (inputs `(("ncurses" ,ncurses)))
219 (home-page "http://joe-editor.sourceforge.net/")
220 (synopsis "Console screen editor")
221 (description
7904f18a
EB
222 "JOE is a powerful console screen editor with a \"mode-less\" user
223interface similar to many user-friendly editors. JOE has some of the key
224bindings and many of the powerful features of GNU Emacs.")
f255a6db 225 (license license:gpl3+)))
0bf11648 226
28264388
MB
227(define-public jucipp
228 (package
229 (name "jucipp")
ef64f9ca 230 (version "1.6.0")
28264388
MB
231 (home-page "https://gitlab.com/cppit/jucipp")
232 (source (origin
233 (method git-fetch)
234 (uri (git-reference (url home-page)
235 (commit (string-append "v" version))
236 ;; Two submodules are required which are
237 ;; developed alongside JuCi++ and difficult
238 ;; to package separately.
239 (recursive? #t)))
240 (file-name (git-file-name name version))
241 (sha256
ef64f9ca 242 (base32 "177myy6qvjlb6j3f3i3xmfml5r3p9in8xzpvm0n59dn56s81gpnr"))))
28264388
MB
243 (build-system cmake-build-system)
244 (arguments
245 `(#:configure-flags '("-DBUILD_TESTING=ON"
246
247 ;; These arguments are here to facilitate an "in-source"
248 ;; build using "./build" instead of the default "../build".
249 ;; The test suite expects that to be the case.
250 "..")
251 #:out-of-source? #f
252 #:phases (modify-phases %standard-phases
253 (add-before 'configure 'enter-build-directory
254 (lambda _
255 (mkdir "build")
256 (chdir "build")
257 #t))
258
28264388
MB
259 (add-after 'unpack 'patch-tiny-process-library
260 (lambda _
261 (with-directory-excursion "lib/tiny-process-library"
262 (substitute* '("process_unix.cpp"
263 "tests/io_test.cpp")
264 (("/bin/sh") (which "sh"))))
265 #t))
266 (add-after 'unpack 'disable-git-test
267 (lambda _
268 (substitute* "tests/CMakeLists.txt"
269 ;; Disable the git test, as it requires the full checkout.
270 (("add_test\\(git_test.*\\)") ""))
271 #t))
272 (add-before 'check 'pre-check
273 (lambda* (#:key inputs #:allow-other-keys)
274 ;; Tests do not expect HOME to be empty.
275 (setenv "HOME" "/etc")
276
277 ;; Most tests require an X server.
278 (let ((xorg-server (assoc-ref inputs "xorg-server"))
279 (display ":1"))
280 (setenv "DISPLAY" display)
281 (system (string-append xorg-server "/bin/Xvfb "
282 display " &")))
7e9544c3
MB
283 #t))
284 (add-after 'install 'wrap
285 (lambda* (#:key inputs outputs #:allow-other-keys)
286 ;; The package needs GTK+ and GtkSourceView on XDG_DATA_DIRS
287 ;; for syntax highlighting to work. shared-mime-info is
288 ;; necessary for MIME handling.
289 ;; XXX: Ideally we'd reuse glib-or-gtk-wrap here, but it
290 ;; does not pick up $gtksourceview/share/gtksourceview-3.0.
291 (let ((out (assoc-ref outputs "out"))
292 (gtk+ (assoc-ref inputs "gtk+"))
293 (gtksourceview (assoc-ref inputs "gtksourceview"))
294 (shared-mime-info (assoc-ref inputs "shared-mime-info")))
295 (wrap-program (string-append out "/bin/juci")
296 `("XDG_DATA_DIRS" ":" prefix
297 (,(string-join
298 (map (lambda (pkg)
299 (string-append pkg "/share"))
300 (list out gtk+ gtksourceview shared-mime-info))
301 ":"))))
302 #t))))))
28264388
MB
303 (native-inputs
304 `(("pkg-config" ,pkg-config)
305 ("xorg-server" ,xorg-server-for-tests)))
306 (inputs
307 `(("aspell" ,aspell)
308 ("boost" ,boost)
ef64f9ca 309 ("ctags" ,universal-ctags)
28264388
MB
310 ("gtkmm" ,gtkmm)
311 ("gtksourceviewmm" ,gtksourceviewmm)
dd61cd85 312 ("libclang" ,clang-10) ;XXX: must be the same version as Mesas LLVM
28264388
MB
313 ("libgit2" ,libgit2)))
314 (synopsis "Lightweight C++ IDE")
315 (description
316 "juCi++ is a small @dfn{IDE} (Integrated Development Environment)
317designed especially towards libclang with speed, stability, and ease of use
318in mind.
319
320It supports autocompletion, on-the-fly warnings and errors, syntax
321highlighting, and integrates with Git as well as the CMake and Meson build
322systems.")
323 (license license:expat)))
324
0bf11648
FS
325(define-public leafpad
326 (package
327 (name "leafpad")
328 (version "0.8.18.1")
329 (source (origin
330 (method url-fetch)
b7fd77ef 331 (uri (string-append "mirror://savannah/"
0bf11648
FS
332 "leafpad/leafpad-" version ".tar.gz"))
333 (sha256
334 (base32
335 "0b0az2wvqgvam7w0ns1j8xp2llslm1rx6h7zcsy06a7j0yp257cm"))))
4f038621 336 (build-system glib-or-gtk-build-system)
0bf11648
FS
337 (native-inputs
338 `(("intltool" ,intltool)
339 ("pkg-config" ,pkg-config)))
340 (inputs
341 `(("gtk+" ,gtk+-2)))
dde5831c 342 (home-page "http://tarot.freeshell.org/leafpad/")
0bf11648
FS
343 (synopsis "GTK+ based text editor")
344 (description "Leafpad is a GTK+ text editor that emphasizes simplicity. As
345development focuses on keeping weight down to a minimum, only the most essential
346features are implemented in the editor. Leafpad is simple to use, is easily
347compiled, requires few libraries, and starts up quickly. ")
348 (license license:gpl2+)))
3312fda0 349
350(define-public e3
351 (package
352 (name "e3")
353 (version "2.82")
354 (source (origin
355 (method url-fetch)
356 (uri (string-append "https://sites.google.com/site/e3editor/Home/"
357 "e3-" version ".tgz"))
358 (sha256
359 (base32
360 "0919kadkas020maqq37852isnzp053q2fnws2zh3mz81d1jiviak"))
361 (modules '((guix build utils)))
362
363 ;; Remove pre-built binaries.
6cbee49d
MW
364 (snippet '(begin
365 (delete-file-recursively "bin")
366 #t))))
3312fda0 367 (build-system gnu-build-system)
368 (arguments
369 `(#:tests? #f
370 #:make-flags (list (string-append "PREFIX="
371 (assoc-ref %outputs "out")))
372 #:phases (modify-phases %standard-phases
373 (delete 'configure))))
374 (native-inputs
375 `(("nasm" ,nasm)))
376 (home-page "https://sites.google.com/site/e3editor/")
377 (synopsis "Tiny text editor written in assembly")
378 (description
379 "e3 is a micro text editor with an executable code size between 3800 and
38035000 bytes. Except for ``syntax highlighting'', the e3 binary supports all
381of the basic functions one expects plus built in arithmetic calculations.
382UTF-8 coding of unicode characters is supported as well. e3 can use
383Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings. e3 can be used on
38416, 32, and 64-bit CPUs.")
385 (supported-systems '("x86_64-linux" "i686-linux"))
386 (license license:gpl2+)))
bcd757fd
LC
387
388(define-public mg
389 (package
390 (name "mg")
77100119 391 (version "20180927")
bcd757fd 392 (source (origin
a4d8b386
TGR
393 (method git-fetch)
394 (uri (git-reference
395 (url "https://github.com/hboetes/mg")
396 (commit version)))
397 (file-name (git-file-name name version))
bcd757fd
LC
398 (sha256
399 (base32
77100119 400 "14vrm8lvwksf697sqks7xfd1xaqjlqjc9afjk33sksq5p27wr203"))
bcd757fd 401 (modules '((guix build utils)))
6cbee49d
MW
402 (snippet '(begin
403 (substitute* "GNUmakefile"
404 (("/usr/bin/") ""))
405 #t))))
bcd757fd
LC
406 (build-system gnu-build-system)
407 (native-inputs
408 `(("pkg-config" ,pkg-config)))
409 (inputs
410 `(("libbsd" ,libbsd)
411 ("ncurses" ,ncurses)))
412 (arguments
413 ;; No test suite available.
414 '(#:tests? #f
415 #:make-flags (list (string-append "prefix=" %output)
bcd757fd
LC
416 "CC=gcc")
417 #:phases (modify-phases %standard-phases
a4d8b386 418 (delete 'configure) ; no configure script
217ce570 419 (add-before 'build 'correct-location-of-difftool
420 (lambda _
421 (substitute* "buffer.c"
422 (("/usr/bin/diff")
423 (which "diff")))
424 #t))
bcd757fd
LC
425 (add-before 'install 'patch-tutorial-location
426 (lambda* (#:key outputs #:allow-other-keys)
427 (substitute* "mg.1"
428 (("/usr") (assoc-ref outputs "out")))
429 #t))
430 (add-after 'install 'install-tutorial
431 (lambda* (#:key outputs #:allow-other-keys)
432 (let* ((out (assoc-ref outputs "out"))
433 (doc (string-append out "/share/doc/mg")))
434 (install-file "tutorial" doc)
435 #t))))))
c3d82885 436 (home-page "https://homepage.boetes.org/software/mg/")
bcd757fd
LC
437 (synopsis "Microscopic GNU Emacs clone")
438 (description
16fcca64
TGR
439 "Mg (@command{mg}) is a GNU Emacs style editor, with which it is
440\"broadly\" compatible. This is a portable version of the mg maintained by the
441OpenBSD team.")
bcd757fd 442 (license license:public-domain)))
04918a00 443
3fad9a69
NG
444(define-public qemacs
445 (package
446 (name "qemacs")
447 (version "0.3.3")
448 (source
449 (origin
450 (method url-fetch)
451 (uri (string-append "https://bellard.org/qemacs/"
452 "qemacs-" version ".tar.gz"))
453 (sha256
454 (base32 "156z4wpj49i6j388yjird5qvrph7hz0grb4r44l4jf3q8imadyrg"))))
455 (build-system gnu-build-system)
456 (arguments
457 `(#:tests? #f ;no test
458 #:phases
459 (modify-phases %standard-phases
460 (add-before 'build 'build-qhtml
461 ;; Build fails without first creating qHTML library.
462 (lambda _ (invoke "make" "-C" "libqhtml")))
463 (add-before 'install 'fix-man-pages-directory
464 ;; Install in $out/share/man instead of $out/man.
465 (lambda _
466 (substitute* "Makefile"
467 (("/man/man1" all) (string-append "/share" all)))
468 #t))
469 (add-before 'install 'create-directories
470 ;; Ensure directories exist before installing files.
471 (lambda* (#:key outputs #:allow-other-keys)
472 (let ((out (assoc-ref outputs "out")))
473 (for-each (lambda (d) (mkdir-p (string-append out d)))
474 '("/bin" "/share/man/man1" "/share/qe"))
475 #t)))
476 (add-after 'install 'install-extra-documentation
477 ;; Install sample configuration file, Info, and HTML manual.
478 (lambda* (#:key outputs #:allow-other-keys)
479 (let* ((share (string-append (assoc-ref outputs "out") "/share"))
480 (doc (string-append share "/doc/" ,name "-" ,version))
481 (html (string-append share "/html"))
482 (info (string-append share "/info"))
483 (makeinfo (string-append (assoc-ref %build-inputs "texinfo")
484 "/bin/makeinfo")))
485 ;; First fix Texinfo documentation, create appropriate
486 ;; directories, then generate Info and HTML files there.
487 (substitute* "qe-doc.texi"
488 (("^M-([{}])" _ bracket) (string-append "M-@" bracket)))
489 (for-each (lambda (d) (mkdir-p d)) (list html info))
490 (invoke makeinfo "qe-doc.texi" "-o" info)
491 (invoke makeinfo "qe-doc.texi" "--html" "--no-split" "-o" html)
492 ;; Install sample configuration file.
493 (install-file "config.eg" doc)
494 #t))))))
495 (native-inputs
496 `(("texinfo" ,texinfo)))
497 (inputs
498 `(("libx11" ,libx11)
499 ("libxext" ,libxext)
500 ("libxv" ,libxv)))
501 (home-page "https://bellard.org/qemacs/")
502 (synopsis "Small but powerful text editor")
503 (description "QEmacs (for Quick Emacs) is a very small but
504powerful editor. It has features that even big editors lack:
505
506@itemize
507
508@item Full screen editor with an Emacs look and feel with all Emacs
509common features: multi-buffer, multi-window, command mode, universal
510argument, keyboard macros, config file with C-like syntax, minibuffer
511with completion and history.
512
513@item Can edit files of hundreds of Megabytes without being slow by
514using a highly optimized internal representation and by mmaping the
515file.
516
517@item Full Unicode support, including multi charset handling (8859-x,
518UTF8, SJIS, EUC-JP, ...) and bidirectional editing respecting the
519Unicode bidi algorithm. Arabic and Indic scripts handling (in
520progress).
521
522@item WYSIWYG HTML/XML/CSS2 mode graphical editing. Also supports
523Lynx like rendering on VT100 terminals.
524
525@item WYSIWYG DocBook mode based on XML/CSS2 renderer.
526
527@item C mode: coloring with immediate update. Emacs like auto-indent.
528
529@item Shell mode: colorized VT100 emulation so that your shell work
530exactly as you expect. Compile mode with next/prev error.
531
532@item Input methods for most languages, including Chinese (input
533methods come from the Yudit editor).
534
535@item Hexadecimal editing mode with insertion and block commands.
536Unicode hexa editing is also supported.
537
538@item Works on any VT100 terminals without termcap. UTF8 VT100
539support included with double width glyphs.
540
541@item X11 support. Support multiple proportional fonts at the same
542time (as XEmacs). X Input methods supported. Xft extension supported
543for anti aliased font display.
544
545@item Small! Full version (including HTML/XML/CSS2/DocBook rendering
546and all charsets): 200KB big. Basic version (without bidir/unicode
547scripts/input/X11/C/Shell/HTML/Dired): 49KB.
548@end itemize")
549 (license license:lgpl2.1+)))
550
04918a00
EB
551(define-public ghostwriter
552 (package
553 (name "ghostwriter")
d9240c70 554 (version "1.8.1")
04918a00
EB
555 (source (origin
556 (method git-fetch)
557 (uri (git-reference
b0e7b699 558 (url "https://github.com/wereturtle/ghostwriter")
04918a00
EB
559 (commit (string-append "v" version))))
560 (file-name (git-file-name name version))
561 (sha256
562 (base32
d9240c70 563 "0jc6szfh5sdnafhwsr1xv7cn1fznniq58bix41hb9wlbkvq7wzi6"))))
04918a00
EB
564 (build-system gnu-build-system)
565 (native-inputs
566 `(("pkg-config" ,pkg-config)
58ab7f29 567 ("qttools" ,qttools))) ; for lrelease
04918a00
EB
568 (inputs
569 `(("hunspell" ,hunspell)
570 ("qtbase" ,qtbase)
89d3869b 571 ("qtdeclarative" ,qtdeclarative)
04918a00 572 ("qtmultimedia" ,qtmultimedia)
89d3869b 573 ("qtquickcontrols" ,qtquickcontrols)
04918a00 574 ("qtsvg" ,qtsvg)
89d3869b
EB
575 ("qtwebchannel" ,qtwebchannel)))
576 (propagated-inputs ; To get native-search-path
577 `(("qtwebengine" ,qtwebengine)))
04918a00
EB
578 (arguments
579 `(#:phases
580 (modify-phases %standard-phases
581 (replace 'configure
582 (lambda* (#:key outputs #:allow-other-keys)
583 (let ((out (assoc-ref outputs "out")))
584 (invoke "qmake" (string-append "PREFIX=" out)))))
585 (add-after 'configure 'create-translations
586 (lambda _
587 ;; `lrelease` will not overwrite, so delete existing .qm files
588 (for-each delete-file (find-files "translations" ".*\\.qm"))
589 (apply invoke "lrelease" (find-files "translations" ".*\\.ts"))))
590 ;; Ensure that icons are found at runtime.
591 (add-after 'install 'wrap-executable
592 (lambda* (#:key inputs outputs #:allow-other-keys)
593 (let ((out (assoc-ref outputs "out")))
594 (wrap-program (string-append out "/bin/ghostwriter")
595 `("QT_PLUGIN_PATH" ":" prefix
596 ,(map (lambda (label)
597 (string-append (assoc-ref inputs label)
598 "/lib/qt5/plugins/"))
599 '("qtsvg" "qtmultimedia"))))))))))
600 (home-page "https://wereturtle.github.io/ghostwriter/")
601 (synopsis "Write without distractions")
602 (description
603 "@code{ghostwriter} provides a relaxing, distraction-free writing
604environment with Markdown markup.")
58ab7f29 605 (license license:gpl3+))) ; icons/* under CC-BY-SA3
2238211a 606
1fffba66
NG
607(define-public manuskript
608 (package
609 (name "manuskript")
d5a08205 610 (version "0.11.0")
1fffba66
NG
611 (source
612 (origin
613 (method git-fetch)
614 (uri (git-reference
b0e7b699 615 (url "https://github.com/olivierkes/manuskript")
1fffba66
NG
616 (commit version)))
617 (file-name (git-file-name name version))
618 (sha256
d5a08205 619 (base32 "1l6l9k6k69yv8xqpll0zv9cwdqqg4zvxy90l6sx5nv2yywh5crla"))))
1fffba66
NG
620 (build-system python-build-system)
621 (arguments
622 `(#:tests? #f ;no test
623 #:phases
624 (modify-phases %standard-phases
625 (delete 'configure)
626 (delete 'build)
627 (replace 'install
628 (lambda* (#:key outputs #:allow-other-keys)
629 (let* ((out (assoc-ref outputs "out"))
630 (share (string-append out "/share/manuskript")))
631 ;; Install data.
632 (mkdir-p share)
633 (for-each
634 (lambda (d)
635 (let ((destination (string-append share "/" d)))
636 (mkdir-p destination)
637 (copy-recursively d destination)))
638 '("bin" "i18n" "icons" "libs" "manuskript" "resources"))
639 ;; Install documentation.
640 (let ((doc (string-append out
641 "/doc/manuskript-" ,version
642 "/sample-projects")))
643 (mkdir-p doc)
644 (copy-recursively "sample-projects" doc))
645 ;; Wrap executable in "$out/share/manuskript/bin" and
646 ;; link to it from "$out/bin".
647 (let ((bin (string-append out "/bin"))
648 (executable (string-append share "/bin/manuskript")))
649 (wrap-program executable
650 (list "PYTHONPATH" 'prefix (list (getenv "PYTHONPATH"))))
651 (mkdir-p bin)
652 (with-directory-excursion bin
653 (symlink (string-append share "/bin/manuskript")
654 "manuskript")))
655 ;; Install icons and create .desktop file.
656 (let ((apps (string-append out "/share/applications"))
657 (icons-dir (string-append out "/share/pixmaps")))
658 (install-file "icons/Manuskript/manuskript.svg" icons-dir)
659 (mkdir-p apps)
660 (with-output-to-file (string-append apps "/manuskript.desktop")
661 (lambda _
662 (format #t
663 "[Desktop Entry]~@
664 Name=Manuskript~@
665 MimeType=application/x-manuskript-book;~@
666 Exec=~a/bin/manuskript %f~@
667 Comment=Tool for writers~@
668 Comment[es]=Herramienta para escritores/as~@
669 Keywords=manuskript;office;write;edit;novel;text;msk~@
670 Terminal=false~@
671 Type=Application~@
672 Icon=manuskript~@
673 Categories=Office;WordProcessor;~%"
674 out))))
675 #t))))))
676 (inputs
677 `(("ghc-pandoc" ,ghc-pandoc)
678 ("python-lxml" ,python-lxml)
679 ("python-markdown" ,python-markdown)
680 ("python-pyqt" ,python-pyqt)
681 ("qtsvg" ,qtsvg)))
682 (home-page "http://www.theologeek.ch/manuskript/")
683 (synopsis "Tool for writers")
684 (description "Manuskript provides a rich environment to help
685writers create their first draft and then further refine and edit
686their masterpiece. With Manuskript you can:
687
688@itemize
689@item Grow your premise from one sentence, to a paragraph, to a full
690summary,
691@item Create characters,
692@item Conceive plots,
693@item Construct outlines (Outline mode and/or Index cards),
694@item Write with focus (Distraction free mode),
695@item Build worlds,
696@item Track items,
697@item Edit and re-organize chapters and scenes,
698@item View Story line,
699@item Compose with fiction or non-fiction templates and writing modes,
700@item Import and export document formats such as HTML, ePub,
701OpenDocument, DocX, and more.
702@end itemize
703
704Additionally Manuskript can help in many more ways with a spell
705checker, markdown highlighter, frequency analyzer, and automatic save
706in plain text file format.")
707 (license license:gpl3+)))
708
2238211a
EF
709(define-public editorconfig-core-c
710 (package
711 (name "editorconfig-core-c")
712 (version "0.12.3")
713 (source
714 (origin
715 (method git-fetch)
716 (uri (git-reference
b0e7b699 717 (url "https://github.com/editorconfig/editorconfig-core-c")
2238211a
EF
718 (commit (string-append "v" version))))
719 (file-name (git-file-name name version))
720 (sha256
721 (base32
722 "0jkc69r4jwn4rih6h6cqvgljjc3ff49cxj8286mi515aczr48cm1"))))
723 (build-system cmake-build-system)
724 (arguments
725 '(#:phases
726 (modify-phases %standard-phases
727 (add-after 'unpack 'insert-tests
728 (lambda* (#:key inputs #:allow-other-keys)
729 (let ((tests (assoc-ref inputs "tests")))
730 (copy-recursively tests "tests"))
731 #t)))))
732 (native-inputs
733 `(("tests" ,(origin
734 (method git-fetch)
735 (uri (git-reference
736 (url "https://github.com/editorconfig/editorconfig-core-test")
737 (commit "6ea1d8ece62cac9cf72c79dce4879b046abe1fe7"))) ; matches version
738 (file-name (git-file-name "editorconfig-core-test" version))
739 (sha256
740 (base32
741 "1sf6910idnd4bgzbj8w8f9ldsbkaqa0lh6syymwy3hfqda63acj7"))))))
742 (inputs
743 `(("pcre2" ,pcre2)))
744 (home-page "https://editorconfig.org/")
745 (synopsis "EditorConfig core library written in C")
746 (description "EditorConfig makes it easy to maintain the correct coding
747style when switching between different text editors and between different
748projects. The EditorConfig project maintains a file format and plugins for
749various text editors which allow this file format to be read and used by those
750editors.")
751 (license license:bsd-2)))
75a137da
AE
752
753(define-public texmacs
754 (package
755 (name "texmacs")
eaf5df6b 756 (version "1.99.13")
75a137da
AE
757 (source
758 (origin
759 (method url-fetch)
760 (uri (string-append "https://www.texmacs.org/Download/ftp/tmftp/"
761 "source/TeXmacs-" version "-src.tar.gz"))
762 (sha256
eaf5df6b 763 (base32 "1d590yyanh2ar88pd0ns4mf616bq1lq4cwg93m863anhir5irb82"))))
75a137da
AE
764 (build-system gnu-build-system)
765 (native-inputs
eaf5df6b
NG
766 `(("pkg-config" ,pkg-config)
767 ("xdg-utils" ,xdg-utils))) ;for xdg-icon-resource
75a137da
AE
768 (inputs
769 `(("freetype" ,freetype)
770 ("guile" ,guile-1.8)
771 ("perl" ,perl)
772 ("python" ,python-wrapper)
eaf5df6b 773 ("qt" ,qtbase)))
75a137da 774 (arguments
ad9fd1ba 775 `(#:tests? #f ; no check target
75a137da
AE
776 #:phases
777 (modify-phases %standard-phases
eaf5df6b
NG
778 (add-after 'unpack 'fix-icon-directory
779 (lambda* (#:key outputs #:allow-other-keys)
780 (let ((out (assoc-ref outputs "out")))
781 (substitute* "packages/linux/icons.sh"
782 (("/usr/share")
783 (string-append out "/share")))
784 #t)))
75a137da
AE
785 (add-before 'configure 'gzip-flags
786 (lambda _
787 (substitute* "Makefile.in"
788 (("^GZIP = gzip -f") "GZIP = gzip -f -n")))))))
789 (synopsis "Editing platform with special features for scientists")
790 (description
791 "GNU TeXmacs is a text editing platform which is specialized for
eaf5df6b
NG
792scientists. It is ideal for editing structured documents with different types
793of content. It has robust support for mathematical formulas and plots. It
794can also act as an interface to external mathematical programs such as R and
795Octave. TeXmacs is completely extensible via Guile.")
75a137da
AE
796 (license license:gpl3+)
797 (home-page "https://www.texmacs.org/tmweb/home/welcome.en.html")))
c55cd98c
NG
798
799(define-public scintilla
800 (package
801 (name "scintilla")
ab4943a7 802 (version "4.4.4")
3e6cb583
NG
803 (source
804 (origin
805 (method url-fetch)
806 (uri (let ((v (apply string-append (string-split version #\.))))
807 (string-append "https://www.scintilla.org/scintilla" v ".tgz")))
808 (sha256
ab4943a7 809 (base32 "1zjsb6iiqi4cw9r9md3xv8qyy86ssz11p680xn7vmllrxshxvs8y"))))
c55cd98c
NG
810 (build-system gnu-build-system)
811 (arguments
812 `(#:make-flags (list "GTK3=1" "CC=gcc" "-Cgtk")
813 #:tests? #f ;require un-packaged Pyside
814 #:phases
815 (modify-phases %standard-phases
816 (delete 'configure) ;no configure script
c55cd98c 817 (replace 'install
b2dbc53e 818 ;; Upstream provides no install script.
c55cd98c
NG
819 (lambda* (#:key outputs #:allow-other-keys)
820 (let* ((out (assoc-ref outputs "out"))
821 (lib (string-append out "/lib"))
822 (include (string-append out "/include")))
b2dbc53e
NG
823 (for-each (lambda (f) (install-file f lib))
824 (find-files "bin/" "\\.so$"))
c55cd98c
NG
825 (for-each (lambda (f) (install-file f include))
826 (find-files "include/" "."))
827 #t))))))
828 (native-inputs
dee632a8
NG
829 `(("pkg-config" ,pkg-config)
830 ("python" ,python-wrapper)))
c55cd98c
NG
831 (inputs
832 `(("gtk+" ,gtk+)))
833 (home-page "https://www.scintilla.org/")
834 (synopsis "Code editor for GTK+")
835 (description "Scintilla is a source code editing component for
836GTK+. It has the usual features found in text editing components, as
837well as some that are especially useful for editing and debugging
838source code; these include support for syntax styling, error
839indicators, code completion and call tips. Styling choices are more
840open than with many editors: Scintilla lets you use proportional
841fonts, bold and italics, multiple foreground and background colours,
842and multiple fonts.")
843 (license license:hpnd)))
2363ed01
NG
844
845(define-public geany
846 (package
847 (name "geany")
40e513fe 848 (version "1.36")
9e03ddc5
NG
849 (source
850 (origin
851 (method url-fetch)
852 (uri (string-append "https://download.geany.org/"
853 "geany-" version ".tar.bz2"))
854 (sha256
855 (base32 "0gnm17cr4rf3pmkf0axz4a0fxwnvp55ji0q0lzy88yqbshyxv14i"))))
2363ed01
NG
856 (build-system gnu-build-system)
857 (native-inputs
858 `(("autoconf" ,autoconf)
859 ("automake" ,automake)
860 ("doxygen" ,doxygen)
861 ("glib" ,glib "bin")
862 ("intltool" ,intltool)
863 ("libtool" ,libtool)
864 ("pkg-config" ,pkg-config)
865 ("python-docutils" ,python-docutils))) ;for rst2html
866 (inputs
867 `(("gtk+" ,gtk+)
9e03ddc5
NG
868 ;; FIXME: Geany bundles a 3.X release of Scintilla. It is not
869 ;; currently possible to replace it with our Scintilla package.
870 ;; ("scintilla" ,scintilla)
871 ))
2363ed01 872 (arguments
f3ed5297
NG
873 `(#:imported-modules ((guix build glib-or-gtk-build-system)
874 ,@%gnu-build-system-modules)
875 #:modules (((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
876 (guix build gnu-build-system)
877 (guix build utils))
878 #:phases
2363ed01 879 (modify-phases %standard-phases
f3ed5297
NG
880 (add-after 'install 'glib-or-gtk-wrap
881 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
2363ed01
NG
882 (home-page "https://www.geany.org")
883 (synopsis "Fast and lightweight IDE")
884 (description "Geany is a small and fast Integrated Development
885Environment (IDE) that only has a few dependencies on other packages and is as
886independent as possible from special desktop environments like KDE or GNOME.
887
888The basic features of Geany are:
889@itemize
890@item syntax highlighting
891@item code completion
892@item auto completion of often constructed constructs like if, for and while
893@item auto completion of XML and HTML tags
894@item call tips
895@item folding
896@item many supported filetypes like C, Java, PHP, HTML, Python, Perl, Pascal
897@item symbol lists
898@item embedded terminal emulation
899@item extensibility through plugins
900@end itemize")
901 (license license:gpl2+)))
2207d522
NG
902
903(define-public fe
904 (package
905 (name "fe")
906 ;; Stable release is 1.8. However, this development version
907 ;; introduces support for UTF-8.
908 (version "2.0")
909 (source (origin
910 (method url-fetch)
911 (uri (string-append "http://www.moria.de/~michael/fe/"
912 "fe-" version ".tar.gz"))
913 (sha256
914 (base32
915 "1hwws7si1752z6hp61zxznvgsb6846lp8zl1hn5ddhsbafwalwb9"))))
916 (build-system gnu-build-system)
917 (arguments
918 `(#:tests? #f ;no test
919 ;; Sendmail is only used to send a crash log. Disable the
920 ;; feature since it is (1) undocumented (2) not very useful.
921 #:configure-flags (list "--disable-sendmail")
922 #:phases
923 (modify-phases %standard-phases
924 (add-after 'install 'install-doc
925 (lambda* (#:key outputs #:allow-other-keys)
926 (let* ((out (assoc-ref outputs "out"))
927 (doc (string-append out "/share/doc/" ,name "-" ,version)))
928 (for-each (lambda (f) (install-file f doc))
929 '("fe.doc" "fe.html" "fe.ps" "feref.ps" "README"))
930 #t))))))
931 (native-inputs
932 `(("gettext" ,gettext-minimal)))
933 (inputs
934 `(("ncurses" ,ncurses)))
935 (home-page "http://www.moria.de/~michael/fe/")
936 (synopsis "Small folding editor")
eee98f96 937 (description "Fe is a small folding editor. It folds
2207d522
NG
938arbitrary text regions; it is not bound to syntactic units.
939
940Fe has no configuration or extension language and requires no setup.
99ce2055 941Its user interface is emacs-like and it has menus for the very most
2207d522
NG
942important functions to help beginners. Further there is a reference
943card. It offers:
944
945@itemize
946@item Regions and Emacs-like kill ring
947@item Incremental search
948@item Keyboard macros
949@item Editing binary files
950@item Multiple windows and views
951@item Compose function for Latin 1 characters
952@end itemize")
953 (license license:gpl2+)))
a78364e9
DM
954
955(define-public ne
956 (package
957 (name "ne")
958 (version "3.2.1")
959 (source (origin
960 (method git-fetch)
961 (uri (git-reference
b0e7b699 962 (url "https://github.com/vigna/ne")
a78364e9
DM
963 (commit version)))
964 (file-name (git-file-name name version))
965 (sha256
966 (base32
967 "0h6d08cnwrk96ss83i9bragwwanph6x54sm3ak1z81146dsqsiif"))))
968 (build-system gnu-build-system)
969 (native-inputs
970 `(("perl" ,perl)
971 ("texinfo" ,texinfo)))
972 (inputs
973 `(("ncurses" ,ncurses)))
974 (arguments
975 `(#:tests? #f
976 #:make-flags
977 (list "CC=gcc"
978 (string-append "PREFIX=" (assoc-ref %outputs "out"))
979 (string-append "LDFLAGS=-L" (assoc-ref %build-inputs "ncurses")
980 "/lib"))
981 #:phases
982 (modify-phases %standard-phases
983 (replace 'configure
984 (lambda _
985 (substitute* "src/makefile"
986 (("-lcurses") "-lncurses"))
987 #t)))))
988 (home-page "http://ne.di.unimi.it/")
989 (synopsis "Text editor with menu bar")
990 (description "This package provides a modeless text editor with menu bar.
991It supports syntax highlighting, regular expressions, configurable menus,
992keybindings, autocomplete and unlimited undo. It can pipe a marked block
993of text through any command line filter. It can also open very large binary
994files. It was originally developed on the Amiga 3000T.")
995 (license license:gpl3+)))
8b95f741
T
996
997(define-public hexer
998 (package
999 (name "hexer")
1000 (version "1.0.6")
1001 (source
1002 (origin
1003 (method url-fetch)
1004 (uri (string-append "https://devel.ringlet.net/files/editors/hexer/"
1005 "hexer-" version ".tar.xz"))
1006 (sha256
1007 (base32 "157z17z8qivdin2km2wp86x1bv1nx15frrwcz11mk0l3ab74mf76"))))
1008 (build-system gnu-build-system)
1009 (arguments
1010 `(#:tests? #f ;no upstream tests
1011 #:make-flags
1012 (list "CC=gcc"
1013 (string-append "PREFIX=" (assoc-ref %outputs "out"))
1014 (string-append "LTERMCAP=-lncurses")
1015 (string-append "LDFLAGS=-L" (assoc-ref %build-inputs "ncurses")
1016 "/lib"))
1017 #:phases
1018 (modify-phases %standard-phases
1019 (delete 'configure)))) ;no configure script
1020 (inputs
1021 `(("ncurses" ,ncurses)))
1022 (home-page "https://devel.ringlet.net/editors/hexer/")
1023 (synopsis "Multi buffer editor for binary files with vi-like interface")
1024 (description "Hexer is a multi-buffer editor for binary files for Unix-like
1025systems that displays its buffer(s) as a hex dump. The user interface is kept
1026similar to vi/ex.")
1027 (license license:bsd-3)))