1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-27 19:41:50 +02:00

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