GNU bug report logs - #54358
[PATCH] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins

Previous Next

Package: guix-patches;

Reported by: "(unmatched-parenthesis" <paren <at> disroot.org>

Date: Sat, 12 Mar 2022 22:01:01 UTC

Severity: normal

Tags: patch

Done: Efraim Flashner <efraim <at> flashner.co.il>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 54358 in the body.
You can then email your comments to 54358 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#54358; Package guix-patches. (Sat, 12 Mar 2022 22:01:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "(unmatched-parenthesis" <paren <at> disroot.org>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 12 Mar 2022 22:01:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "(unmatched-parenthesis" <paren <at> disroot.org>
To: guix-patches <at> gnu.org
Cc: "\(unmatched-parenthesis" <paren <at> disroot.org>
Subject: [PATCH] gnu: rust-parinfer: add phases to install the bundled Vim and
 Kakoune plugins
Date: Sat, 12 Mar 2022 22:00:30 +0000
* 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





Information forwarded to guix-patches <at> gnu.org:
bug#54358; Package guix-patches. (Sun, 13 Mar 2022 22:21:01 GMT) Full text and rfc822 format available.

Message #8 received at 54358 <at> debbugs.gnu.org (full text, mbox):

From: paren <at> disroot.org
To: 54358 <at> debbugs.gnu.org
Subject: Superseded
Date: Sun, 13 Mar 2022 22:20:35 +0000
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.




Information forwarded to guix-patches <at> gnu.org:
bug#54358; Package guix-patches. (Thu, 08 Feb 2024 15:11:01 GMT) Full text and rfc822 format available.

Message #11 received at 54358 <at> debbugs.gnu.org (full text, mbox):

From: Herman Rimm <herman <at> rimm.ee>
To: 54358 <at> debbugs.gnu.org
Cc: "\(unmatched-parenthesis" <paren <at> disroot.org>
Subject: [PATCH] gnu: parinfer-rust: Add phase to install Vim and Kakoune
 plugins.
Date: Thu,  8 Feb 2024 16:10:15 +0100
From: "(unmatched-parenthesis" <paren <at> 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 <at> gmail.com>
 ;;; Copyright © 2023 Jaeme Sifat <jaeme <at> runbox.com>
 ;;; Copyright © 2023 David Pflug <david <at> pflug.io>
+;;; Copyright © 2024 ( <paren <at> disroot.org>
+;;; Copyright © 2024 Herman Rimm <herman <at> 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





Reply sent to Efraim Flashner <efraim <at> flashner.co.il>:
You have taken responsibility. (Sun, 11 Feb 2024 13:56:03 GMT) Full text and rfc822 format available.

Notification sent to "(unmatched-parenthesis" <paren <at> disroot.org>:
bug acknowledged by developer. (Sun, 11 Feb 2024 13:56:03 GMT) Full text and rfc822 format available.

Message #16 received at 54358-done <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Herman Rimm <herman <at> rimm.ee>
Cc: "\(unmatched-parenthesis" <paren <at> disroot.org>, 54358-done <at> debbugs.gnu.org
Subject: Re: [bug#54358] [PATCH] gnu: parinfer-rust: Add phase to install Vim
 and Kakoune plugins.
Date: Sun, 11 Feb 2024 15:47:43 +0200
[Message part 1 (text/plain, inline)]
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 <at> 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
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 11 Mar 2024 11:24:10 GMT) Full text and rfc822 format available.

This bug report was last modified 46 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.