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