gnu: Add kakoune.

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

Signed-off-by: Marius Bakke <mbakke@fastmail.com>
This commit is contained in:
Carlo Zancanaro 2016-12-30 02:15:59 +11:00 committed by Marius Bakke
parent 5bbb224916
commit 5613ea79fc
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 José Miguel Sánchez García <jmi2k@openmailbox.org>
;;; Copyright © 2016 Carlo Zancanaro <carlo@zancanaro.id.au>
;;;
;;; 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
(package
@ -75,3 +81,68 @@ (define-public vis
(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"))
(package
(name "kakoune")
(version (string-append "0.0.0-" revision "." (string-take commit 7)))
(source
(origin
(file-name (string-append "kakoune-" version "-checkout"))
(method git-fetch)
(uri (git-reference
(url "https://github.com/mawww/kakoune.git")
(commit commit)))
(sha256
(base32
"19qs99l8r9p1vi5pxxx9an22fvi7xx40qw3jh2cnh2mbacawvdyb"))))
(build-system gnu-build-system)
(arguments
`(#: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.
"CPPFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0")
#:phases
(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/shell_manager.cc"
(("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"))
#t))
(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")
(description
"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 "http://kakoune.org/")
(license license:unlicense))))