From: Distopico <distopico@riseup.net>
To: 64840@debbugs.gnu.org
Cc: Distopico <distopico@riseup.net>
Subject: [bug#64840] [PATCH 12/12] gnu: Add elm-format.
Date: Mon, 24 Jul 2023 15:23:14 -0500 [thread overview]
Message-ID: <20230724202532.8993-12-distopico@riseup.net> (raw)
In-Reply-To: <20230724202532.8993-1-distopico@riseup.net>
* gnu/packages/elm.scm (elm-format): New variable.
---
gnu/packages/elm.scm | 197 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 197 insertions(+)
diff --git a/gnu/packages/elm.scm b/gnu/packages/elm.scm
index a74d294ae5..5361634abb 100644
--- a/gnu/packages/elm.scm
+++ b/gnu/packages/elm.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2019 Robert Vollmert <rob@vllmrt.net>
;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
;;; Copyright © 2022 jgart <jgart@dismail.de>
+;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico@riseup.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -384,6 +385,202 @@ (define-public elm-bytes
and @code{DataView}.")
(license license:bsd-3)))
+(define elm-format-avh4-lib
+ (let ((commit "b5cca4c26b473dab06e5d73b98148637e4770d45"))
+ (package
+ (name "elm-format-avh4-lib")
+ (version "0.0.0.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/avh4/elm-format")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "04l1bn4w8q3ifd6mc4mfrqxfbihmqnpfjdn6gr0x2jqcasjbk0bi"))))
+ (build-system haskell-build-system)
+ (properties '((upstream-name . "avh4-lib") (hidden? #t)))
+ (arguments
+ ;; Require and use ghc-text but ghc doesn't detect it
+ `(#:configure-flags (list "--ghc-option=-Wno-error=unused-packages")
+ #:tests? #f
+ #:phases (modify-phases %standard-phases
+ (add-after 'unpack 'enter-lib-subdirectory
+ (lambda _
+ (chdir "avh4-lib"))))))
+ (inputs (list ghc-pooled-io ghc-text ghc-relude))
+ (native-inputs (list ghc-tasty ghc-tasty-hunit ghc-tasty-hspec))
+ (home-page "https://github.com/avh4/elm-format/tree/main/avh4-lib")
+ (synopsis "Common code for elm-format packages")
+ (description
+ "This packages provides common code for @command{elm-format} haskell projects.")
+ (license license:bsd-3))))
+
+(define elm-format-test-lib
+ (let ((commit "b5cca4c26b473dab06e5d73b98148637e4770d45"))
+ (package
+ (name "elm-format-test-lib")
+ (version "0.0.0.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/avh4/elm-format")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "04l1bn4w8q3ifd6mc4mfrqxfbihmqnpfjdn6gr0x2jqcasjbk0bi"))))
+ (build-system haskell-build-system)
+ (properties '((upstream-name . "elm-format-test-lib") (hidden? #t)))
+ (arguments
+ `(#:tests? #f
+ #:phases (modify-phases %standard-phases
+ (add-after 'unpack 'enter-lib-subdirectory
+ (lambda _
+ (chdir "elm-format-test-lib"))))))
+ (inputs (list elm-format-avh4-lib ghc-split ghc-text))
+ (native-inputs (list ghc-hspec-golden ghc-hspec ghc-tasty-hspec
+ ghc-tasty-hunit))
+ (home-page
+ "https://github.com/avh4/elm-format/tree/main/elm-format-test-lib")
+ (synopsis "Test helpers used by elm-format")
+ (description "This package provides elf-format helpers for test used by
+@command{elm-format}, elm-format-tests and elm-refactor-tests.")
+ (license license:bsd-3))))
+
+(define elm-format-markdown
+ (let ((commit "b5cca4c26b473dab06e5d73b98148637e4770d45"))
+ (package
+ (name "elm-format-markdown")
+ (version "0.0.0.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/avh4/elm-format")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "04l1bn4w8q3ifd6mc4mfrqxfbihmqnpfjdn6gr0x2jqcasjbk0bi"))))
+ (build-system haskell-build-system)
+ (properties '((upstream-name . "elm-format-markdown") (hidden? #t)))
+ (arguments
+ `(#:tests? #f
+ #:phases (modify-phases %standard-phases
+ (add-after 'unpack 'enter-lib-subdirectory
+ (lambda _
+ (chdir "elm-format-markdown"))))))
+ (inputs (list elm-format-avh4-lib ghc-split ghc-text))
+ (native-inputs (list ghc-hspec-golden ghc-tasty ghc-tasty-hunit
+ ghc-tasty-hspec))
+ (home-page
+ "https://github.com/avh4/elm-format/blob/main/elm-format-markdown")
+ (synopsis "Markdown parsing for Elm documentation comments")
+ (description "This package provides an markdown parsing for Elm
+documentation comments used by @command{elm-format}.")
+ (license license:bsd-3))))
+
+(define elm-format-lib
+ (let ((commit "b5cca4c26b473dab06e5d73b98148637e4770d45"))
+ (package
+ (name "elm-format-lib")
+ (version "0.0.0.1")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/avh4/elm-format")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "04l1bn4w8q3ifd6mc4mfrqxfbihmqnpfjdn6gr0x2jqcasjbk0bi"))))
+ (build-system haskell-build-system)
+ (properties '((upstream-name . "elm-format-lib") (hidden? #t)))
+ (arguments
+ `(#:tests? #f
+ #:phases (modify-phases %standard-phases
+ (add-after 'unpack 'enter-lib-subdirectory
+ (lambda _
+ (chdir "elm-format-lib"))))))
+ (inputs
+ (list elm-format-avh4-lib
+ elm-format-markdown
+ ghc-optparse-applicative
+ ghc-aeson-2.1
+ ghc-bimap
+ ghc-relude
+ ghc-text))
+ (native-inputs
+ (list elm-format-test-lib
+ ghc-split
+ ghc-hspec
+ ghc-tasty
+ ghc-tasty-hspec
+ ghc-tasty-hunit))
+ (home-page "https://github.com/avh4/elm-format/blob/main/elm-format-lib")
+ (synopsis "Common code used by elm-format")
+ (description "This package provides elm-format library with common code
+used by @command{elm-format} and elm-refactor.")
+ (license license:bsd-3))))
+
+(define-public elm-format
+ (package
+ (name "elm-format")
+ (version "0.8.7")
+ (source (origin
+ (method git-fetch)
+ (file-name (git-file-name name version))
+ (uri (git-reference
+ (url "https://github.com/avh4/elm-format")
+ (commit version)))
+ (sha256
+ (base32
+ "04l1bn4w8q3ifd6mc4mfrqxfbihmqnpfjdn6gr0x2jqcasjbk0bi"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ ;; We don't build these library in this packages.
+ (delete-file-recursively "avh4-lib")
+ (delete-file-recursively "elm-format-lib")
+ (delete-file-recursively "elm-format-test-lib")
+ (delete-file-recursively "elm-format-markdown")))))
+ (build-system haskell-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (add-before 'configure 'ganerate-build-file
+ (lambda _
+ ;; We need crate manually this build file
+ ;; because elm-format use `hpack`.
+ (mkdir "generated")
+ (let ((f (open-file "generated/Build_elm_format.hs" "a")))
+ (display "module Build_elm_format where\n" f)
+ (display "gitDescribe :: String\n" f)
+ (display (string-append "gitDescribe = \""
+ ,(package-version elm-format)
+ "\"") f)
+ (close-port f)))))))
+ (inputs
+ (list elm-format-avh4-lib
+ elm-format-lib
+ ghc-aeson
+ ghc-text
+ ghc-relude
+ ghc-aeson-2.1
+ ghc-ansi-wl-pprint
+ ghc-quickcheck
+ ghc-hspec))
+ (native-inputs
+ (list elm-format-test-lib ghc-tasty ghc-tasty-quickcheck
+ ghc-tasty-hunit ghc-tasty-hspec))
+ (home-page "https://github.com/avh4/elm-format")
+ (synopsis "Source code formatter for Elm programming language")
+ (description
+ "Formats @url{https://elm-lang.org/, Elm} programming language
+source code according to a standard set of rules based on the
+@url{https://elm-lang.org/docs/style-guide, official Elm Style Guide}.")
+ (license license:bsd-3)))
+
(define-public elm-file
(package
(name "elm-file")
--
2.41.0
next prev parent reply other threads:[~2023-07-24 20:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-24 20:15 [bug#64840] [PATCH 00/12] Add elm-format Distopico
2023-07-24 20:23 ` [bug#64840] [PATCH 01/12] gnu: ghc-quickcheck-instances: Update to 0.3.29 Distopico
2023-07-24 20:23 ` [bug#64840] [PATCH 02/12] gnu: Add ghc-generically Distopico
2023-07-24 20:23 ` [bug#64840] [PATCH 03/12] gnu: Add ghc-aeson-2.1 Distopico
2023-07-24 20:23 ` [bug#64840] [PATCH 04/12] gnu: Add ghc-data-array-byte Distopico
2023-07-24 20:23 ` [bug#64840] [PATCH 05/12] gnu: Add ghc-pooled-io Distopico
2023-07-24 20:23 ` [bug#64840] [PATCH 06/12] gnu: Add ghc-text Distopico
2023-07-24 20:23 ` [bug#64840] [PATCH 07/12] gnu: Add ghc-relude Distopico
2023-07-24 20:23 ` [bug#64840] [PATCH 08/12] gnu: Add ghc-concurrent-split Distopico
2023-07-24 20:23 ` [bug#64840] [PATCH 09/12] gnu: Add ghc-hspec-golden Distopico
2023-07-24 20:23 ` [bug#64840] [PATCH 10/12] gnu: Add ghc-bimap Distopico
2023-07-24 20:23 ` [bug#64840] [PATCH 11/12] gnu: Fix missing required ghc-text dependency Distopico
2023-07-24 20:23 ` Distopico [this message]
2023-08-31 17:48 ` [bug#64840] [PATCH 00/12] Add elm-format Distopico
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=20230724202532.8993-12-distopico@riseup.net \
--to=distopico@riseup.net \
--cc=64840@debbugs.gnu.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).