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