unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#39311] [PATCH] gnu: Add guix-vim.
@ 2020-01-27 17:20 Efraim Flashner
  2020-01-27 22:28 ` Ricardo Wurmus
  0 siblings, 1 reply; 3+ messages in thread
From: Efraim Flashner @ 2020-01-27 17:20 UTC (permalink / raw)
  To: 39311; +Cc: Efraim Flashner

* gnu/packages/vim.scm (guix-vim): New variable.
---
 gnu/packages/vim.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index b5952e3e21..a2d715dc1c 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -938,3 +938,45 @@ through its msgpack-rpc API.")
 
 (define-public python2-pynvim
   (package-with-python2 python-pynvim))
+
+(define-public guix-vim
+  (package
+    (name "guix-vim")
+    (version "0.1")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                     (url "https://gitlab.com/Efraim/guix.vim")
+                     (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1f8h8m96fqh3f9hy87spgh9kdqzyxl11n9s3rywvyq5xhn489bnk"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'build)
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (vimfiles (string-append out "/share/vim/vimfiles"))
+                    (compiler (string-append vimfiles "/compiler"))
+                    (doc      (string-append vimfiles "/doc"))
+                    (indent   (string-append vimfiles "/indent"))
+                    (ftdetect (string-append vimfiles "/ftdetect"))
+                    (ftplugin (string-append vimfiles "/ftplugin"))
+                    (syntax   (string-append vimfiles "/syntax")))
+               (copy-recursively "compiler" compiler)
+               (copy-recursively "doc" doc)
+               (copy-recursively "indent" indent)
+               (copy-recursively "ftdetect" ftdetect)
+               (copy-recursively "ftplugin" ftplugin)
+               (copy-recursively "syntax" syntax)
+               #t))))))
+    (home-page "https://gitlab.com/Efraim/guix.vim")
+    (synopsis "Guix integration in Vim")
+    (description "This package provides support for GNU Guix in Vim.")
+    (license license:vim)))
-- 
2.25.0

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

* [bug#39311] [PATCH] gnu: Add guix-vim.
  2020-01-27 17:20 [bug#39311] [PATCH] gnu: Add guix-vim Efraim Flashner
@ 2020-01-27 22:28 ` Ricardo Wurmus
  2020-01-28  7:43   ` bug#39311: " Efraim Flashner
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo Wurmus @ 2020-01-27 22:28 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: 39311


Hi Efraim,

> * gnu/packages/vim.scm (guix-vim): New variable.
> ---
>  gnu/packages/vim.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
>
> diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
> index b5952e3e21..a2d715dc1c 100644
> --- a/gnu/packages/vim.scm
> +++ b/gnu/packages/vim.scm
> @@ -938,3 +938,45 @@ through its msgpack-rpc API.")
>  
>  (define-public python2-pynvim
>    (package-with-python2 python-pynvim))
> +
> +(define-public guix-vim

Looks like we usually prefix vim extensions with “vim-”, so should this
be “vim-guix” instead…?

> +         (replace 'install
> +           (lambda* (#:key outputs #:allow-other-keys)
> +             (let* ((out (assoc-ref outputs "out"))
> +                    (vimfiles (string-append out "/share/vim/vimfiles"))
> +                    (compiler (string-append vimfiles "/compiler"))
> +                    (doc      (string-append vimfiles "/doc"))
> +                    (indent   (string-append vimfiles "/indent"))
> +                    (ftdetect (string-append vimfiles "/ftdetect"))
> +                    (ftplugin (string-append vimfiles "/ftplugin"))
> +                    (syntax   (string-append vimfiles "/syntax")))
> +               (copy-recursively "compiler" compiler)
> +               (copy-recursively "doc" doc)
> +               (copy-recursively "indent" indent)
> +               (copy-recursively "ftdetect" ftdetect)
> +               (copy-recursively "ftplugin" ftplugin)
> +               (copy-recursively "syntax" syntax)
> +               #t))))))

The repetition here tickles me a little.  How about this instead…?

(for-each (lambda (dir)
           (copy-recursively dir (string-append vimfiles "/" dir)))
          '("compiler" "doc" "indent" "ftdetect" "ftplugin" "syntax"))

-- 
Ricardo

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

* bug#39311: [PATCH] gnu: Add guix-vim.
  2020-01-27 22:28 ` Ricardo Wurmus
@ 2020-01-28  7:43   ` Efraim Flashner
  0 siblings, 0 replies; 3+ messages in thread
From: Efraim Flashner @ 2020-01-28  7:43 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: 39311-done

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

On Mon, Jan 27, 2020 at 11:28:20PM +0100, Ricardo Wurmus wrote:
> 
> Hi Efraim,
> 
> > * gnu/packages/vim.scm (guix-vim): New variable.
> > ---
> >  gnu/packages/vim.scm | 42 ++++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 42 insertions(+)
> >
> > diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
> > index b5952e3e21..a2d715dc1c 100644
> > --- a/gnu/packages/vim.scm
> > +++ b/gnu/packages/vim.scm
> > @@ -938,3 +938,45 @@ through its msgpack-rpc API.")
> >  
> >  (define-public python2-pynvim
> >    (package-with-python2 python-pynvim))
> > +
> > +(define-public guix-vim
> 
> Looks like we usually prefix vim extensions with “vim-”, so should this
> be “vim-guix” instead…?

Good call

> 
> > +         (replace 'install
> > +           (lambda* (#:key outputs #:allow-other-keys)
> > +             (let* ((out (assoc-ref outputs "out"))
> > +                    (vimfiles (string-append out "/share/vim/vimfiles"))
> > +                    (compiler (string-append vimfiles "/compiler"))
> > +                    (doc      (string-append vimfiles "/doc"))
> > +                    (indent   (string-append vimfiles "/indent"))
> > +                    (ftdetect (string-append vimfiles "/ftdetect"))
> > +                    (ftplugin (string-append vimfiles "/ftplugin"))
> > +                    (syntax   (string-append vimfiles "/syntax")))
> > +               (copy-recursively "compiler" compiler)
> > +               (copy-recursively "doc" doc)
> > +               (copy-recursively "indent" indent)
> > +               (copy-recursively "ftdetect" ftdetect)
> > +               (copy-recursively "ftplugin" ftplugin)
> > +               (copy-recursively "syntax" syntax)
> > +               #t))))))
> 
> The repetition here tickles me a little.  How about this instead…?
> 
> (for-each (lambda (dir)
>            (copy-recursively dir (string-append vimfiles "/" dir)))
>           '("compiler" "doc" "indent" "ftdetect" "ftplugin" "syntax"))

This will also be good if we ever get around to making a
vim-build-system.

-- 
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] 3+ messages in thread

end of thread, other threads:[~2020-01-28  7:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-27 17:20 [bug#39311] [PATCH] gnu: Add guix-vim Efraim Flashner
2020-01-27 22:28 ` Ricardo Wurmus
2020-01-28  7:43   ` bug#39311: " 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).