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