@@ -21,10 +21,12 @@
(define-module (gnu packages idris)
#:use-module (gnu packages)
+ #:use-module (gnu packages bash)
#: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 llvm)
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages ncurses)
#:use-module (gnu packages perl)
@@ -33,9 +35,10 @@
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module ((guix licenses) #:prefix license:)
- #:use-module (guix packages))
+ #:use-module (guix packages)
+ #:use-module (guix utils))
-(define-public idris
+(define-public idris-1.3.3
(package
(name "idris")
(version "1.3.3")
@@ -51,12 +54,15 @@
(build-system haskell-build-system)
(native-inputs ;For tests
`(("perl" ,perl)
+ ("clang" ,clang) ; the tests want to generate exeutables
("ghc-cheapskate" ,ghc-cheapskate)
("ghc-tasty" ,ghc-tasty)
("ghc-tasty-golden" ,ghc-tasty-golden)
("ghc-tasty-rerun" ,ghc-tasty-rerun)))
(inputs
- `(("gmp" ,gmp)
+ `(("bash" ,bash-minimal)
+ ("clang" ,clang) ; FIXME clang compiles faster than gcc, but (cc-for-target) ignores it
+ ("gmp" ,gmp)
("ncurses" ,ncurses)
("ghc-aeson" ,ghc-aeson)
("ghc-annotated-wl-pprint" ,ghc-annotated-wl-pprint)
@@ -105,7 +111,7 @@
#t))
(add-before 'configure 'set-cc-command
(lambda _
- (setenv "CC" "gcc")
+ (setenv "CC" ,(cc-for-target))
#t))
(add-after 'install 'fix-libs-install-location
(lambda* (#:key outputs #:allow-other-keys)
@@ -116,14 +122,14 @@
(lambda (module)
(symlink (string-append modules "/" module)
(string-append lib "/" module)))
- '("prelude" "base" "contrib" "effects" "pruviloj")))))
+ '("prelude" "base" "contrib" "effects" "pruviloj")))
+ #t))
(delete 'check) ;Run check later
(add-after 'install 'check
(lambda* (#:key outputs #:allow-other-keys #:rest args)
(let ((out (assoc-ref outputs "out")))
(chmod "test/scripts/timeout" #o755) ;must be executable
(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))))
(add-before 'check 'restore-libidris_rts
@@ -135,8 +141,15 @@
(static (assoc-ref outputs "static"))
(filename "/lib/idris/rts/libidris_rts.a"))
(rename-file (string-append static filename)
- (string-append out filename))
- #t))))))
+ (string-append out filename)))
+ #t))
+ (add-before 'check 'wrap-program
+ (lambda* (#:key outputs inputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (exe (string-append out "/bin/idris")))
+ (wrap-program exe
+ `("IDRIS_CC" = (,',(cc-for-target)))))
+ #true)))))
(native-search-paths
(list (search-path-specification
(variable "IDRIS_LIBRARY_PATH")
@@ -150,6 +163,8 @@ can be specified precisely in the type. The language is closely related to
Epigram and Agda.")
(license license:bsd-3)))
+(define-public idris idris-1.3.3)
+
;; Idris modules use the gnu-build-system so that the IDRIS_LIBRARY_PATH is set.
(define (idris-default-arguments name)
`(#:modules ((guix build gnu-build-system)