Browse Source

gnu: Add kakoune.

* gnu/packages/text-editors.scm (kakoune): New variable.

Signed-off-by: Marius Bakke <>
Carlo Zancanaro 5 years ago
committed by Marius Bakke
No known key found for this signature in database GPG Key ID: A2A06DF2A33A54FA
  1. 73


@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 José Miguel Sánchez García <>
;;; Copyright © 2016 Carlo Zancanaro <>
;;; This file is part of GNU Guix.
@ -19,13 +20,18 @@
(define-module (gnu packages text-editors)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix utils)
#:use-module (guix build-system gnu)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (gnu packages)
#:use-module (gnu packages boost)
#:use-module (gnu packages documentation)
#:use-module (gnu packages gcc)
#:use-module (gnu packages lua)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages terminals))
#:use-module (gnu packages ruby)
#:use-module (gnu packages xml))
(define-public vis
@ -75,3 +81,68 @@ based command language.")
(license (list license:isc ; Main distribution.
license:public-domain ; map.[ch]
license:expat)))) ; lexers and libutf.[ch]
(define-public kakoune
(let ((commit "125c8b7e80995732e0d8c87b82040025748f1b4f")
(revision "1"))
(name "kakoune")
(version (string-append "0.0.0-" revision "." (string-take commit 7)))
(file-name (string-append "kakoune-" version "-checkout"))
(method git-fetch)
(uri (git-reference
(url "")
(commit commit)))
(build-system gnu-build-system)
`(#:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
;; Boost is compiled with the older ABI, so we can't use
;; the new ABI if we want to link againt it.
(modify-phases %standard-phases
(add-after 'unpack 'patch-source
(lambda _
;; kakoune uses confstr with _CS_PATH to find out where to find
;; a posix shell, but this doesn't work in the build
;; environment. This substitution just replaces that result
;; with the "sh" path.
(substitute* "src/"
(("if \\(m_shell.empty\\(\\)\\)" line)
(string-append "m_shell = \"" (which "sh")
"\";\n " line)))
;; Kakoune uses 'gzip' to compress its manpages. Make sure
;; timestamps are not preserved for reproducibility.
(substitute* "src/Makefile"
(("gzip -f") "gzip -f --no-name"))
(delete 'configure)
;; kakoune requires us to be in the src/ directory to build
(add-before 'build 'chdir
(lambda _ (chdir "src") #t))
(add-before 'check 'fix-test-permissions
(lambda _
;; Out git downloader doesn't give us write permissions, but
;; without them the tests fail.
(zero? (system* "chmod" "-R" "u+w" "../test")))))))
(native-inputs `(("gcc" ,gcc-5)
("libxslt" ,libxslt)
("asciidoc" ,asciidoc)
("ruby" ,ruby)))
(inputs `(("gcc:lib" ,gcc-5 "lib")
("ncurses" ,ncurses)
("boost" ,boost)))
(synopsis "Vim-inspired code editor")
"Kakoune is a code editor heavily inspired by Vim, as such most of its
commands are similar to Vi's ones, and it shares Vi's \"keystrokes as a text
editing language\" model. Kakoune has a strong focus on interactivity, most
commands provide immediate and incremental results, while still being
competitive (as in keystroke count) with Vim.")
(home-page "")
(license license:unlicense))))