diff mbox series

[bug#53772] gnu: Add emacs-blacken.

Message ID 20220204065153.14445-1-jgart@dismail.de
State Accepted
Headers show
Series [bug#53772] gnu: Add emacs-blacken. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

jgart Feb. 4, 2022, 6:51 a.m. UTC
* gnu/packages/emacs-xyz.scm (emacs-blacken): New variable.
---
 gnu/packages/emacs-xyz.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

Comments

Liliana Marie Prikler Feb. 4, 2022, 8:33 a.m. UTC | #1
Am Freitag, dem 04.02.2022 um 01:51 -0500 schrieb jgart:
> * gnu/packages/emacs-xyz.scm (emacs-blacken): New variable.
> ---
>  gnu/packages/emacs-xyz.scm | 24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
> index 521d003a6b..4d6e18f8ba 100644
> --- a/gnu/packages/emacs-xyz.scm
> +++ b/gnu/packages/emacs-xyz.scm
> @@ -29822,6 +29822,30 @@ (define-public emacs-multitran
>  to the @url{https://multitran.com} online dictionary.")
>      (license license:gpl3+)))
>  
> +(define-public emacs-blacken
> +  (package
> +    (name "emacs-blacken")
> +    (version "0.2.0")
> +    (source
> +     (origin
> +       (method git-fetch)
> +       (uri
> +        (git-reference
> +         (url "https://github.com/pythonic-emacs/blacken")
> +         (commit (string-append "v" version))))
> +       (file-name (git-file-name name version))
> +       (sha256
> +        (base32
> "0pf9yllx0h78m925sdrg6hbv54ky2pi7cpkdsnx891qjsahvjnpy"))))
> +    (build-system emacs-build-system)
> +    (inputs
> +      (list python-black))
> +    (home-page "https://github.com/pythonic-emacs/blacken")
> +    (synopsis "Python Black for Emacs")
> +    (description
> +"Use the @command{python} @command{black} package to reformat
> +@command{python} buffers.")
> +    (license license:gpl3)))
> +
>  (define-public emacs-kibit-helper
>    (package
>      (name "emacs-kibit-helper")
As with all command-line utility wrappers, take care to make it
actually refer to the store path of said utility and don't just assume
it exists because it does at build time.

In your case 
  (emacs-substitute-variables "blacken.el" 
    ("blacken-executable" (search-input-file inputs "/bin/blacken")))
ought to do the drill, but be warned that this is me writing untested
Scheme from memory.

Cheers
diff mbox series

Patch

diff --git a/gnu/packages/emacs-xyz.scm b/gnu/packages/emacs-xyz.scm
index 521d003a6b..4d6e18f8ba 100644
--- a/gnu/packages/emacs-xyz.scm
+++ b/gnu/packages/emacs-xyz.scm
@@ -29822,6 +29822,30 @@  (define-public emacs-multitran
 to the @url{https://multitran.com} online dictionary.")
     (license license:gpl3+)))
 
+(define-public emacs-blacken
+  (package
+    (name "emacs-blacken")
+    (version "0.2.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://github.com/pythonic-emacs/blacken")
+         (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0pf9yllx0h78m925sdrg6hbv54ky2pi7cpkdsnx891qjsahvjnpy"))))
+    (build-system emacs-build-system)
+    (inputs
+      (list python-black))
+    (home-page "https://github.com/pythonic-emacs/blacken")
+    (synopsis "Python Black for Emacs")
+    (description
+"Use the @command{python} @command{black} package to reformat
+@command{python} buffers.")
+    (license license:gpl3)))
+
 (define-public emacs-kibit-helper
   (package
     (name "emacs-kibit-helper")