gnu: ghc-8.0: Modernize package.

* gnu/packages/haskell.scm (ghc-8.0)[arguments]: Rewrite using g-exps.
Unpack testsuite tarball from the store. Remove trailing #t from phases.
[inputs]: Remove input labels. Move ghc-testsuite ...
[native-inputs]: ... to here.
This commit is contained in:
Efraim Flashner 2022-08-21 15:29:41 +03:00
parent a8848b9311
commit 63e01d01b1
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351

View file

@ -587,9 +587,13 @@ interactive environment for the functional language Haskell.")
(supported-systems '("i686-linux" "x86_64-linux"))
(outputs '("out" "doc"))
(inputs
`(("gmp" ,gmp)
("ncurses" ,ncurses)
("libffi" ,libffi)
(list gmp ncurses libffi))
(native-inputs
`(("perl" ,perl)
("python" ,python-2) ; for tests
("ghostscript" ,ghostscript) ; for tests
;; GHC is built with GHC.
("ghc-bootstrap" ,ghc-7)
("ghc-testsuite"
,(origin
(method url-fetch)
@ -597,15 +601,10 @@ interactive environment for the functional language Haskell.")
"https://www.haskell.org/ghc/dist/"
version "/" name "-" version "-testsuite.tar.xz"))
(sha256
(base32 "1wjc3x68l305bl1h1ijd3yhqp2vqj83lkp3kqbr94qmmkqlms8sj"))))))
(native-inputs
`(("perl" ,perl)
("python" ,python-2) ; for tests
("ghostscript" ,ghostscript) ; for tests
;; GHC is built with GHC.
("ghc-bootstrap" ,ghc-7)))
(base32 "1wjc3x68l305bl1h1ijd3yhqp2vqj83lkp3kqbr94qmmkqlms8sj")))) ))
(arguments
`(#:test-target "test"
(list
#:test-target "test"
;; We get a smaller number of test failures by disabling parallel test
;; execution.
#:parallel-tests? #f
@ -616,7 +615,7 @@ interactive environment for the functional language Haskell.")
#:build #f
#:configure-flags
(list
#~(list
(string-append "--with-gmp-libraries="
(assoc-ref %build-inputs "gmp") "/lib")
(string-append "--with-gmp-includes="
@ -631,28 +630,24 @@ interactive environment for the functional language Haskell.")
(string-append "--with-curses-includes="
(assoc-ref %build-inputs "ncurses") "/include"))
#:phases
(modify-phases %standard-phases
#~(modify-phases %standard-phases
(add-after 'unpack 'unpack-testsuite
(lambda* (#:key inputs #:allow-other-keys)
(with-directory-excursion ".."
(copy-file (assoc-ref inputs "ghc-testsuite")
"ghc-testsuite.tar.xz")
(zero? (system* "tar" "xvf" "ghc-testsuite.tar.xz")))))
(invoke "tar" "xvf" (assoc-ref inputs "ghc-testsuite")))))
(add-before 'build 'fix-lib-paths
(lambda _
(lambda* (#:key inputs #:allow-other-keys)
(substitute*
(list "libraries/process/System/Process/Posix.hs"
"libraries/process/tests/process001.hs"
"libraries/process/tests/process002.hs"
"libraries/unix/cbits/execvpe.c")
(("/bin/sh") (which "sh"))
(("/bin/ls") (which "ls")))
#t))
(("/bin/sh") (search-input-file inputs "/bin/sh"))
(("/bin/ls") (search-input-file inputs "/bin/ls")))))
(add-before 'build 'fix-environment
(lambda _
(unsetenv "GHC_PACKAGE_PATH")
(setenv "CONFIG_SHELL" (which "bash"))
#t))
(setenv "CONFIG_SHELL" (which "bash"))))
(add-before 'check 'fix-testsuite
(lambda _
(substitute*
@ -661,8 +656,7 @@ interactive environment for the functional language Haskell.")
"testsuite/timeout/timeout.hs"
"testsuite/tests/programs/life_space_leak/life.test")
(("/bin/sh") (which "sh"))
(("/bin/rm") "rm"))
#t)))))
(("/bin/rm") "rm")))))))
(native-search-paths (list (search-path-specification
(variable "GHC_PACKAGE_PATH")
(files (list