| 1 | ;;; Copyright © 2020 John Soo <jsoo1@asu.edu> |
| 2 | ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
| 3 | ;;; |
| 4 | ;;; This file is part of GNU Guix. |
| 5 | ;;; |
| 6 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
| 7 | ;;; under the terms of the GNU General Public License as published by |
| 8 | ;;; the Free Software Foundation; either version 3 of the License, or (at |
| 9 | ;;; your option) any later version. |
| 10 | ;;; |
| 11 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
| 12 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | ;;; GNU General Public License for more details. |
| 15 | ;;; |
| 16 | ;;; You should have received a copy of the GNU General Public License |
| 17 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
| 18 | |
| 19 | (define-module (gnu packages dhall) |
| 20 | #:use-module (gnu packages) |
| 21 | #:use-module (gnu packages haskell-xyz) |
| 22 | #:use-module (gnu packages haskell-check) |
| 23 | #:use-module (gnu packages haskell-crypto) |
| 24 | #:use-module (gnu packages haskell-web) |
| 25 | #:use-module (guix download) |
| 26 | #:use-module (guix build-system haskell) |
| 27 | #:use-module ((guix licenses) #:prefix license:) |
| 28 | #:use-module (guix packages)) |
| 29 | |
| 30 | (define-public dhall |
| 31 | (package |
| 32 | (name "dhall") |
| 33 | (version "1.32.0") |
| 34 | (source |
| 35 | (origin |
| 36 | (method url-fetch) |
| 37 | (uri (string-append "https://hackage.haskell.org/package/dhall/dhall-" |
| 38 | version ".tar.gz")) |
| 39 | (sha256 |
| 40 | (base32 "1imj0bh5365pdizvjbw2wqz0g9hakigf1zm4fr6379qdchxpp90p")))) |
| 41 | (build-system haskell-build-system) |
| 42 | (inputs |
| 43 | `(("ghc-aeson" ,ghc-aeson) |
| 44 | ("ghc-aeson-pretty" ,ghc-aeson-pretty) |
| 45 | ("ghc-ansi-terminal" ,ghc-ansi-terminal) |
| 46 | ("ghc-atomic-write" ,ghc-atomic-write-0.2.0.7) |
| 47 | ("ghc-case-insensitive" ,ghc-case-insensitive) |
| 48 | ("ghc-cborg" ,ghc-cborg) |
| 49 | ("ghc-cborg-json" ,ghc-cborg-json) |
| 50 | ("ghc-contravariant" ,ghc-contravariant) |
| 51 | ("ghc-data-fix" ,ghc-data-fix) |
| 52 | ("ghc-diff" ,ghc-diff) |
| 53 | ("ghc-dotgen" ,ghc-dotgen) |
| 54 | ("ghc-either" ,ghc-either) |
| 55 | ("ghc-exceptions" ,ghc-exceptions) |
| 56 | ("ghc-half" ,ghc-half) |
| 57 | ("ghc-hashable" ,ghc-hashable) |
| 58 | ("ghc-lens-family-core" ,ghc-lens-family-core) |
| 59 | ("ghc-megaparsec" ,ghc-megaparsec) |
| 60 | ("ghc-memory" ,ghc-memory) |
| 61 | ("ghc-network-uri" ,ghc-network-uri) |
| 62 | ("ghc-optparse-applicative" ,ghc-optparse-applicative) |
| 63 | ("ghc-parsers" ,ghc-parsers) |
| 64 | ("ghc-parser-combinators" ,ghc-parser-combinators) |
| 65 | ("ghc-prettyprinter" ,ghc-prettyprinter-1.6) |
| 66 | ("ghc-prettyprinter-ansi-terminal" ,ghc-prettyprinter-ansi-terminal) |
| 67 | ("ghc-pretty-simple" ,ghc-pretty-simple) |
| 68 | ("ghc-profunctors" ,ghc-profunctors) |
| 69 | ("ghc-repline" ,ghc-repline-0.3) |
| 70 | ("ghc-serialise" ,ghc-serialise) |
| 71 | ("ghc-scientific" ,ghc-scientific) |
| 72 | ("ghc-text-manipulate" ,ghc-text-manipulate) |
| 73 | ("ghc-th-lift-instances" ,ghc-th-lift-instances) |
| 74 | ("ghc-transformers-compat" ,ghc-transformers-compat) |
| 75 | ("ghc-unordered-containers" ,ghc-unordered-containers) |
| 76 | ("ghc-uri-encode" ,ghc-uri-encode) |
| 77 | ("ghc-vector" ,ghc-vector) |
| 78 | ("ghc-cryptonite" ,ghc-cryptonite) |
| 79 | ("ghc-http-types" ,ghc-http-types) |
| 80 | ("ghc-http-client" ,ghc-http-client) |
| 81 | ("ghc-http-client-tls" ,ghc-http-client-tls))) |
| 82 | (native-inputs |
| 83 | `(("ghc-foldl" ,ghc-foldl) |
| 84 | ("ghc-generic-random" ,ghc-generic-random-1.3.0.1) |
| 85 | ("ghc-quickcheck" ,ghc-quickcheck) |
| 86 | ("ghc-quickcheck-instances" ,ghc-quickcheck-instances) |
| 87 | ("ghc-semigroups" ,ghc-semigroups) |
| 88 | ("ghc-special-values" ,ghc-special-values) |
| 89 | ("ghc-spoon" ,ghc-spoon) |
| 90 | ("ghc-tasty" ,ghc-tasty) |
| 91 | ("ghc-tasty-expected-failure" ,ghc-tasty-expected-failure) |
| 92 | ("ghc-tasty-hunit" ,ghc-tasty-hunit) |
| 93 | ("ghc-tasty-quickcheck" ,ghc-tasty-quickcheck) |
| 94 | ("ghc-turtle" ,ghc-turtle) |
| 95 | ("ghc-mockery" ,ghc-mockery) |
| 96 | ("ghc-doctest" ,ghc-doctest))) |
| 97 | (arguments |
| 98 | `(#:phases |
| 99 | (modify-phases %standard-phases |
| 100 | (add-after 'unpack 'remove-network-tests |
| 101 | (lambda _ |
| 102 | (with-directory-excursion "dhall-lang/tests" |
| 103 | (for-each |
| 104 | delete-file |
| 105 | '("import/failure/referentiallyInsane.dhall" |
| 106 | "import/success/customHeadersA.dhall" |
| 107 | "import/success/noHeaderForwardingA.dhall" |
| 108 | "import/success/unit/RemoteAsTextA.dhall" |
| 109 | "import/success/unit/SimpleRemoteA.dhall" |
| 110 | "import/success/unit/asLocation/RemoteChain1A.dhall" |
| 111 | "import/success/unit/asLocation/RemoteChain2A.dhall" |
| 112 | "import/success/unit/asLocation/RemoteChain3A.dhall" |
| 113 | "import/success/unit/asLocation/RemoteChainEnvA.dhall" |
| 114 | "import/success/unit/asLocation/RemoteChainMissingA.dhall" |
| 115 | "type-inference/success/CacheImportsA.dhall" |
| 116 | "type-inference/success/CacheImportsCanonicalizeA.dhall"))) |
| 117 | (substitute* "src/Dhall/Tutorial.hs" |
| 118 | (((string-append |
| 119 | "-- >>> input auto " |
| 120 | "\"https://raw.githubusercontent.com/dhall-lang" |
| 121 | "/dhall-haskell/18e4e9a18dc53271146df3ccf5b4177c3552236b/" |
| 122 | "examples/True\" :: IO Bool")) |
| 123 | "") |
| 124 | (((string-append |
| 125 | "-- >>> input auto " |
| 126 | "\"False == " |
| 127 | "https://raw.githubusercontent.com/dhall-lang" |
| 128 | "/dhall-haskell/18e4e9a18dc53271146df3ccf5b4177c3552236b/" |
| 129 | "examples/True\" :: IO Bool")) |
| 130 | "")) |
| 131 | #t))))) |
| 132 | (home-page "https://dhall-lang.org/") |
| 133 | (synopsis "Configuration language guaranteed to terminate") |
| 134 | (description |
| 135 | "Dhall is an explicitly typed configuration language that is not Turing |
| 136 | complete. Despite being Turing incomplete, Dhall is a real programming |
| 137 | language with a type-checker and evaluator. |
| 138 | |
| 139 | Use this library to parse, type-check, evaluate, and pretty-print the Dhall |
| 140 | configuration language. This package also includes an executable which |
| 141 | type-checks a Dhall file and reduces the file to a fully evaluated normal |
| 142 | form.") |
| 143 | (license license:bsd-3))) |