gnu: Add hyperledger-iroha.
[jackhill/guix/guix.git] / gnu / packages / idris.scm
index 79f89d6..14b1688 100644 (file)
@@ -2,6 +2,7 @@
 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
 ;;; Copyright © 2016, 2017 David Craven <david@craven.ch>
 ;;; Copyright © 2018 Alex ter Weele <alex.ter.weele@gmail.com>
+;;; Copyright © 2019 Eric Bavier <bavier@member.fsf.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages idris)
-  #:use-module (gnu packages haskell)
+  #:use-module (gnu packages)
   #:use-module (gnu packages haskell-check)
   #:use-module (gnu packages haskell-web)
+  #:use-module (gnu packages haskell-xyz)
+  #:use-module (gnu packages libffi)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages perl)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system haskell)
   #:use-module (guix download)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages))
 
-(define ghc-aeson-1.1.2.0
-  (package (inherit ghc-aeson)
-    (version "1.1.2.0")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append
-             "https://hackage.haskell.org/package/aeson/aeson-"
-             version
-             ".tar.gz"))
-       (sha256
-        (base32
-         "1zy5z8pzvh53qkjm0nm3f4rwqfqg3867ck8ncd6mrxpcyvxqqj1p"))))))
-
-(define ghc-trifecta-1.6.2.1
-  (package (inherit ghc-trifecta)
-    (version "1.6.2.1")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append
-             "https://hackage.haskell.org/package/trifecta/"
-             "trifecta-" version ".tar.gz"))
-       (sha256
-        (base32
-         "1rgv62dlmm4vkdymx5rw5jg3w8ifpzg1745rvs1m4kzdx16p5cxs"))))))
-
-;; ghc-cheapskate appeared too new. This follows LTS Haskell.
-(define ghc-cheapskate-0.1.0.5
-  (package
-    (inherit ghc-cheapskate)
-    (version "0.1.0.5")
-    (source
-     (origin
-       (method url-fetch)
-       (uri (string-append
-             "https://hackage.haskell.org/package/cheapskate/cheapskate-"
-             version
-             ".tar.gz"))
-       (sha256
-        (base32
-         "0cpsmfx5z2xykg71sv8j7pl8ga6pzyjnjdb9bxn00vcpqkzvfqvs"))))
-    (arguments
-     ;; LTS Haskell says data-default >=0.5 && <0.8
-     `(#:configure-flags (list "--allow-newer=data-default")))))
-
 (define-public idris
   (package
     (name "idris")
-    (version "1.0")
+    (version "1.3.2")
     (source (origin
               (method url-fetch)
               (uri (string-append
                     "idris-" version "/idris-" version ".tar.gz"))
               (sha256
                (base32
-                "1srbz0cyvd0k1yqgbrwnfj94yg5y3z533q1kzac96z1h7v454s5h"))))
+                "0wychzkg0yghd2pp8fqz78vp1ayzks191knfpl7mhh8igsmb6bc7"))))
     (build-system haskell-build-system)
+    (native-inputs                      ;For tests
+     `(("perl" ,perl)
+       ("ghc-tasty" ,ghc-tasty)
+       ("ghc-tasty-golden" ,ghc-tasty-golden)
+       ("ghc-tasty-rerun" ,ghc-tasty-rerun)))
     (inputs
      `(("gmp" ,gmp)
        ("ncurses" ,ncurses)
-       ("ghc-aeson" ,ghc-aeson-1.1.2.0)
+       ("ghc-aeson" ,ghc-aeson)
        ("ghc-annotated-wl-pprint" ,ghc-annotated-wl-pprint)
        ("ghc-ansi-terminal" ,ghc-ansi-terminal)
        ("ghc-ansi-wl-pprint" ,ghc-ansi-wl-pprint)
        ("ghc-base64-bytestring" ,ghc-base64-bytestring)
        ("ghc-blaze-html" ,ghc-blaze-html)
        ("ghc-blaze-markup" ,ghc-blaze-markup)
-       ("ghc-cheapskate" ,ghc-cheapskate-0.1.0.5)
+       ("ghc-cheapskate" ,ghc-cheapskate)
        ("ghc-code-page" ,ghc-code-page)
        ("ghc-fingertree" ,ghc-fingertree)
        ("ghc-fsnotify" ,ghc-fsnotify)
        ("ghc-ieee754" ,ghc-ieee754)
-       ("ghc-mtl" ,ghc-mtl)
+       ("ghc-libffi" ,ghc-libffi)
+       ("ghc-megaparsec" ,ghc-megaparsec)
        ("ghc-network" ,ghc-network)
        ("ghc-optparse-applicative" ,ghc-optparse-applicative)
        ("ghc-regex-tdfa" ,ghc-regex-tdfa)
        ("ghc-safe" ,ghc-safe)
        ("ghc-split" ,ghc-split)
        ("ghc-terminal-size" ,ghc-terminal-size)
-       ("ghc-text" ,ghc-text)
-       ("ghc-trifecta" ,ghc-trifecta-1.6.2.1)
        ("ghc-uniplate" ,ghc-uniplate)
        ("ghc-unordered-containers" ,ghc-unordered-containers)
        ("ghc-utf8-string" ,ghc-utf8-string)
        ("ghc-vector-binary-instances" ,ghc-vector-binary-instances)
        ("ghc-zip-archive" ,ghc-zip-archive)))
     (arguments
-     `(#:tests? #f ; FIXME: Test suite doesn't run in a sandbox.
-       #:configure-flags
+     `(#:configure-flags
        (list (string-append "--datasubdir="
-                            (assoc-ref %outputs "out") "/lib/idris"))
+                            (assoc-ref %outputs "out") "/lib/idris")
+             "-fFFI" "-fGMP")
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'update-constraints
+           (lambda _
+             (substitute* "idris.cabal"
+               (("ansi-terminal < 0\\.9") "ansi-terminal < 0.10"))
+             #t))
          (add-before 'configure 'set-cc-command
            (lambda _
              (setenv "CC" "gcc")
                 (lambda (module)
                   (symlink (string-append modules "/" module)
                            (string-append lib "/" module)))
-                '("prelude" "base" "contrib" "effects" "pruviloj"))))))))
+                '("prelude" "base" "contrib" "effects" "pruviloj")))))
+         (delete 'check)                ;Run check later
+         (add-after 'install 'check
+           (lambda* (#:key outputs #:allow-other-keys #:rest args)
+             (let ((out (assoc-ref outputs "out")))
+               (setenv "TASTY_NUM_THREADS" (number->string (parallel-job-count)))
+               (setenv "IDRIS_CC" "gcc") ;Needed for creating executables
+               (setenv "PATH" (string-append out "/bin:" (getenv "PATH")))
+               (apply (assoc-ref %standard-phases 'check) args)))))))
     (native-search-paths
      (list (search-path-specification
             (variable "IDRIS_LIBRARY_PATH")
             (files '("lib/idris")))))
-    (home-page "http://www.idris-lang.org")
+    (home-page "https://www.idris-lang.org")
     (synopsis "General purpose language with full dependent types")
     (description "Idris is a general purpose language with full dependent
 types.  It is compiled, with eager evaluation.  Dependent types allow types to