@@ -17,6 +17,7 @@
;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2021 Calum Irwin <calumirwin1@gmail.com>
+;;; Copyright © 2022 (unmatched parenthesis <paren@disroot.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -187,14 +188,33 @@ (define-public kakoune
(substitute* "src/shell_manager.cc"
(("if \\(m_shell.empty\\(\\)\\)" line)
(string-append "m_shell = \"" (which "sh")
- "\";\n " line)))
- #t))
+ "\";\n " line)))))
(delete 'configure) ; no configure script
;; kakoune requires us to be in the src/ directory to build.
(add-before 'build 'chdir
- (lambda _ (chdir "src") #t)))))
+ (lambda _ (chdir "src")))
+ (add-before 'install 'patch-kakrc
+ (lambda _
+ (chdir "..")
+ ;; here, we modify the default kakrc to source all the $pkg/share/kak/autoload/*.kak
+ ;; files automatically.
+ (substitute* "share/kak/kakrc"
+ (("echo \"colorscheme default\"" colorscheme-default)
+ (string-append colorscheme-default "
+for dir in $(echo ${GUIX_KAKOUNE_CONFIG_DIRS} | sed 's/:/\\/autoload /g'); do
+ if [ -d ${dir} ]; then
+ autoload_directory ${dir}
+ fi
+done
+"))))))))
(native-inputs
(list asciidoc pkg-config ruby))
+ (native-search-paths
+ (list (search-path-specification
+ ;; kakoune only supports one config dir, so we use this instead, so that we can
+ ;; modify the default kakrc to source all the autoloads.
+ (variable "GUIX_KAKOUNE_CONFIG_DIRS")
+ (files '("share/kak/")))))
(synopsis "Vim-inspired code editor")
(description
"Kakoune is a code editor heavily inspired by Vim, as such most of its