unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Herman Rimm via Guix-patches via <guix-patches@gnu.org>
To: 54358@debbugs.gnu.org
Cc: "\(unmatched-parenthesis" <paren@disroot.org>
Subject: [bug#54358] [PATCH] gnu: parinfer-rust: Add phase to install Vim and Kakoune plugins.
Date: Thu,  8 Feb 2024 16:10:15 +0100	[thread overview]
Message-ID: <a2e476a7aaf6394bbe5b7c63248f016d97a40183.1707404260.git.herman@rimm.ee> (raw)
In-Reply-To: <20220312220030.17172-1-paren@disroot.org>

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





  parent reply	other threads:[~2024-02-08 15:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2024-02-11 13:47   ` bug#54358: [PATCH] gnu: parinfer-rust: Add phase to install Vim and Kakoune plugins Efraim Flashner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a2e476a7aaf6394bbe5b7c63248f016d97a40183.1707404260.git.herman@rimm.ee \
    --to=guix-patches@gnu.org \
    --cc=54358@debbugs.gnu.org \
    --cc=herman@rimm.ee \
    --cc=paren@disroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).