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