gnu: facter: Update to 4.0.33.
[jackhill/guix/guix.git] / gnu / packages / haskell.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 Federico Beffa <beffa@fbengineering.ch>
3 ;;; Copyright © 2015 Siniša Biđin <sinisa@bidin.eu>
4 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
5 ;;; Copyright © 2015, 2019 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2016, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
7 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
8 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
10 ;;; Copyright © 2016, 2017 David Craven <david@craven.ch>
11 ;;; Copyright © 2017 Danny Milosavljevic <dannym@scratchpost.org>
12 ;;; Copyright © 2017 Peter Mikkelsen <petermikkelsen10@gmail.com>
13 ;;; Copyright © 2017, 2018 Alex Vong <alexvong1995@gmail.com>
14 ;;; Copyright © 2017 rsiddharth <s@ricketyspace.net>
15 ;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
16 ;;; Copyright © 2018 Tonton <tonton@riseup.net>
17 ;;; Copyright © 2018, 2019 Timothy Sample <samplet@ngyro.com>
18 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
19 ;;; Copyright © 2018, 2019 Gabriel Hondet <gabrielhondet@gmail.com>
20 ;;; Copyright © 2019 Robert Vollmert <rob@vllmrt.net>
21 ;;; Copyright © 2019 Jacob MacDonald <jaccarmac@gmail.com>
22 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
23 ;;;
24 ;;; This file is part of GNU Guix.
25 ;;;
26 ;;; GNU Guix is free software; you can redistribute it and/or modify it
27 ;;; under the terms of the GNU General Public License as published by
28 ;;; the Free Software Foundation; either version 3 of the License, or (at
29 ;;; your option) any later version.
30 ;;;
31 ;;; GNU Guix is distributed in the hope that it will be useful, but
32 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
33 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 ;;; GNU General Public License for more details.
35 ;;;
36 ;;; You should have received a copy of the GNU General Public License
37 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
38
39 (define-module (gnu packages haskell)
40 #:use-module (gnu packages)
41 #:use-module (gnu packages bootstrap)
42 #:use-module (gnu packages elf)
43 #:use-module (gnu packages ghostscript)
44 #:use-module (gnu packages libffi)
45 #:use-module (gnu packages lisp)
46 #:use-module (gnu packages multiprecision)
47 #:use-module (gnu packages ncurses)
48 #:use-module (gnu packages perl)
49 #:use-module (gnu packages python)
50 #:use-module (guix build-system gnu)
51 #:use-module (guix download)
52 #:use-module (guix git-download)
53 #:use-module ((guix licenses) #:prefix license:)
54 #:use-module (guix packages)
55 #:use-module (guix utils)
56 #:use-module (ice-9 match)
57 #:use-module (ice-9 regex))
58
59 (define-public cl-yale-haskell
60 (let ((commit "85f94c72a16c5f70301dd8db04cde9de2d7dd270")
61 (revision "1"))
62 (package
63 (name "cl-yale-haskell")
64 (version (string-append "2.0.5-" revision "." (string-take commit 9)))
65 (source (origin
66 (method git-fetch)
67 (uri (git-reference
68 (url "https://git.elephly.net/software/yale-haskell.git")
69 (commit commit)))
70 (file-name (string-append "yale-haskell-" commit "-checkout"))
71 (sha256
72 (base32
73 "0bal3m6ryrjamz5p93bhs9rp5msk8k7lpcqr44wd7xs9b9k8w74g"))))
74 (build-system gnu-build-system)
75 (arguments
76 `(#:tests? #f ; no tests
77 ;; Stripping binaries leads to a broken executable lisp system image.
78 #:strip-binaries? #f
79 #:make-flags
80 (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
81 #:phases
82 (modify-phases %standard-phases
83 (replace 'configure
84 (lambda _
85 (setenv "PRELUDE" "./progs/prelude")
86 (setenv "HASKELL_LIBRARY" "./progs/lib")
87 (setenv "PRELUDEBIN" "./progs/prelude/clisp")
88 (setenv "HASKELLPROG" "./bin/clisp-haskell")
89 #t)))))
90 (inputs
91 `(("clisp" ,clisp)))
92 (home-page "https://git.elephly.net/software/yale-haskell.git")
93 (synopsis "Port of the Yale Haskell system to CLISP")
94 (description "This package provides the Yale Haskell system running on
95 top of CLISP.")
96 (license license:bsd-4))))
97
98 (define ghc-bootstrap-x86_64-7.8.4
99 (origin
100 (method url-fetch)
101 (uri
102 "https://www.haskell.org/ghc/dist/7.8.4/ghc-7.8.4-x86_64-unknown-linux-deb7.tar.xz")
103 (sha256
104 (base32
105 "13azsl53xgj20mi1hj9x0xb32vvcvs6cpmvwx6znxhas7blh0bpn"))))
106
107 (define ghc-bootstrap-i686-7.8.4
108 (origin
109 (method url-fetch)
110 (uri
111 "https://www.haskell.org/ghc/dist/7.8.4/ghc-7.8.4-i386-unknown-linux-deb7.tar.xz")
112 (sha256
113 (base32
114 "0wj5s435j0zgww70bj1d3f6wvnnpzlxwvwcyh2qv4qjq5z8j64kg"))))
115
116 ;; 43 tests out of 3965 fail.
117 ;;
118 ;; Most of them do not appear to be serious:
119 ;;
120 ;; - some tests generate files referring to "/bin/sh" and "/bin/ls". I've not
121 ;; figured out how these references are generated.
122 ;;
123 ;; - Some tests allocate more memory than expected (ca. 3% above upper limit)
124 ;;
125 ;; - Some tests try to load unavailable libriries: Control.Concurrent.STM,
126 ;; Data.Vector, Control.Monad.State.
127 ;;
128 ;; - Test posix010 tries to check the existence of a user on the system:
129 ;; getUserEntryForName: does not exist (no such user)
130 (define-public ghc-7
131 (package
132 (name "ghc")
133 (version "7.10.2")
134 (source
135 (origin
136 (method url-fetch)
137 (uri (string-append "https://www.haskell.org/ghc/dist/"
138 version "/" name "-" version "-src.tar.xz"))
139 (sha256
140 (base32
141 "1x8m4rp2v7ydnrz6z9g8x7z3x3d3pxhv2pixy7i7hkbqbdsp7kal"))))
142 (build-system gnu-build-system)
143 (supported-systems '("i686-linux" "x86_64-linux"))
144 (outputs '("out" "doc"))
145 (inputs
146 `(("gmp" ,gmp)
147 ("ncurses" ,ncurses)
148 ("libffi" ,libffi)
149 ("ghc-testsuite"
150 ,(origin
151 (method url-fetch)
152 (uri (string-append
153 "https://www.haskell.org/ghc/dist/"
154 version "/" name "-" version "-testsuite.tar.xz"))
155 (sha256
156 (base32
157 "0qp9da9ar87zbyn6wjgacd2ic1vgzbi3cklxnhsmjqyafv9qaj4b"))))))
158 (native-inputs
159 `(("perl" ,perl)
160 ("python" ,python-2) ; for tests (fails with python-3)
161 ("ghostscript" ,ghostscript) ; for tests
162 ("patchelf" ,patchelf)
163 ;; GHC is built with GHC. Therefore we need bootstrap binaries.
164 ("ghc-binary"
165 ,(if (string-match "x86_64" (or (%current-target-system) (%current-system)))
166 ghc-bootstrap-x86_64-7.8.4
167 ghc-bootstrap-i686-7.8.4))))
168 (arguments
169 `(#:test-target "test"
170 ;; We get a smaller number of test failures by disabling parallel test
171 ;; execution.
172 #:parallel-tests? #f
173
174 ;; Don't pass --build=<triplet>, because the configure script
175 ;; auto-detects slightly different triplets for --host and --target and
176 ;; then complains that they don't match.
177 #:build #f
178
179 #:modules ((guix build gnu-build-system)
180 (guix build utils)
181 (srfi srfi-26)
182 (srfi srfi-1))
183 #:configure-flags
184 (list
185 (string-append "--with-gmp-libraries="
186 (assoc-ref %build-inputs "gmp") "/lib")
187 (string-append "--with-gmp-includes="
188 (assoc-ref %build-inputs "gmp") "/include")
189 "--with-system-libffi"
190 (string-append "--with-ffi-libraries="
191 (assoc-ref %build-inputs "libffi") "/lib")
192 (string-append "--with-ffi-includes="
193 (assoc-ref %build-inputs "libffi") "/include"))
194 ;; FIXME: The user-guide needs dblatex, docbook-xsl and docbook-utils.
195 ;; Currently we do not have the last one.
196 ;; #:make-flags
197 ;; (list "BUILD_DOCBOOK_HTML = YES")
198 #:phases
199 (let* ((ghc-bootstrap-path
200 (string-append (getcwd) "/" ,name "-" ,version "/ghc-bin"))
201 (ghc-bootstrap-prefix
202 (string-append ghc-bootstrap-path "/usr" )))
203 (alist-cons-after
204 'unpack-bin 'unpack-testsuite-and-fix-bins
205 (lambda* (#:key inputs outputs #:allow-other-keys)
206 (with-directory-excursion ".."
207 (copy-file (assoc-ref inputs "ghc-testsuite")
208 "ghc-testsuite.tar.xz")
209 (invoke "tar" "xvf" "ghc-testsuite.tar.xz"))
210 (substitute*
211 (list "testsuite/timeout/Makefile"
212 "testsuite/timeout/timeout.py"
213 "testsuite/timeout/timeout.hs"
214 "testsuite/tests/rename/prog006/Setup.lhs"
215 "testsuite/tests/programs/life_space_leak/life.test"
216 "libraries/process/System/Process/Internals.hs"
217 "libraries/unix/cbits/execvpe.c")
218 (("/bin/sh") (which "sh"))
219 (("/bin/rm") "rm"))
220 #t)
221 (alist-cons-after
222 'unpack 'unpack-bin
223 (lambda* (#:key inputs outputs #:allow-other-keys)
224 (mkdir-p ghc-bootstrap-prefix)
225 (with-directory-excursion ghc-bootstrap-path
226 (copy-file (assoc-ref inputs "ghc-binary")
227 "ghc-bin.tar.xz")
228 (invoke "tar" "xvf" "ghc-bin.tar.xz")))
229 (alist-cons-before
230 'install-bin 'configure-bin
231 (lambda* (#:key inputs outputs #:allow-other-keys)
232 (let* ((binaries
233 (list
234 "./utils/ghc-pwd/dist-install/build/tmp/ghc-pwd"
235 "./utils/hpc/dist-install/build/tmp/hpc"
236 "./utils/haddock/dist/build/tmp/haddock"
237 "./utils/hsc2hs/dist-install/build/tmp/hsc2hs"
238 "./utils/runghc/dist-install/build/tmp/runghc"
239 "./utils/ghc-cabal/dist-install/build/tmp/ghc-cabal"
240 "./utils/hp2ps/dist/build/tmp/hp2ps"
241 "./utils/ghc-pkg/dist-install/build/tmp/ghc-pkg"
242 "./utils/unlit/dist/build/tmp/unlit"
243 "./ghc/stage2/build/tmp/ghc-stage2"))
244 (gmp (assoc-ref inputs "gmp"))
245 (gmp-lib (string-append gmp "/lib"))
246 (gmp-include (string-append gmp "/include"))
247 (ncurses-lib
248 (string-append (assoc-ref inputs "ncurses") "/lib"))
249 (ld-so (string-append (assoc-ref inputs "libc")
250 ,(glibc-dynamic-linker)))
251 (libtinfo-dir
252 (string-append ghc-bootstrap-prefix
253 "/lib/ghc-7.8.4/terminfo-0.4.0.0")))
254 (with-directory-excursion
255 (string-append ghc-bootstrap-path "/ghc-7.8.4")
256 (setenv "CONFIG_SHELL" (which "bash"))
257 (setenv "LD_LIBRARY_PATH" gmp-lib)
258 ;; The binaries have "/lib64/ld-linux-x86-64.so.2" hardcoded.
259 (for-each
260 (cut invoke "patchelf" "--set-interpreter" ld-so <>)
261 binaries)
262 ;; The binaries include a reference to libtinfo.so.5 which
263 ;; is a subset of libncurses.so.5. We create a symlink in a
264 ;; directory included in the bootstrap binaries rpath.
265 (mkdir-p libtinfo-dir)
266 (symlink
267 (string-append ncurses-lib "/libncursesw.so."
268 ;; Extract "6.0" from "6.0-20170930" if a
269 ;; dash-separated version tag exists.
270 ,(let* ((v (package-version ncurses))
271 (d (or (string-index v #\-)
272 (string-length v))))
273 (version-major+minor (string-take v d))))
274 (string-append libtinfo-dir "/libtinfo.so.5"))
275
276 (setenv "PATH"
277 (string-append (getenv "PATH") ":"
278 ghc-bootstrap-prefix "/bin"))
279 (invoke
280 (string-append (getcwd) "/configure")
281 (string-append "--prefix=" ghc-bootstrap-prefix)
282 (string-append "--with-gmp-libraries=" gmp-lib)
283 (string-append "--with-gmp-includes=" gmp-include)))))
284 (alist-cons-before
285 'configure 'install-bin
286 (lambda* (#:key inputs outputs #:allow-other-keys)
287 (with-directory-excursion
288 (string-append ghc-bootstrap-path "/ghc-7.8.4")
289 (invoke "make" "install")))
290 %standard-phases)))))))
291 (native-search-paths (list (search-path-specification
292 (variable "GHC_PACKAGE_PATH")
293 (files (list
294 (string-append "lib/ghc-" version)))
295 (file-pattern ".*\\.conf\\.d$")
296 (file-type 'directory))))
297 (home-page "https://www.haskell.org/ghc")
298 (synopsis "The Glasgow Haskell Compiler")
299 (description
300 "The Glasgow Haskell Compiler (GHC) is a state-of-the-art compiler and
301 interactive environment for the functional language Haskell.")
302 (license license:bsd-3)))
303
304 (define-public ghc-8.0
305 (package
306 (name "ghc")
307 (version "8.0.2")
308 (source
309 (origin
310 (method url-fetch)
311 (uri (string-append "https://www.haskell.org/ghc/dist/"
312 version "/" name "-" version "-src.tar.xz"))
313 (sha256
314 (base32 "1c8qc4fhkycynk4g1f9hvk53dj6a1vvqi6bklqznns6hw59m8qhi"))
315 (patches
316 (search-patches "ghc-8.0-fall-back-to-madv_dontneed.patch"))))
317 (build-system gnu-build-system)
318 (supported-systems '("i686-linux" "x86_64-linux"))
319 (outputs '("out" "doc"))
320 (inputs
321 `(("gmp" ,gmp)
322 ("ncurses" ,ncurses)
323 ("libffi" ,libffi)
324 ("ghc-testsuite"
325 ,(origin
326 (method url-fetch)
327 (uri (string-append
328 "https://www.haskell.org/ghc/dist/"
329 version "/" name "-" version "-testsuite.tar.xz"))
330 (sha256
331 (base32 "1wjc3x68l305bl1h1ijd3yhqp2vqj83lkp3kqbr94qmmkqlms8sj"))))))
332 (native-inputs
333 `(("perl" ,perl)
334 ("python" ,python-2) ; for tests
335 ("ghostscript" ,ghostscript) ; for tests
336 ;; GHC is built with GHC.
337 ("ghc-bootstrap" ,ghc-7)))
338 (arguments
339 `(#:test-target "test"
340 ;; We get a smaller number of test failures by disabling parallel test
341 ;; execution.
342 #:parallel-tests? #f
343
344 ;; Don't pass --build=<triplet>, because the configure script
345 ;; auto-detects slightly different triplets for --host and --target and
346 ;; then complains that they don't match.
347 #:build #f
348
349 #:configure-flags
350 (list
351 (string-append "--with-gmp-libraries="
352 (assoc-ref %build-inputs "gmp") "/lib")
353 (string-append "--with-gmp-includes="
354 (assoc-ref %build-inputs "gmp") "/include")
355 "--with-system-libffi"
356 (string-append "--with-ffi-libraries="
357 (assoc-ref %build-inputs "libffi") "/lib")
358 (string-append "--with-ffi-includes="
359 (assoc-ref %build-inputs "libffi") "/include")
360 (string-append "--with-curses-libraries="
361 (assoc-ref %build-inputs "ncurses") "/lib")
362 (string-append "--with-curses-includes="
363 (assoc-ref %build-inputs "ncurses") "/include"))
364 #:phases
365 (modify-phases %standard-phases
366 (add-after 'unpack 'unpack-testsuite
367 (lambda* (#:key inputs #:allow-other-keys)
368 (with-directory-excursion ".."
369 (copy-file (assoc-ref inputs "ghc-testsuite")
370 "ghc-testsuite.tar.xz")
371 (zero? (system* "tar" "xvf" "ghc-testsuite.tar.xz")))))
372 (add-before 'build 'fix-lib-paths
373 (lambda _
374 (substitute*
375 (list "libraries/process/System/Process/Posix.hs"
376 "libraries/process/tests/process001.hs"
377 "libraries/process/tests/process002.hs"
378 "libraries/unix/cbits/execvpe.c")
379 (("/bin/sh") (which "sh"))
380 (("/bin/ls") (which "ls")))
381 #t))
382 (add-before 'build 'fix-environment
383 (lambda _
384 (unsetenv "GHC_PACKAGE_PATH")
385 (setenv "CONFIG_SHELL" (which "bash"))
386 #t))
387 (add-before 'check 'fix-testsuite
388 (lambda _
389 (substitute*
390 (list "testsuite/timeout/Makefile"
391 "testsuite/timeout/timeout.py"
392 "testsuite/timeout/timeout.hs"
393 "testsuite/tests/programs/life_space_leak/life.test")
394 (("/bin/sh") (which "sh"))
395 (("/bin/rm") "rm"))
396 #t)))))
397 (native-search-paths (list (search-path-specification
398 (variable "GHC_PACKAGE_PATH")
399 (files (list
400 (string-append "lib/ghc-" version)))
401 (file-pattern ".*\\.conf\\.d$")
402 (file-type 'directory))))
403 (home-page "https://www.haskell.org/ghc")
404 (synopsis "The Glasgow Haskell Compiler")
405 (description
406 "The Glasgow Haskell Compiler (GHC) is a state-of-the-art compiler and
407 interactive environment for the functional language Haskell.")
408 (license license:bsd-3)))
409
410 (define-public ghc-8.4
411 (package (inherit ghc-8.0)
412 (name "ghc")
413 (version "8.4.4")
414 (source
415 (origin
416 (method url-fetch)
417 (uri (string-append "https://www.haskell.org/ghc/dist/"
418 version "/" name "-" version "-src.tar.xz"))
419 (sha256
420 (base32 "1ch4j2asg7pr52ai1hwzykxyj553wndg7wq93i47ql4fllspf48i"))))
421 (inputs
422 `(("gmp" ,gmp)
423 ("ncurses" ,ncurses)
424 ("libffi" ,libffi)))
425 (native-inputs
426 `(("perl" ,perl)
427 ("python" ,python) ; for tests
428 ("ghostscript" ,ghostscript) ; for tests
429 ;; GHC 8.4.3 is built with GHC 8.
430 ("ghc-bootstrap" ,ghc-8.0)
431 ("ghc-testsuite"
432 ,(origin
433 (method url-fetch)
434 (uri (string-append
435 "https://www.haskell.org/ghc/dist/"
436 version "/" name "-" version "-testsuite.tar.xz"))
437 (sha256
438 (base32
439 "0s8lf9sxj7n89pjagi58b3fahnp34qvmwhnn0j1fbg6955vbrfj6"))))))
440 (arguments
441 `(#:test-target "test"
442 ;; We get a smaller number of test failures by disabling parallel test
443 ;; execution.
444 #:parallel-tests? #f
445
446 ;; Don't pass --build=<triplet>, because the configure script
447 ;; auto-detects slightly different triplets for --host and --target and
448 ;; then complains that they don't match.
449 #:build #f
450
451 #:configure-flags
452 (list
453 (string-append "--with-gmp-libraries="
454 (assoc-ref %build-inputs "gmp") "/lib")
455 (string-append "--with-gmp-includes="
456 (assoc-ref %build-inputs "gmp") "/include")
457 "--with-system-libffi"
458 (string-append "--with-ffi-libraries="
459 (assoc-ref %build-inputs "libffi") "/lib")
460 (string-append "--with-ffi-includes="
461 (assoc-ref %build-inputs "libffi") "/include")
462 (string-append "--with-curses-libraries="
463 (assoc-ref %build-inputs "ncurses") "/lib")
464 (string-append "--with-curses-includes="
465 (assoc-ref %build-inputs "ncurses") "/include"))
466 #:phases
467 (modify-phases %standard-phases
468 (add-after 'unpack 'unpack-testsuite
469 (lambda* (#:key inputs #:allow-other-keys)
470 (invoke "tar" "xvf"
471 (assoc-ref inputs "ghc-testsuite")
472 "--strip-components=1")
473 #t))
474 ;; This phase patches the 'ghc-pkg' command so that it sorts the list
475 ;; of packages in the binary cache it generates.
476 (add-before 'build 'fix-ghc-pkg-nondeterminism
477 (lambda _
478 (substitute* "utils/ghc-pkg/Main.hs"
479 (("confs = map \\(path </>\\) \\$ filter \\(\".conf\" `isSuffixOf`\\) fs")
480 "confs = map (path </>) $ filter (\".conf\" `isSuffixOf`) (sort fs)"))
481 #t))
482 (add-after 'unpack-testsuite 'fix-shell-wrappers
483 (lambda _
484 (substitute* '("driver/ghci/ghc.mk"
485 "utils/mkdirhier/ghc.mk"
486 "rules/shell-wrapper.mk")
487 (("echo '#!/bin/sh'")
488 (format #f "echo '#!~a'" (which "sh"))))
489 #t))
490 ;; This is necessary because the configure system no longer uses
491 ;; “AC_PATH_” but “AC_CHECK_”, setting the variables to just the
492 ;; plain command names.
493 (add-before 'configure 'set-target-programs
494 (lambda* (#:key inputs #:allow-other-keys)
495 (let ((binutils (assoc-ref inputs "binutils"))
496 (gcc (assoc-ref inputs "gcc"))
497 (ld-wrapper (assoc-ref inputs "ld-wrapper")))
498 (setenv "CC" (string-append gcc "/bin/gcc"))
499 (setenv "CXX" (string-append gcc "/bin/g++"))
500 (setenv "LD" (string-append ld-wrapper "/bin/ld"))
501 (setenv "NM" (string-append binutils "/bin/nm"))
502 (setenv "RANLIB" (string-append binutils "/bin/ranlib"))
503 (setenv "STRIP" (string-append binutils "/bin/strip"))
504 ;; The 'ar' command does not follow the same pattern.
505 (setenv "fp_prog_ar" (string-append binutils "/bin/ar"))
506 #t)))
507 (add-before 'build 'fix-references
508 (lambda _
509 (substitute* '("testsuite/timeout/Makefile"
510 "testsuite/timeout/timeout.py"
511 "testsuite/timeout/timeout.hs"
512 "testsuite/tests/programs/life_space_leak/life.test"
513 ;; libraries
514 "libraries/process/System/Process/Posix.hs"
515 "libraries/process/tests/process001.hs"
516 "libraries/process/tests/process002.hs"
517 "libraries/unix/cbits/execvpe.c")
518 (("/bin/sh") (which "sh"))
519 (("/bin/ls") (which "ls"))
520 (("/bin/rm") "rm"))
521 #t))
522 (add-before 'build 'fix-environment
523 (lambda _
524 (unsetenv "GHC_PACKAGE_PATH")
525 (setenv "CONFIG_SHELL" (which "bash"))
526 #t)))))
527 (native-search-paths (list (search-path-specification
528 (variable "GHC_PACKAGE_PATH")
529 (files (list
530 (string-append "lib/ghc-" version)))
531 (file-pattern ".*\\.conf\\.d$")
532 (file-type 'directory))))))
533
534 (define-public ghc-8.6
535 (package (inherit ghc-8.4)
536 (name "ghc")
537 (version "8.6.5")
538 (source
539 (origin
540 (method url-fetch)
541 (uri (string-append "https://www.haskell.org/ghc/dist/"
542 version "/" name "-" version "-src.tar.xz"))
543 (sha256
544 (base32 "0qg3zsmbk4rkwkc3jpas3zs74qaxmw4sp4v1mhsbj0a0dzls2jjd"))))
545 (native-inputs
546 `(;; GHC 8.6.5 must be built with GHC >= 8.2.
547 ("ghc-bootstrap" ,ghc-8.4)
548 ("ghc-testsuite"
549 ,(origin
550 (method url-fetch)
551 (uri (string-append
552 "https://www.haskell.org/ghc/dist/"
553 version "/" name "-" version "-testsuite.tar.xz"))
554 (patches (search-patches "ghc-testsuite-dlopen-pie.patch"))
555 (sha256
556 (base32
557 "0pw9r91g2np3i806g2f4f8z4jfdd7mx226cmdizk4swa7av1qf91"))))
558 ,@(filter (match-lambda
559 (("ghc-bootstrap" . _) #f)
560 (("ghc-testsuite" . _) #f)
561 (_ #t))
562 (package-native-inputs ghc-8.4))))
563 (arguments
564 (substitute-keyword-arguments (package-arguments ghc-8.4)
565 ((#:make-flags make-flags ''())
566 `(cons "EXTRA_RUNTEST_OPTS=--skip-perf-tests"
567 ,make-flags))
568 ((#:phases phases '%standard-phases)
569 `(modify-phases ,phases
570 (add-after 'unpack-testsuite 'skip-tests
571 (lambda _
572 ;; These two tests refer to the root user, which doesn't exist
573 ;; (see <https://bugs.gnu.org/36692>).
574 (substitute* "libraries/unix/tests/all.T"
575 (("^test\\('T8108'") "# guix skipped: test('T8108'"))
576 (substitute* "libraries/unix/tests/libposix/all.T"
577 (("^test\\('posix010'") "# guix skipped: test('posix010'"))
578 #t))))))
579 (native-search-paths (list (search-path-specification
580 (variable "GHC_PACKAGE_PATH")
581 (files (list
582 (string-append "lib/ghc-" version)))
583 (file-pattern ".*\\.conf\\.d$")
584 (file-type 'directory))))))
585
586 (define-public ghc-8 ghc-8.6)
587
588 (define-public ghc ghc-8)
589
590 ;;; haskell.scm ends here