[PATCH] gnu: rust-parinfer: add phases to install the bundled Vim and Kakoune plugins

  • Done
  • quality assurance status badge
Details
3 participants
  • Efraim Flashner
  • Herman Rimm
  • (unmatched-parenthesis
Owner
unassigned
Submitted by
(unmatched-parenthesis
Severity
normal
(
(
(unmatched-parenthesis wrote on 12 Mar 2022 23:00
(address . guix-patches@gnu.org)(name . (unmatched-parenthesis)(address . paren@disroot.org)
20220312220030.17172-1-paren@disroot.org
* 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(-)

Toggle diff (26 lines)
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
P
Superseded
(address . 54358@debbugs.gnu.org)
99f030efde43d752eb941d46243842e3@disroot.org
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.
H
H
Herman Rimm wrote on 8 Feb 16:10 +0100
[PATCH] gnu: parinfer-rust: Add phase to install Vim and Kakoune plugins.
(address . 54358@debbugs.gnu.org)(name . (unmatched-parenthesis)(address . paren@disroot.org)
a2e476a7aaf6394bbe5b7c63248f016d97a40183.1707404260.git.herman@rimm.ee
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(-)

Toggle diff (68 lines)
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
E
E
Efraim Flashner wrote on 11 Feb 14:47 +0100
(name . Herman Rimm)(address . herman@rimm.ee)
ZcjP_3a0y5i94a9-@3900XT
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
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmXIz/sACgkQQarn3Mo9
g1HWYA//QuzwUr5Ziek2KTop4izRu27mTAsiIx09yz+CMEJEsJFnoebAN22bXvcc
U3Ol10logbKKlTJJPXy+pH9E+BuifWUr/TP7dGaiY38+dzWDezVif6CyCButoTDM
ba8y9EqHwFcsE6ndiCeU2/e3QdFqjzyTSqCRo43YtRjD+yCf1iavolYZNNHQ76DC
1CE7039yXulxeMLJb3T/99XeJtAVJQaPPpBFiYulLUBuzshYIQof0RkqwwoFqAlq
TEs9fxk5vOIcaJZZXWOOS1z9TbeWQm4Tzx3HUW1s8lDfWpytYvlmVvEYZWdUff0I
y6Fe5LBTHdVNC+Qko6mUJRtl7t6RJBmXh+4uReeJyx2Izk2v5VDT2QKrHbCHoxaB
g0T4EggrhU1VPQ7arC3XYlT90VBL8UrqFceCH9ChxlqB8Gq+yCW+ujKAmHjFqv8k
N0KNt2m/cDXyu+/mw2t/Y6xUNdb4eKQgafn+qp5AXp7ChmXCLwEaHBt3Cw1NHWpR
KjKml8zgY2EYhFR4NpdI2LpKqXSNeU6zOXACnwzyhUPgQsZ8gYGkslInE5T73AHG
TsKZUyWkbu2N7vFpZ2P4rmrL0Wsj8n3oNhOkiIcpAzcGUUQcVpd2oFhA8LBtNKUr
jEwAtvux03oGHH2JjJPrOcxageF5PtdzSTnWBLgFm7829yBM0Ms=
=JiR2
-----END PGP SIGNATURE-----


Closed
?