text-editors.scm 14 KB

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