all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#54357] [PATCH] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix. (Plugins incoming soon.)
@ 2022-03-12 21:09 ` (unmatched-parenthesis via Guix-patches via
  2022-03-12 22:33   ` paren--- via Guix-patches via
                     ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: (unmatched-parenthesis via Guix-patches via @ 2022-03-12 21:09 UTC (permalink / raw)
  To: 54357; +Cc: (unmatched-parenthesis

* gnu/packages/text-editors.scm(kakoune): Remove the redundant `#t`s, and add a $GUIX_KAKOUNE_CONFIG_DIRS search path.

While trying to package a kak plugin, I realized that the kak package itself was missing a
search path. However, kak appears to allow only one config path, so I inject a for loop into
the default kakrc (with a hacky substitute* because i cannot be bothered preparing a path :)
which enumerates the paths in $GUIX_KAKOUNE_CONFIG_DIRS and sources all their kakfiles.

I'll send in a few plugins in a moment. These will act as both examples of the search path
working and of course useful packages in themselves.

I also took the opportunity to clean the package up a little, removing the now unneccesary
`#t`s returned at the end of each phase. I was going to change it to use git instead of 
github release tarballs too (I'm told that git clones are better because of Software Heritage), 
but I'm hesitant to make that change without checking first.
---
 gnu/packages/text-editors.scm | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 45cc61765a..6d562d0e4a 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -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
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#54357] [PATCH] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix. (Plugins incoming soon.)
  2022-03-12 21:09 ` [bug#54357] [PATCH] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix. (Plugins incoming soon.) (unmatched-parenthesis via Guix-patches via
@ 2022-03-12 22:33   ` paren--- via Guix-patches via
  2022-03-12 22:40   ` [bug#54357] [PATCH] gnu: Add kak-auto-pairs (unmatched-parenthesis via Guix-patches via
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: paren--- via Guix-patches via @ 2022-03-12 22:33 UTC (permalink / raw)
  To: 54357

March 12, 2022 9:10 PM, "(unmatched-parenthesis" <paren@disroot.org> wrote:
> I'll send in a few plugins in a moment. These will act as both examples of the search path
> working and of course useful packages in themselves.

Noting the existence of #54358, which is a separate thread because it also adds the related vim
plugin.




^ permalink raw reply	[flat|nested] 13+ messages in thread

* [bug#54357] [PATCH] gnu: Add kak-auto-pairs
  2022-03-12 21:09 ` [bug#54357] [PATCH] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix. (Plugins incoming soon.) (unmatched-parenthesis via Guix-patches via
  2022-03-12 22:33   ` paren--- via Guix-patches via
@ 2022-03-12 22:40   ` (unmatched-parenthesis via Guix-patches via
  2022-03-12 23:20   ` [bug#54357] [PATCH] gnu: Add kak-sudo-write (unmatched-parenthesis via Guix-patches via
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: (unmatched-parenthesis via Guix-patches via @ 2022-03-12 22:40 UTC (permalink / raw)
  To: 54357; +Cc: (unmatched-parenthesis

* gnu/packages/text-editors.scm (kak-auto-pairs): New variable.
---
 gnu/packages/text-editors.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index bbfbcdd226..d1fa1bd28a 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -269,6 +269,30 @@ (define-public kak-lsp
 Rust.")
     (license license:unlicense)))
 
+(define-public kak-auto-pairs
+  (let ((commit "d78164b7936d45438ad5e382d2c16f05494ca74a")
+        (revision "0"))
+    (package
+     (name "kak-auto-pairs")
+     (version (git-version "0.0.0" revision commit))
+     (source
+      (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/alexherbo2/auto-pairs.kak")
+             (commit commit)))
+       (sha256
+        (base32 "1qar4r91km5389j9byrpjimy5r083pnfpzkigvxllklj6z0xyc0d"))))
+     (build-system copy-build-system)
+     (arguments
+      `(#:install-plan
+        '(("rc" "share/kak/autoload"))))
+     (propagated-inputs (list kakoune))
+     (home-page "https://github.com/alexherbo2/auto-pairs.kak")
+     (synopsis "An auto-pair plugin for Kakoune")
+     (description "This package provides automatic pair completion for the Kakoune text editor.")
+     (license license:unlicense))))
+
 (define-public parinfer-rust
   (package
     (name "parinfer-rust")
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#54357] [PATCH] gnu: Add kak-sudo-write
  2022-03-12 21:09 ` [bug#54357] [PATCH] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix. (Plugins incoming soon.) (unmatched-parenthesis via Guix-patches via
  2022-03-12 22:33   ` paren--- via Guix-patches via
  2022-03-12 22:40   ` [bug#54357] [PATCH] gnu: Add kak-auto-pairs (unmatched-parenthesis via Guix-patches via
@ 2022-03-12 23:20   ` (unmatched-parenthesis via Guix-patches via
  2022-03-13 22:16   ` [bug#54357] [PATCH 1/4] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix (unmatched-parenthesis via Guix-patches via
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 13+ messages in thread
From: (unmatched-parenthesis via Guix-patches via @ 2022-03-12 23:20 UTC (permalink / raw)
  To: 54357; +Cc: (unmatched-parenthesis

* gnu/packages/text-editors.scm (kak-sudo-write): New variable.
---
 gnu/packages/text-editors.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index d1fa1bd28a..a436df48ce 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -293,6 +293,31 @@ (define-public kak-auto-pairs
      (description "This package provides automatic pair completion for the Kakoune text editor.")
      (license license:unlicense))))
 
+(define-public kak-sudo-write
+  (let ((commit "ec0d6d26ceaadd93d6824630ba587b31e442214d")
+        (revision "0"))
+    (package
+     (name "kak-sudo-write")
+     (version (git-version "0.0.0" revision commit))
+     (source
+      (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/occivink/kakoune-sudo-write")
+             (commit commit)))
+       (sha256
+        (base32 "1c1wajm3c2aa0lda36y2yj2fvf4fbdqjl5ishh9p8qkjxbrb1v1v"))))
+     (build-system copy-build-system)
+     (arguments
+      `(#:install-plan
+        '(("sudo-write.kak" "share/kak/autoload/sudo-write.kak"))))
+     (propagated-inputs (list kakoune))
+     (home-page "https://github.com/occivink/kakoune-sudo-write")
+     (synopsis "Kakoune plugin to save files that you do not have write permissions for.")
+     (description "This package provides a Kakoune plugin that uses sudo to allow saving files that you
+do not have permission to write.")
+     (license license:unlicense))))
+
 (define-public parinfer-rust
   (package
     (name "parinfer-rust")
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#54357] [PATCH 1/4] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix.
  2022-03-12 21:09 ` [bug#54357] [PATCH] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix. (Plugins incoming soon.) (unmatched-parenthesis via Guix-patches via
                     ` (2 preceding siblings ...)
  2022-03-12 23:20   ` [bug#54357] [PATCH] gnu: Add kak-sudo-write (unmatched-parenthesis via Guix-patches via
@ 2022-03-13 22:16   ` (unmatched-parenthesis via Guix-patches via
  2022-03-13 22:16     ` [bug#54357] [PATCH 2/4] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins (unmatched-parenthesis via Guix-patches via
                       ` (2 more replies)
  2022-03-14 21:56   ` [bug#54357] [PATCH 1/4] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix (unmatched-parenthesis via Guix-patches via
  2022-06-04  8:23   ` [bug#54357] Calum Irwin
  5 siblings, 3 replies; 13+ messages in thread
From: (unmatched-parenthesis via Guix-patches via @ 2022-03-13 22:16 UTC (permalink / raw)
  To: 54357; +Cc: (unmatched-parenthesis

* gnu/packages/text-editors.scm(kakoune): Clean up package recipe, and add GUIX_KAKOUNE_DIRS search path.

Argh! That for loop makes kak source the default kakrc twice! This rebased patch series fixes that.

(I also added copy-build-system to use-modules so that we can install kak plugins properly, which was missing 
from my patch. I didn't notice it while I was doing `git add -p` :))
---
 gnu/packages/text-editors.scm | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 45cc61765a..96e070807d 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -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.
 ;;;
@@ -41,6 +42,7 @@ (define-module (gnu packages text-editors)
   #:use-module (guix utils)
   #:use-module (guix build-system cargo)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system python)
@@ -187,14 +189,32 @@ (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"
+               (("if \\[ -d \"\\$\\{kak_config}/autoload\" \\]; then .* fi")
+                "\
+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
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#54357] [PATCH 2/4] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins
  2022-03-13 22:16   ` [bug#54357] [PATCH 1/4] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix (unmatched-parenthesis via Guix-patches via
@ 2022-03-13 22:16     ` (unmatched-parenthesis via Guix-patches via
  2022-03-13 22:16     ` [bug#54357] [PATCH 3/4] gnu: Add kak-auto-pairs (unmatched-parenthesis via Guix-patches via
  2022-03-13 22:16     ` [bug#54357] [PATCH 4/4] gnu: Add kak-sudo-write (unmatched-parenthesis via Guix-patches via
  2 siblings, 0 replies; 13+ messages in thread
From: (unmatched-parenthesis via Guix-patches via @ 2022-03-13 22:16 UTC (permalink / raw)
  To: 54357; +Cc: (unmatched-parenthesis

* gnu/packages/text-editors.scm (rust-parinfer)[arguments]: Install the bundled Vim and Kak plugins to the
correct directories.
---
 gnu/packages/text-editors.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 96e070807d..229e9f9112 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -292,7 +292,18 @@ (define-public parinfer-rust
         ("rust-serde-json" ,rust-serde-json-1)
         ("rust-serde-derive" ,rust-serde-derive-1)
         ("rust-unicode-segmentation" ,rust-unicode-segmentation-1)
-        ("rust-unicode-width" ,rust-unicode-width-0.1))))
+        ("rust-unicode-width" ,rust-unicode-width-0.1))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-vim-plugin
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (copy-recursively "doc" (string-append out "/share/vim/vimfiles/doc"))
+               (copy-recursively "plugin" (string-append out "/share/vim/vimfiles/plugin")))))
+         (add-after 'install-vim-plugin 'install-kak-plugin
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (copy-recursively "rc" (string-append out "/share/kak/autoload"))))))))
     (inputs
      (list clang))
     (home-page "https://github.com/justinbarclay/parinfer-rust")
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#54357] [PATCH 3/4] gnu: Add kak-auto-pairs
  2022-03-13 22:16   ` [bug#54357] [PATCH 1/4] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix (unmatched-parenthesis via Guix-patches via
  2022-03-13 22:16     ` [bug#54357] [PATCH 2/4] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins (unmatched-parenthesis via Guix-patches via
@ 2022-03-13 22:16     ` (unmatched-parenthesis via Guix-patches via
  2022-03-13 22:16     ` [bug#54357] [PATCH 4/4] gnu: Add kak-sudo-write (unmatched-parenthesis via Guix-patches via
  2 siblings, 0 replies; 13+ messages in thread
From: (unmatched-parenthesis via Guix-patches via @ 2022-03-13 22:16 UTC (permalink / raw)
  To: 54357; +Cc: (unmatched-parenthesis

* gnu/packages/text-editors.scm (kak-auto-pairs): New variable.
---
 gnu/packages/text-editors.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 229e9f9112..1da94e1066 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -269,6 +269,30 @@ (define-public kak-lsp
 Rust.")
     (license license:unlicense)))
 
+(define-public kak-auto-pairs
+  (let ((commit "d78164b7936d45438ad5e382d2c16f05494ca74a")
+        (revision "0"))
+    (package
+     (name "kak-auto-pairs")
+     (version (git-version "0.0.0" revision commit))
+     (source
+      (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/alexherbo2/auto-pairs.kak")
+             (commit commit)))
+       (sha256
+        (base32 "1qar4r91km5389j9byrpjimy5r083pnfpzkigvxllklj6z0xyc0d"))))
+     (build-system copy-build-system)
+     (arguments
+      `(#:install-plan
+        '(("rc" "share/kak/autoload"))))
+     (propagated-inputs (list kakoune))
+     (home-page "https://github.com/alexherbo2/auto-pairs.kak")
+     (synopsis "An auto-pair plugin for Kakoune")
+     (description "This package provides automatic pair completion for the Kakoune text editor.")
+     (license license:unlicense))))
+
 (define-public parinfer-rust
   (package
     (name "parinfer-rust")
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#54357] [PATCH 4/4] gnu: Add kak-sudo-write
  2022-03-13 22:16   ` [bug#54357] [PATCH 1/4] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix (unmatched-parenthesis via Guix-patches via
  2022-03-13 22:16     ` [bug#54357] [PATCH 2/4] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins (unmatched-parenthesis via Guix-patches via
  2022-03-13 22:16     ` [bug#54357] [PATCH 3/4] gnu: Add kak-auto-pairs (unmatched-parenthesis via Guix-patches via
@ 2022-03-13 22:16     ` (unmatched-parenthesis via Guix-patches via
  2 siblings, 0 replies; 13+ messages in thread
From: (unmatched-parenthesis via Guix-patches via @ 2022-03-13 22:16 UTC (permalink / raw)
  To: 54357; +Cc: (unmatched-parenthesis

* gnu/packages/text-editors.scm (kak-sudo-write): New variable.
---
 gnu/packages/text-editors.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 1da94e1066..5eed162ab5 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -293,6 +293,31 @@ (define-public kak-auto-pairs
      (description "This package provides automatic pair completion for the Kakoune text editor.")
      (license license:unlicense))))
 
+(define-public kak-sudo-write
+  (let ((commit "ec0d6d26ceaadd93d6824630ba587b31e442214d")
+        (revision "0"))
+    (package
+     (name "kak-sudo-write")
+     (version (git-version "0.0.0" revision commit))
+     (source
+      (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/occivink/kakoune-sudo-write")
+             (commit commit)))
+       (sha256
+        (base32 "1c1wajm3c2aa0lda36y2yj2fvf4fbdqjl5ishh9p8qkjxbrb1v1v"))))
+     (build-system copy-build-system)
+     (arguments
+      `(#:install-plan
+        '(("sudo-write.kak" "share/kak/autoload/sudo-write.kak"))))
+     (propagated-inputs (list kakoune))
+     (home-page "https://github.com/occivink/kakoune-sudo-write")
+     (synopsis "Kakoune plugin to save files that you do not have write permissions for.")
+     (description "This package provides a Kakoune plugin that uses sudo to allow saving files that you
+do not have permission to write.")
+     (license license:unlicense))))
+
 (define-public parinfer-rust
   (package
     (name "parinfer-rust")
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#54357] [PATCH 1/4] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix.
  2022-03-12 21:09 ` [bug#54357] [PATCH] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix. (Plugins incoming soon.) (unmatched-parenthesis via Guix-patches via
                     ` (3 preceding siblings ...)
  2022-03-13 22:16   ` [bug#54357] [PATCH 1/4] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix (unmatched-parenthesis via Guix-patches via
@ 2022-03-14 21:56   ` (unmatched-parenthesis via Guix-patches via
  2022-03-14 21:56     ` [bug#54357] [PATCH 2/4] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins (unmatched-parenthesis via Guix-patches via
                       ` (2 more replies)
  2022-06-04  8:23   ` [bug#54357] Calum Irwin
  5 siblings, 3 replies; 13+ messages in thread
From: (unmatched-parenthesis via Guix-patches via @ 2022-03-14 21:56 UTC (permalink / raw)
  To: 54357; +Cc: (unmatched-parenthesis

* gnu/packages/text-editors.scm(kakoune): Clean up package recipe, and add GUIX_KAKOUNE_DIRS search path.

Okay, I overengineered this... This patch set should definitely work. Promise.
---
 gnu/packages/text-editors.scm | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 45cc61765a..aff8bab9b0 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -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.
 ;;;
@@ -41,6 +42,7 @@ (define-module (gnu packages text-editors)
   #:use-module (guix utils)
   #:use-module (guix build-system cargo)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system glib-or-gtk)
   #:use-module (guix build-system python)
@@ -187,14 +189,17 @@ (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"))))))
     (native-inputs
      (list asciidoc pkg-config ruby))
+    (native-search-paths
+     (list (search-path-specification
+            (variable "KAKOUNE_RUNTIME")
+            (files '("share/kak")))))
     (synopsis "Vim-inspired code editor")
     (description
      "Kakoune is a code editor heavily inspired by Vim, as such most of its
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#54357] [PATCH 2/4] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins
  2022-03-14 21:56   ` [bug#54357] [PATCH 1/4] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix (unmatched-parenthesis via Guix-patches via
@ 2022-03-14 21:56     ` (unmatched-parenthesis via Guix-patches via
  2022-03-14 21:56     ` [bug#54357] [PATCH 3/4] gnu: Add kak-auto-pairs (unmatched-parenthesis via Guix-patches via
  2022-03-14 21:56     ` [bug#54357] [PATCH 4/4] gnu: Add kak-sudo-write (unmatched-parenthesis via Guix-patches via
  2 siblings, 0 replies; 13+ messages in thread
From: (unmatched-parenthesis via Guix-patches via @ 2022-03-14 21:56 UTC (permalink / raw)
  To: 54357; +Cc: (unmatched-parenthesis

* gnu/packages/text-editors.scm (rust-parinfer)[arguments]: Install the bundled Vim and Kak plugins to the
correct directories.
---
 gnu/packages/text-editors.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index aff8bab9b0..1d2f5c7062 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -277,7 +277,18 @@ (define-public parinfer-rust
         ("rust-serde-json" ,rust-serde-json-1)
         ("rust-serde-derive" ,rust-serde-derive-1)
         ("rust-unicode-segmentation" ,rust-unicode-segmentation-1)
-        ("rust-unicode-width" ,rust-unicode-width-0.1))))
+        ("rust-unicode-width" ,rust-unicode-width-0.1))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'install-vim-plugin
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (copy-recursively "doc" (string-append out "/share/vim/vimfiles/doc"))
+               (copy-recursively "plugin" (string-append out "/share/vim/vimfiles/plugin")))))
+         (add-after 'install-vim-plugin 'install-kak-plugin
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out")))
+               (copy-recursively "rc" (string-append out "/share/kak/autoload"))))))))
     (inputs
      (list clang))
     (home-page "https://github.com/justinbarclay/parinfer-rust")
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#54357] [PATCH 3/4] gnu: Add kak-auto-pairs
  2022-03-14 21:56   ` [bug#54357] [PATCH 1/4] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix (unmatched-parenthesis via Guix-patches via
  2022-03-14 21:56     ` [bug#54357] [PATCH 2/4] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins (unmatched-parenthesis via Guix-patches via
@ 2022-03-14 21:56     ` (unmatched-parenthesis via Guix-patches via
  2022-03-14 21:56     ` [bug#54357] [PATCH 4/4] gnu: Add kak-sudo-write (unmatched-parenthesis via Guix-patches via
  2 siblings, 0 replies; 13+ messages in thread
From: (unmatched-parenthesis via Guix-patches via @ 2022-03-14 21:56 UTC (permalink / raw)
  To: 54357; +Cc: (unmatched-parenthesis

* gnu/packages/text-editors.scm (kak-auto-pairs): New variable.
---
 gnu/packages/text-editors.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 1d2f5c7062..08cd1a16d9 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -254,6 +254,30 @@ (define-public kak-lsp
 Rust.")
     (license license:unlicense)))
 
+(define-public kak-auto-pairs
+  (let ((commit "d78164b7936d45438ad5e382d2c16f05494ca74a")
+        (revision "0"))
+    (package
+     (name "kak-auto-pairs")
+     (version (git-version "0.0.0" revision commit))
+     (source
+      (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/alexherbo2/auto-pairs.kak")
+             (commit commit)))
+       (sha256
+        (base32 "1qar4r91km5389j9byrpjimy5r083pnfpzkigvxllklj6z0xyc0d"))))
+     (build-system copy-build-system)
+     (arguments
+      `(#:install-plan
+        '(("rc" "share/kak/autoload"))))
+     (propagated-inputs (list kakoune))
+     (home-page "https://github.com/alexherbo2/auto-pairs.kak")
+     (synopsis "An auto-pair plugin for Kakoune")
+     (description "This package provides automatic pair completion for the Kakoune text editor.")
+     (license license:unlicense))))
+
 (define-public parinfer-rust
   (package
     (name "parinfer-rust")
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#54357] [PATCH 4/4] gnu: Add kak-sudo-write
  2022-03-14 21:56   ` [bug#54357] [PATCH 1/4] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix (unmatched-parenthesis via Guix-patches via
  2022-03-14 21:56     ` [bug#54357] [PATCH 2/4] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins (unmatched-parenthesis via Guix-patches via
  2022-03-14 21:56     ` [bug#54357] [PATCH 3/4] gnu: Add kak-auto-pairs (unmatched-parenthesis via Guix-patches via
@ 2022-03-14 21:56     ` (unmatched-parenthesis via Guix-patches via
  2 siblings, 0 replies; 13+ messages in thread
From: (unmatched-parenthesis via Guix-patches via @ 2022-03-14 21:56 UTC (permalink / raw)
  To: 54357; +Cc: (unmatched-parenthesis

* gnu/packages/text-editors.scm (kak-sudo-write): New variable.
---
 gnu/packages/text-editors.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 08cd1a16d9..4b06b8c9bd 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -278,6 +278,31 @@ (define-public kak-auto-pairs
      (description "This package provides automatic pair completion for the Kakoune text editor.")
      (license license:unlicense))))
 
+(define-public kak-sudo-write
+  (let ((commit "ec0d6d26ceaadd93d6824630ba587b31e442214d")
+        (revision "0"))
+    (package
+     (name "kak-sudo-write")
+     (version (git-version "0.0.0" revision commit))
+     (source
+      (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/occivink/kakoune-sudo-write")
+             (commit commit)))
+       (sha256
+        (base32 "1c1wajm3c2aa0lda36y2yj2fvf4fbdqjl5ishh9p8qkjxbrb1v1v"))))
+     (build-system copy-build-system)
+     (arguments
+      `(#:install-plan
+        '(("sudo-write.kak" "share/kak/autoload/sudo-write.kak"))))
+     (propagated-inputs (list kakoune))
+     (home-page "https://github.com/occivink/kakoune-sudo-write")
+     (synopsis "Kakoune plugin to save files that you do not have write permissions for.")
+     (description "This package provides a Kakoune plugin that uses sudo to allow saving files that you
+do not have permission to write.")
+     (license license:unlicense))))
+
 (define-public parinfer-rust
   (package
     (name "parinfer-rust")
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [bug#54357]
  2022-03-12 21:09 ` [bug#54357] [PATCH] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix. (Plugins incoming soon.) (unmatched-parenthesis via Guix-patches via
                     ` (4 preceding siblings ...)
  2022-03-14 21:56   ` [bug#54357] [PATCH 1/4] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix (unmatched-parenthesis via Guix-patches via
@ 2022-06-04  8:23   ` Calum Irwin
  5 siblings, 0 replies; 13+ messages in thread
From: Calum Irwin @ 2022-06-04  8:23 UTC (permalink / raw)
  To: 54357

I don't think you need

(propagated-inputs (list kakoune))

in each of these do you? and it's atypical of plugin packages to
require the thing they plug into.




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-06-04  8:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <d119bec222e729f592d4d79f8e9c3a92@disroot.org>
2022-03-12 21:09 ` [bug#54357] [PATCH] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix. (Plugins incoming soon.) (unmatched-parenthesis via Guix-patches via
2022-03-12 22:33   ` paren--- via Guix-patches via
2022-03-12 22:40   ` [bug#54357] [PATCH] gnu: Add kak-auto-pairs (unmatched-parenthesis via Guix-patches via
2022-03-12 23:20   ` [bug#54357] [PATCH] gnu: Add kak-sudo-write (unmatched-parenthesis via Guix-patches via
2022-03-13 22:16   ` [bug#54357] [PATCH 1/4] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix (unmatched-parenthesis via Guix-patches via
2022-03-13 22:16     ` [bug#54357] [PATCH 2/4] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins (unmatched-parenthesis via Guix-patches via
2022-03-13 22:16     ` [bug#54357] [PATCH 3/4] gnu: Add kak-auto-pairs (unmatched-parenthesis via Guix-patches via
2022-03-13 22:16     ` [bug#54357] [PATCH 4/4] gnu: Add kak-sudo-write (unmatched-parenthesis via Guix-patches via
2022-03-14 21:56   ` [bug#54357] [PATCH 1/4] gnu: kakoune: Clean up, and add a search path that makes it possible to package kak plugins in guix (unmatched-parenthesis via Guix-patches via
2022-03-14 21:56     ` [bug#54357] [PATCH 2/4] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins (unmatched-parenthesis via Guix-patches via
2022-03-14 21:56     ` [bug#54357] [PATCH 3/4] gnu: Add kak-auto-pairs (unmatched-parenthesis via Guix-patches via
2022-03-14 21:56     ` [bug#54357] [PATCH 4/4] gnu: Add kak-sudo-write (unmatched-parenthesis via Guix-patches via
2022-06-04  8:23   ` [bug#54357] Calum Irwin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.