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