From patchwork Mon Jul 24 20:23:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Distopico X-Patchwork-Id: 52179 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 11B5027BBEA; Mon, 24 Jul 2023 21:28:00 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id AB22A27BBE2 for ; Mon, 24 Jul 2023 21:27:58 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qO29I-0001p1-D4; Mon, 24 Jul 2023 16:27:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qO294-0001l7-Q2 for guix-patches@gnu.org; Mon, 24 Jul 2023 16:27:08 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qO294-00009Q-Hu for guix-patches@gnu.org; Mon, 24 Jul 2023 16:27:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qO294-00055k-EN for guix-patches@gnu.org; Mon, 24 Jul 2023 16:27:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64840] [PATCH 12/12] gnu: Add elm-format. Resent-From: Distopico Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 24 Jul 2023 20:27:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64840 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64840@debbugs.gnu.org Cc: Distopico Received: via spool by 64840-submit@debbugs.gnu.org id=B64840.169023039419457 (code B ref 64840); Mon, 24 Jul 2023 20:27:06 +0000 Received: (at 64840) by debbugs.gnu.org; 24 Jul 2023 20:26:34 +0000 Received: from localhost ([127.0.0.1]:44229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qO28X-00053g-Ec for submit@debbugs.gnu.org; Mon, 24 Jul 2023 16:26:34 -0400 Received: from mx0.riseup.net ([198.252.153.6]:48082) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qO28R-00051y-CE for 64840@debbugs.gnu.org; Mon, 24 Jul 2023 16:26:28 -0400 Received: from fews01-sea.riseup.net (fews01-sea-pn.riseup.net [10.0.1.109]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx0.riseup.net (Postfix) with ESMTPS id 4R8sBQ02Syz9tVr for <64840@debbugs.gnu.org>; Mon, 24 Jul 2023 20:26:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1690230382; bh=Y5KW/nV4n2loILQ0OvfTyoMFkNCwuIDGPndOgtGPpn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RdyQRfCVt2fxZNvAiI0mXKZLvONpONRpd/nHi2omc+ByUXAgnb1mBm5qiQTCBF2X8 /ZXkzpgFN6ZqAiNJHw0nB4sCOym20X1Nwxu91JgZEd+CwkqO1jDLoy+5XbPoZFoqHH /DNF/zLuxBRqqBfVTuPnJqu22T6NtrWK6dGC7vgs= X-Riseup-User-ID: 1489D06B7A9FB2A5FB20DF6C417688C1674103A5A37CBA07129DD76A731FCEC9 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews01-sea.riseup.net (Postfix) with ESMTPSA id 4R8sBP2Cn4zJnsj; Mon, 24 Jul 2023 20:26:21 +0000 (UTC) From: Distopico Date: Mon, 24 Jul 2023 15:23:14 -0500 Message-ID: <20230724202532.8993-12-distopico@riseup.net> In-Reply-To: <20230724202532.8993-1-distopico@riseup.net> References: <20230724202532.8993-1-distopico@riseup.net> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 ;;; Copyright © 2022 Philip McGrath ;;; Copyright © 2022 jgart +;;; Copyright © 2023 Camilo Q.S. (Distopico) ;;; ;;; 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")