guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

08/12: gnu: Add ghc-hindent.


From: guix-commits
Subject: 08/12: gnu: Add ghc-hindent.
Date: Fri, 19 Jul 2019 23:11:06 -0400 (EDT)

samplet pushed a commit to branch master
in repository guix.

commit 64b7c06e188c7d5a05a5d726eba0cf46698cb78e
Author: Brian Leung <address@hidden>
Date:   Sat Jun 22 23:47:32 2019 +0200

    gnu: Add ghc-hindent.
    
    * gnu/packages/haskell.scm (ghc-hindent): New variable.
---
 gnu/packages/haskell.scm | 60 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm
index c7056a2..2e845d0 100644
--- a/gnu/packages/haskell.scm
+++ b/gnu/packages/haskell.scm
@@ -42,6 +42,7 @@
   #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages elf)
+  #:use-module (gnu packages emacs)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
@@ -11727,6 +11728,65 @@ recursive scanning and copying of directories, working 
with temporary
 files/directories, and more.")
     (license license:bsd-3)))
 
+(define-public ghc-hindent
+  (package
+    (name "ghc-hindent")
+    (version "5.3.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://hackage.haskell.org/package/hindent/hindent-";
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "0wkfik7mvqskk23kyh7ybgnlh3j9j1ym7d3ncahsbli9w654b7xg"))))
+    (build-system haskell-build-system)
+    (arguments
+     `(#:modules ((guix build haskell-build-system)
+                  (guix build utils)
+                  (guix build emacs-utils))
+       #:imported-modules (,@%haskell-build-system-modules
+                           (guix build emacs-utils))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'emacs-install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out   (assoc-ref outputs "out"))
+                    (elisp-file "elisp/hindent.el")
+                    (dest  (string-append out "/share/emacs/site-lisp"
+                                          "/guix.d/hindent-" ,version))
+                    (emacs (string-append (assoc-ref inputs "emacs")
+                                          "/bin/emacs")))
+               (make-file-writable elisp-file)
+               (emacs-substitute-variables elisp-file
+                 ("hindent-process-path"
+                  (string-append out "/bin/hindent")))
+               (install-file elisp-file dest)
+               (emacs-generate-autoloads "hindent" dest)))))))
+    (inputs
+     `(("ghc-haskell-src-exts" ,ghc-haskell-src-exts)
+       ("ghc-monad-loops" ,ghc-monad-loops)
+       ("ghc-utf8-string" ,ghc-utf8-string)
+       ("ghc-exceptions" ,ghc-exceptions)
+       ("ghc-yaml" ,ghc-yaml)
+       ("ghc-unix-compat" ,ghc-unix-compat)
+       ("ghc-path" ,ghc-path)
+       ("ghc-path-io" ,ghc-path-io)
+       ("ghc-optparse-applicative" ,ghc-optparse-applicative)))
+    (native-inputs
+     `(("ghc-hspec" ,ghc-hspec)
+       ("ghc-diff" ,ghc-diff)
+       ("emacs" ,emacs-minimal)))
+    (home-page
+     "https://github.com/commercialhaskell/hindent";)
+    (synopsis "Extensible Haskell pretty printer")
+    (description
+     "This package provides automatic formatting for Haskell files.  Both a
+library and an executable.")
+    (license license:bsd-3)))
+
 (define-public ghc-descriptive
   (package
     (name "ghc-descriptive")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]