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