unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#54358] [PATCH] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins
@ 2022-03-12 22:00 (unmatched-parenthesis via Guix-patches via
  2022-03-13 22:20 ` [bug#54358] Superseded paren--- via Guix-patches via
  2024-02-08 15:10 ` [bug#54358] [PATCH] gnu: parinfer-rust: Add phase to install Vim and Kakoune plugins Herman Rimm via Guix-patches via
  0 siblings, 2 replies; 4+ messages in thread
From: (unmatched-parenthesis via Guix-patches via @ 2022-03-12 22:00 UTC (permalink / raw)
  To: 54358; +Cc: (unmatched-parenthesis

* gnu/packages/text-editors.scm (rust-parinfer)[arguments]: Install the bundled Vim and Kak plugins to the
correct directories.

This does not _technically_ depend on #54357, but the kakoune plugin will be essentially unusable without
it.
---
 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 6d562d0e4a..bbfbcdd226 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] 4+ messages in thread

* [bug#54358] Superseded
  2022-03-12 22:00 [bug#54358] [PATCH] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins (unmatched-parenthesis via Guix-patches via
@ 2022-03-13 22:20 ` paren--- via Guix-patches via
  2024-02-08 15:10 ` [bug#54358] [PATCH] gnu: parinfer-rust: Add phase to install Vim and Kakoune plugins Herman Rimm via Guix-patches via
  1 sibling, 0 replies; 4+ messages in thread
From: paren--- via Guix-patches via @ 2022-03-13 22:20 UTC (permalink / raw)
  To: 54358

Superseded by https://issues.guix.gnu.org/54357#5. I couldn't figure out how to make git send one of the rebased emails to a
different address.




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

* [bug#54358] [PATCH] gnu: parinfer-rust: Add phase to install Vim and Kakoune plugins.
  2022-03-12 22:00 [bug#54358] [PATCH] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins (unmatched-parenthesis via Guix-patches via
  2022-03-13 22:20 ` [bug#54358] Superseded paren--- via Guix-patches via
@ 2024-02-08 15:10 ` Herman Rimm via Guix-patches via
  2024-02-11 13:47   ` bug#54358: " Efraim Flashner
  1 sibling, 1 reply; 4+ messages in thread
From: Herman Rimm via Guix-patches via @ 2024-02-08 15:10 UTC (permalink / raw)
  To: 54358; +Cc: (unmatched-parenthesis

From: "(unmatched-parenthesis" <paren@disroot.org>

* gnu/packages/text-editors.scm (rust-parinfer)[arguments]: Install the
bundled Vim and Kakoune plugins.
[outputs]: Add 'plugin' output.
[description]: Specify how to refer to output.

Change-Id: I881315481ec08c59576c4530ae72b877c399fc66
---
Hi,

I think it's fine to have this patch as a separate issue, since it also
adds the Vim editor plugin. The plugins and shared library are installed
to the 'plugin' output. The Vim plugin shared library path is patched.

Cheers,
Herman

 gnu/packages/text-editors.scm | 32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 3fefd59a19..b4d3c23e42 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -31,6 +31,8 @@
 ;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2023 Jaeme Sifat <jaeme@runbox.com>
 ;;; Copyright © 2023 David Pflug <david@pflug.io>
+;;; Copyright © 2024 ( <paren@disroot.org>
+;;; Copyright © 2024 Herman Rimm <herman@rimm.ee>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -308,7 +310,10 @@ (define-public parinfer-rust
        (sha256
         (base32 "0hj5in5h7pj72m4ag80ing513fh65q8xlsf341qzm3vmxm3y3jgd"))
        (file-name (git-file-name name version))))
+    (properties
+      `((output-synopsis "plugin" "Plugins with shared libraries")))
     (build-system cargo-build-system)
+    (outputs (list "out" "plugin"))
     (arguments
      `(#:cargo-inputs
        (("rust-getopts" ,rust-getopts-0.2)
@@ -318,15 +323,36 @@ (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-plugins-and-libs
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "plugin"))
+                    (lib (string-append out "/lib"))
+                    (vimfiles (string-append out "/share/vim/vimfiles/"
+                                             "pack/guix/start/parinfer"))
+                    (doc (string-append vimfiles "/doc"))
+                    (plugin (string-append vimfiles "/plugin"))
+                    (autoload (string-append out "/share/kak/autoload")))
+               (with-directory-excursion "target/release"
+                 (install-file "libparinfer_rust.so" lib))
+               (copy-recursively "doc" doc)
+               (copy-recursively "plugin" plugin)
+               (copy-recursively "rc" autoload)
+               (substitute* (string-append plugin "/parinfer.vim")
+                            (("(let s:libdir = ).*" all libdir)
+                             (format #f "~a'~a'\n" libdir lib)))))))))
     (inputs
      (list clang))
     (home-page "https://github.com/justinbarclay/parinfer-rust")
     (synopsis "Infer parentheses for Clojure, Lisp and Scheme")
     (description
      "Parinfer is a plugin for Kakoune, Vim, Neovim and Emacs that infers
-parentheses and indentation.  This library can be called from other editors that
-can load dynamic libraries.")
+parentheses and indentation.  This library can be called from other
+editors that can load dynamic libraries.  @code{gexp-input} can be used
+to refer to the 'plugin' output of this package, within a
+@code{home-environment} record.")
     (license license:expat)))
 
 (define-public joe

base-commit: 7d3aa578ef0b7fcfcddf0623f806ec625aab6ccd
-- 
2.41.0





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

* bug#54358: [PATCH] gnu: parinfer-rust: Add phase to install Vim and Kakoune plugins.
  2024-02-08 15:10 ` [bug#54358] [PATCH] gnu: parinfer-rust: Add phase to install Vim and Kakoune plugins Herman Rimm via Guix-patches via
@ 2024-02-11 13:47   ` Efraim Flashner
  0 siblings, 0 replies; 4+ messages in thread
From: Efraim Flashner @ 2024-02-11 13:47 UTC (permalink / raw)
  To: Herman Rimm; +Cc: (unmatched-parenthesis, 54358-done

[-- Attachment #1: Type: text/plain, Size: 432 bytes --]

I wasn't able to cross-compile clang so we were able to leave the
reference to target/release.  I moved the plugins to 'out' since they
don't take up much space and are likely to be helpful.

Patch pushed! Thanks.

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2024-02-11 13:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-12 22:00 [bug#54358] [PATCH] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins (unmatched-parenthesis via Guix-patches via
2022-03-13 22:20 ` [bug#54358] Superseded paren--- via Guix-patches via
2024-02-08 15:10 ` [bug#54358] [PATCH] gnu: parinfer-rust: Add phase to install Vim and Kakoune plugins Herman Rimm via Guix-patches via
2024-02-11 13:47   ` bug#54358: " Efraim Flashner

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).