From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id CH6ZCM/evmQpKAAASxT56A (envelope-from ) for ; Mon, 24 Jul 2023 22:27:59 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id KPusB8/evmTOIgEAG6o9tA (envelope-from ) for ; Mon, 24 Jul 2023 22:27:59 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BFFE63CCD6 for ; Mon, 24 Jul 2023 22:27:58 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=RdyQRfCV; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1690230478; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=gxU6LCTANkOvuwqTQ3Hp26b2aDsWHpn7+Wh6IZaQ/tY=; b=svRRYNqWLciFsyrd55QOVVEheaW9n6nYO1QwH4nb6sGx0xL9xsNiPLX5EpeO6v/cc40IS4 eLZ0Ubjdxzec7/BAzO8S1N7g/ZRftSs/12TCG993TC1XZ+O4mpLh52Tuqb1uX49oydtWIU AKno1dmUh+ubjhNY06FGns4X8xdUM14HQl1ovCIMaCJprpM1HUBU5C1rOkv8FRY8c2L4W1 Z4qSHro1/vh/0P/yolDNhk5oqVLelhjAE4UtLpKq7hTzNJlFBzeGcq5Bm08Ha+ItWIDRXJ gKVoh3uG2FAzgIdh7VIuWx++Cn1mjlot0VL4J65uoA4hSidPUh4RjMk1QPhKag== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1690230478; a=rsa-sha256; cv=none; b=BAwWs/ABSSxVZ7tFEyn8q4UteH76osKkXqY8H6VpXRvd9iv4BuTupTcd/qeRT2+NVfgPpG WHbBb4TOFy3gTHVKk3ZsusDRpLfMapCWZXTT7LNRKPUtAbY4m5FvDPH+/NAoE72X5RDxBT rCGEDb3PfupvmJCdn9FTsj/aOCYNBQqQvpziZ/8P4CB6uIQYODckpeWUD776+wljtV3YZa hmX++1CcfIJ38WfBct+BACfJSXmbZILvTIU7Hai4lgHQA0Ekgxw9m3P9EL6SOMclRQSBoY bLYGUOj9jDzUr8SEelfo9B8akh/2fTa4xLXL0dpW2yULLFpxQMATrkv8cZ1uNw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=riseup.net header.s=squak header.b=RdyQRfCV; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=riseup.net (policy=none) 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.16 X-Spam-Score: -1.16 X-Migadu-Queue-Id: BFFE63CCD6 X-Migadu-Scanner: mx1.migadu.com X-TUID: hCAWvAEtPKJf * 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") -- 2.41.0