Skip to content
Browse files

Build kakoune from git 2019-06-07.

- use gcc-7
- make test files writable
  • Loading branch information...
robx committed Jun 7, 2019
0 parents commit f1564340158890b87158d64927c30849cf6e94d9
Showing with 60 additions and 0 deletions.
  1. +60 −0 kakoune.scm
@@ -0,0 +1,60 @@
(define-module (kakoune)
#:use-module (guix packages)
#:use-module (guix git-download)
#:use-module (gnu packages documentation)
#:use-module (gnu packages gcc)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages ruby)
#:use-module (gnu packages text-editors))

(define-public kakoune-dev
(package (inherit kakoune)
(name "kakoune-dev")
(version "2019.06.07-git")
(method git-fetch)
(file-name (git-file-name name version))
(url "")
(commit "09e1ec97a9d7925c9d4411f4f274919aeea1bf75")))
(base32 "05in7g7czdjz2xdk2ai963a9via3dlsx04pyy3gr32dn1zgg7na5"))))
`(("asciidoc" ,asciidoc)
("pkg-config" ,pkg-config)
("ruby" ,ruby)
("gcc" ,gcc-7)))
(list (string-append "PREFIX=" (assoc-ref %outputs "out")))
(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)))
(add-after 'patch-source 'make-test-output-writable
(lambda _
;; kakoune copies "in" files to a temporary directory and edits
;; them there, so they should be writable.
(for-each (lambda (file) (chmod file #o644))
(find-files "test" "^in$"))
(add-before 'configure 'fixgcc7
(lambda _
(unsetenv "C_INCLUDE_PATH")
(delete 'configure) ; no configure script
;; kakoune requires us to be in the src/ directory to build
(add-before 'build 'chdir
(lambda _ (chdir "src") #t)))))))

0 comments on commit f156434

Please sign in to comment.
You can’t perform that action at this time.