gnu: tar: Work around a cross-compilation issue.
[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 Eric Bavier <bavier@member.fsf.org>
5 ;;; Copyright © 2017 Feng Shu <tumashu@163.com>
6 ;;; Copyright © 2017 Nils Gillmann <ng0@n0.is>
7 ;;; Copyright © 2014 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.org>
8 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages text-editors)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix utils)
30 #:use-module (guix build-system gnu)
31 #:use-module (guix build-system glib-or-gtk)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages assembly)
35 #:use-module (gnu packages boost)
36 #:use-module (gnu packages documentation)
37 #:use-module (gnu packages gcc)
38 #:use-module (gnu packages glib)
39 #:use-module (gnu packages gtk)
40 #:use-module (gnu packages libbsd)
41 #:use-module (gnu packages libreoffice)
42 #:use-module (gnu packages lua)
43 #:use-module (gnu packages ncurses)
44 #:use-module (gnu packages pkg-config)
45 #:use-module (gnu packages qt)
46 #:use-module (gnu packages regex)
47 #:use-module (gnu packages ruby)
48 #:use-module (gnu packages terminals)
49 #:use-module (gnu packages xml))
50
51 (define-public vis
52 (package
53 (name "vis")
54 (version "0.5")
55 (source (origin
56 (method url-fetch)
57 (uri (string-append "https://github.com/martanne/"
58 name "/archive/v" version ".tar.gz"))
59 (file-name (string-append name "-" version ".tar.gz"))
60 (sha256
61 (base32
62 "1xbxb3q963s6sav63yw0x30lm0wvxsrzb7hr6a7dh4f8r7mp1skp"))))
63 (build-system gnu-build-system)
64 (arguments
65 `(#:test-target "test"
66 #:tests? #f ; no releases; snapshots are missing tests
67 #:phases
68 (modify-phases %standard-phases
69 (add-after 'install 'wrap-binary
70 (lambda* (#:key inputs outputs #:allow-other-keys)
71 (let* ((out (assoc-ref outputs "out"))
72 (lpeg (assoc-ref inputs "lua-lpeg"))
73 (lua-version ,(version-major+minor (package-version lua)))
74 (LUA_PATH (string-append lpeg "/share/lua/"
75 lua-version "/?.lua"))
76 (LUA_CPATH (string-append lpeg "/lib/lua/"
77 lua-version "/?.so")))
78 (wrap-program (string-append out "/bin/vis")
79 `("LUA_PATH" ":" prefix (,LUA_PATH))
80 `("LUA_CPATH" ":" prefix (,LUA_CPATH)))
81 #t))))))
82 (native-search-paths
83 (list (search-path-specification
84 (variable "VIS_PATH")
85 (files '("share/vis")))))
86 (inputs `(("lua" ,lua)
87 ("ncurses" ,ncurses)
88 ("libtermkey" ,libtermkey)
89 ("lua-lpeg" ,lua-lpeg)
90 ("tre" ,tre)))
91 (synopsis "Vim-like text editor")
92 (description
93 "Vis aims to be a modern, legacy free, simple yet efficient vim-like text
94 editor. It extends vim's modal editing with built-in support for multiple
95 cursors/selections and combines it with sam's structural regular expression
96 based command language.")
97 (home-page "https://github.com/martanne/vis")
98 (license (list license:isc ; Main distribution.
99 license:public-domain ; map.[ch]
100 license:expat)))) ; lexers and libutf.[ch]
101
102 (define-public kakoune
103 (package
104 (name "kakoune")
105 (version "2018.04.13")
106 (source
107 (origin
108 (method url-fetch)
109 (uri (string-append "https://github.com/mawww/kakoune/"
110 "releases/download/v" version "/"
111 name "-" version ".tar.bz2"))
112 (sha256
113 (base32
114 "1kkzs5nrjxzd1jq7a4k7qfb5kg05871z0r3d9c0yhz9shf6wz36d"))))
115 (build-system gnu-build-system)
116 (arguments
117 `(#:make-flags
118 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
119 #:phases
120 (modify-phases %standard-phases
121 (add-after 'unpack 'patch-source
122 (lambda _
123 ;; kakoune uses confstr with _CS_PATH to find out where to find
124 ;; a posix shell, but this doesn't work in the build
125 ;; environment. This substitution just replaces that result
126 ;; with the "sh" path.
127 (substitute* "src/shell_manager.cc"
128 (("if \\(m_shell.empty\\(\\)\\)" line)
129 (string-append "m_shell = \"" (which "sh")
130 "\";\n " line)))
131 #t))
132 (delete 'configure) ; no configure script
133 ;; kakoune requires us to be in the src/ directory to build
134 (add-before 'build 'chdir
135 (lambda _ (chdir "src") #t)))))
136 (native-inputs
137 `(("asciidoc" ,asciidoc)
138 ("pkg-config" ,pkg-config)
139 ("ruby" ,ruby)))
140 (inputs
141 `(("ncurses" ,ncurses)
142 ("boost" ,boost)))
143 (synopsis "Vim-inspired code editor")
144 (description
145 "Kakoune is a code editor heavily inspired by Vim, as such most of its
146 commands are similar to Vi's ones, and it shares Vi's \"keystrokes as a text
147 editing language\" model. Kakoune has a strong focus on interactivity, most
148 commands provide immediate and incremental results, while still being
149 competitive (as in keystroke count) with Vim.")
150 (home-page "http://kakoune.org/")
151 (license license:unlicense)))
152
153 (define-public joe
154 (package
155 (name "joe")
156 (version "4.6")
157 (source
158 (origin
159 (method url-fetch)
160 (uri (string-append "https://sourceforge.net/projects/joe-editor/"
161 "files/JOE sources/joe-" version "/"
162 "joe-" version ".tar.gz"))
163 (sha256
164 (base32
165 "1pmr598xxxm9j9dl93kq4dv36zyw0q2dh6d7x07hf134y9hhlnj9"))))
166 (build-system gnu-build-system)
167 (inputs `(("ncurses" ,ncurses)))
168 (home-page "http://joe-editor.sourceforge.net/")
169 (synopsis "Console screen editor")
170 (description
171 "JOE is a powerful console screen editor with a \"mode-less\" user
172 interface similar to many user-friendly editors. JOE has some of the key
173 bindings and many of the powerful features of GNU Emacs.")
174 (license license:gpl3+)))
175
176 (define-public leafpad
177 (package
178 (name "leafpad")
179 (version "0.8.18.1")
180 (source (origin
181 (method url-fetch)
182 (uri (string-append "mirror://savannah/"
183 "leafpad/leafpad-" version ".tar.gz"))
184 (sha256
185 (base32
186 "0b0az2wvqgvam7w0ns1j8xp2llslm1rx6h7zcsy06a7j0yp257cm"))))
187 (build-system glib-or-gtk-build-system)
188 (native-inputs
189 `(("intltool" ,intltool)
190 ("pkg-config" ,pkg-config)))
191 (inputs
192 `(("gtk+" ,gtk+-2)))
193 (home-page "http://tarot.freeshell.org/leafpad/")
194 (synopsis "GTK+ based text editor")
195 (description "Leafpad is a GTK+ text editor that emphasizes simplicity. As
196 development focuses on keeping weight down to a minimum, only the most essential
197 features are implemented in the editor. Leafpad is simple to use, is easily
198 compiled, requires few libraries, and starts up quickly. ")
199 (license license:gpl2+)))
200
201 (define-public e3
202 (package
203 (name "e3")
204 (version "2.82")
205 (source (origin
206 (method url-fetch)
207 (uri (string-append "https://sites.google.com/site/e3editor/Home/"
208 "e3-" version ".tgz"))
209 (sha256
210 (base32
211 "0919kadkas020maqq37852isnzp053q2fnws2zh3mz81d1jiviak"))
212 (modules '((guix build utils)))
213
214 ;; Remove pre-built binaries.
215 (snippet '(begin
216 (delete-file-recursively "bin")
217 #t))))
218 (build-system gnu-build-system)
219 (arguments
220 `(#:tests? #f
221 #:make-flags (list (string-append "PREFIX="
222 (assoc-ref %outputs "out")))
223 #:phases (modify-phases %standard-phases
224 (delete 'configure))))
225 (native-inputs
226 `(("nasm" ,nasm)))
227 (home-page "https://sites.google.com/site/e3editor/")
228 (synopsis "Tiny text editor written in assembly")
229 (description
230 "e3 is a micro text editor with an executable code size between 3800 and
231 35000 bytes. Except for ``syntax highlighting'', the e3 binary supports all
232 of the basic functions one expects plus built in arithmetic calculations.
233 UTF-8 coding of unicode characters is supported as well. e3 can use
234 Wordstar-, EMACS-, Pico, Nedit or vi-like key bindings. e3 can be used on
235 16, 32, and 64-bit CPUs.")
236 (supported-systems '("x86_64-linux" "i686-linux"))
237 (license license:gpl2+)))
238
239 (define-public mg
240 (package
241 (name "mg")
242 (version "20171014")
243 (source (origin
244 (method url-fetch)
245 (uri (string-append "https://homepage.boetes.org/software/mg/mg-"
246 version ".tar.gz"))
247 (sha256
248 (base32
249 "0hakfikzsml7z0hja8m8mcahrmfy2piy81bq9nccsjplyfc9clai"))
250 (modules '((guix build utils)))
251 (snippet '(begin
252 (substitute* "GNUmakefile"
253 (("/usr/bin/") ""))
254 #t))))
255 (build-system gnu-build-system)
256 (native-inputs
257 `(("pkg-config" ,pkg-config)))
258 (inputs
259 `(("libbsd" ,libbsd)
260 ("ncurses" ,ncurses)))
261 (arguments
262 ;; No test suite available.
263 '(#:tests? #f
264 #:make-flags (list (string-append "prefix=" %output)
265 "CURSES_LIBS=-lncurses"
266 "CC=gcc")
267 #:phases (modify-phases %standard-phases
268 (delete 'configure)
269 (add-before 'build 'correct-location-of-difftool
270 (lambda _
271 (substitute* "buffer.c"
272 (("/usr/bin/diff")
273 (which "diff")))
274 #t))
275 (add-before 'install 'patch-tutorial-location
276 (lambda* (#:key outputs #:allow-other-keys)
277 (substitute* "mg.1"
278 (("/usr") (assoc-ref outputs "out")))
279 #t))
280 (add-after 'install 'install-tutorial
281 (lambda* (#:key outputs #:allow-other-keys)
282 (let* ((out (assoc-ref outputs "out"))
283 (doc (string-append out "/share/doc/mg")))
284 (install-file "tutorial" doc)
285 #t))))))
286 (home-page "https://homepage.boetes.org/software/mg/")
287 (synopsis "Microscopic GNU Emacs clone")
288 (description
289 "Mg (mg) is a GNU Emacs style editor, with which it is \"broadly\"
290 compatible. This is a portable version of the mg maintained by the OpenBSD
291 team.")
292 (license license:public-domain)))
293
294 (define-public ghostwriter
295 (package
296 (name "ghostwriter")
297 (version "1.6.1")
298 (source (origin
299 (method git-fetch)
300 (uri (git-reference
301 (url "https://github.com/wereturtle/ghostwriter.git")
302 (commit (string-append "v" version))))
303 (file-name (git-file-name name version))
304 (sha256
305 (base32
306 "1ihdr4xk0j83q83xknbikxb7yf9qhlkgvc89w33lhj090cv376gd"))))
307 (build-system gnu-build-system)
308 (native-inputs
309 `(("pkg-config" ,pkg-config)
310 ("qttools" ,qttools))) ;for lrelease
311 (inputs
312 `(("hunspell" ,hunspell)
313 ("qtbase" ,qtbase)
314 ("qtmultimedia" ,qtmultimedia)
315 ("qtsvg" ,qtsvg)
316 ("qtwebkit" ,qtwebkit)))
317 (arguments
318 `(#:phases
319 (modify-phases %standard-phases
320 (replace 'configure
321 (lambda* (#:key outputs #:allow-other-keys)
322 (let ((out (assoc-ref outputs "out")))
323 (invoke "qmake" (string-append "PREFIX=" out)))))
324 (add-after 'configure 'create-translations
325 (lambda _
326 ;; `lrelease` will not overwrite, so delete existing .qm files
327 (for-each delete-file (find-files "translations" ".*\\.qm"))
328 (apply invoke "lrelease" (find-files "translations" ".*\\.ts"))))
329 ;; Ensure that icons are found at runtime.
330 (add-after 'install 'wrap-executable
331 (lambda* (#:key inputs outputs #:allow-other-keys)
332 (let ((out (assoc-ref outputs "out")))
333 (wrap-program (string-append out "/bin/ghostwriter")
334 `("QT_PLUGIN_PATH" ":" prefix
335 ,(map (lambda (label)
336 (string-append (assoc-ref inputs label)
337 "/lib/qt5/plugins/"))
338 '("qtsvg" "qtmultimedia"))))))))))
339 (home-page "https://wereturtle.github.io/ghostwriter/")
340 (synopsis "Write without distractions")
341 (description
342 "@code{ghostwriter} provides a relaxing, distraction-free writing
343 environment with Markdown markup.")
344 (license license:gpl3+))) ;icons/* under CC-BY-SA3