mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: ghc-7: Rewrite arguments using G-expressions.
* gnu/packages/haskell.scm (ghc-7)[arguments]: Rewrite using G-expressions. Remove trailing #t from phases.
This commit is contained in:
parent
213c60f332
commit
7032e0bc8a
1 changed files with 101 additions and 105 deletions
|
@ -444,7 +444,8 @@ libraries are included in this package.")
|
||||||
ghc-bootstrap-x86_64-7.8.4
|
ghc-bootstrap-x86_64-7.8.4
|
||||||
ghc-bootstrap-i686-7.8.4))))
|
ghc-bootstrap-i686-7.8.4))))
|
||||||
(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
|
||||||
|
@ -454,117 +455,112 @@ libraries are included in this package.")
|
||||||
;; then complains that they don't match.
|
;; then complains that they don't match.
|
||||||
#:build #f
|
#:build #f
|
||||||
|
|
||||||
#:modules ((guix build gnu-build-system)
|
#:modules '((guix build gnu-build-system)
|
||||||
(guix build utils)
|
(guix build utils)
|
||||||
(srfi srfi-26)
|
(srfi srfi-26)
|
||||||
(srfi srfi-1))
|
(srfi srfi-1))
|
||||||
#: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"))
|
||||||
;; FIXME: The user-guide needs dblatex, docbook-xsl and docbook-utils.
|
;; FIXME: The user-guide needs dblatex, docbook-xsl and docbook-utils.
|
||||||
;; Currently we do not have the last one.
|
;; Currently we do not have the last one.
|
||||||
;; #:make-flags
|
;; #:make-flags
|
||||||
;; (list "BUILD_DOCBOOK_HTML = YES")
|
;; (list "BUILD_DOCBOOK_HTML = YES")
|
||||||
#:phases
|
#:phases
|
||||||
(let* ((ghc-bootstrap-path
|
#~(let* ((ghc-bootstrap-path
|
||||||
(string-append (getcwd) "/" ,name "-" ,version "/ghc-bin"))
|
(string-append (getcwd) "/" #$name "-" #$version "/ghc-bin"))
|
||||||
(ghc-bootstrap-prefix
|
(ghc-bootstrap-prefix
|
||||||
(string-append ghc-bootstrap-path "/usr" )))
|
(string-append ghc-bootstrap-path "/usr" )))
|
||||||
(alist-cons-after
|
(modify-phases %standard-phases
|
||||||
'unpack-bin 'unpack-testsuite-and-fix-bins
|
(add-after 'unpack 'unpack-bin
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||||
(with-directory-excursion ".."
|
(mkdir-p ghc-bootstrap-prefix)
|
||||||
(copy-file (assoc-ref inputs "ghc-testsuite")
|
(with-directory-excursion ghc-bootstrap-path
|
||||||
"ghc-testsuite.tar.xz")
|
(copy-file (assoc-ref inputs "ghc-binary")
|
||||||
(invoke "tar" "xvf" "ghc-testsuite.tar.xz"))
|
"ghc-bin.tar.xz")
|
||||||
(substitute*
|
(invoke "tar" "xvf" "ghc-bin.tar.xz"))))
|
||||||
(list "testsuite/timeout/Makefile"
|
(add-after 'unpack-bin 'unpack-testsuite-and-fix-bins
|
||||||
"testsuite/timeout/timeout.py"
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||||
"testsuite/timeout/timeout.hs"
|
(with-directory-excursion ".."
|
||||||
"testsuite/tests/rename/prog006/Setup.lhs"
|
(copy-file (assoc-ref inputs "ghc-testsuite")
|
||||||
"testsuite/tests/programs/life_space_leak/life.test"
|
"ghc-testsuite.tar.xz")
|
||||||
"libraries/process/System/Process/Internals.hs"
|
(invoke "tar" "xvf" "ghc-testsuite.tar.xz"))
|
||||||
"libraries/unix/cbits/execvpe.c")
|
(substitute*
|
||||||
(("/bin/sh") (which "sh"))
|
(list "testsuite/timeout/Makefile"
|
||||||
(("/bin/rm") "rm"))
|
"testsuite/timeout/timeout.py"
|
||||||
#t)
|
"testsuite/timeout/timeout.hs"
|
||||||
(alist-cons-after
|
"testsuite/tests/rename/prog006/Setup.lhs"
|
||||||
'unpack 'unpack-bin
|
"testsuite/tests/programs/life_space_leak/life.test"
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
"libraries/process/System/Process/Internals.hs"
|
||||||
(mkdir-p ghc-bootstrap-prefix)
|
"libraries/unix/cbits/execvpe.c")
|
||||||
(with-directory-excursion ghc-bootstrap-path
|
(("/bin/sh") (search-input-file inputs "/bin/sh"))
|
||||||
(copy-file (assoc-ref inputs "ghc-binary")
|
(("/bin/rm") "rm"))))
|
||||||
"ghc-bin.tar.xz")
|
(add-before 'configure 'install-bin
|
||||||
(invoke "tar" "xvf" "ghc-bin.tar.xz")))
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||||
(alist-cons-before
|
(with-directory-excursion
|
||||||
'install-bin 'configure-bin
|
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
|
||||||
(let* ((binaries
|
|
||||||
(list
|
|
||||||
"./utils/ghc-pwd/dist-install/build/tmp/ghc-pwd"
|
|
||||||
"./utils/hpc/dist-install/build/tmp/hpc"
|
|
||||||
"./utils/haddock/dist/build/tmp/haddock"
|
|
||||||
"./utils/hsc2hs/dist-install/build/tmp/hsc2hs"
|
|
||||||
"./utils/runghc/dist-install/build/tmp/runghc"
|
|
||||||
"./utils/ghc-cabal/dist-install/build/tmp/ghc-cabal"
|
|
||||||
"./utils/hp2ps/dist/build/tmp/hp2ps"
|
|
||||||
"./utils/ghc-pkg/dist-install/build/tmp/ghc-pkg"
|
|
||||||
"./utils/unlit/dist/build/tmp/unlit"
|
|
||||||
"./ghc/stage2/build/tmp/ghc-stage2"))
|
|
||||||
(gmp (assoc-ref inputs "gmp"))
|
|
||||||
(gmp-lib (string-append gmp "/lib"))
|
|
||||||
(gmp-include (string-append gmp "/include"))
|
|
||||||
(ncurses-lib
|
|
||||||
(dirname (search-input-file inputs "/lib/libncurses.so")))
|
|
||||||
(ld-so (search-input-file inputs ,(glibc-dynamic-linker)))
|
|
||||||
(libtinfo-dir
|
|
||||||
(string-append ghc-bootstrap-prefix
|
|
||||||
"/lib/ghc-7.8.4/terminfo-0.4.0.0")))
|
|
||||||
(with-directory-excursion
|
|
||||||
(string-append ghc-bootstrap-path "/ghc-7.8.4")
|
|
||||||
(setenv "CONFIG_SHELL" (which "bash"))
|
|
||||||
(setenv "LD_LIBRARY_PATH" gmp-lib)
|
|
||||||
;; The binaries have "/lib64/ld-linux-x86-64.so.2" hardcoded.
|
|
||||||
(for-each
|
|
||||||
(cut invoke "patchelf" "--set-interpreter" ld-so <>)
|
|
||||||
binaries)
|
|
||||||
;; The binaries include a reference to libtinfo.so.5 which
|
|
||||||
;; is a subset of libncurses.so.5. We create a symlink in a
|
|
||||||
;; directory included in the bootstrap binaries rpath.
|
|
||||||
(mkdir-p libtinfo-dir)
|
|
||||||
(symlink
|
|
||||||
(string-append ncurses-lib "/libncursesw.so."
|
|
||||||
;; Extract "6.0" from "6.0-20170930" if a
|
|
||||||
;; dash-separated version tag exists.
|
|
||||||
,(let* ((v (package-version ncurses))
|
|
||||||
(d (or (string-index v #\-)
|
|
||||||
(string-length v))))
|
|
||||||
(version-major+minor (string-take v d))))
|
|
||||||
(string-append libtinfo-dir "/libtinfo.so.5"))
|
|
||||||
|
|
||||||
(setenv "PATH"
|
|
||||||
(string-append (getenv "PATH") ":"
|
|
||||||
ghc-bootstrap-prefix "/bin"))
|
|
||||||
(invoke
|
|
||||||
(string-append (getcwd) "/configure")
|
|
||||||
(string-append "--prefix=" ghc-bootstrap-prefix)
|
|
||||||
(string-append "--with-gmp-libraries=" gmp-lib)
|
|
||||||
(string-append "--with-gmp-includes=" gmp-include)))))
|
|
||||||
(alist-cons-before
|
|
||||||
'configure 'install-bin
|
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
|
||||||
(with-directory-excursion
|
|
||||||
(string-append ghc-bootstrap-path "/ghc-7.8.4")
|
(string-append ghc-bootstrap-path "/ghc-7.8.4")
|
||||||
(invoke "make" "install")))
|
(invoke "make" "install"))))
|
||||||
%standard-phases)))))))
|
(add-before 'install-bin 'configure-bin
|
||||||
|
(lambda* (#:key inputs outputs #:allow-other-keys)
|
||||||
|
(let* ((binaries
|
||||||
|
(list
|
||||||
|
"./utils/ghc-pwd/dist-install/build/tmp/ghc-pwd"
|
||||||
|
"./utils/hpc/dist-install/build/tmp/hpc"
|
||||||
|
"./utils/haddock/dist/build/tmp/haddock"
|
||||||
|
"./utils/hsc2hs/dist-install/build/tmp/hsc2hs"
|
||||||
|
"./utils/runghc/dist-install/build/tmp/runghc"
|
||||||
|
"./utils/ghc-cabal/dist-install/build/tmp/ghc-cabal"
|
||||||
|
"./utils/hp2ps/dist/build/tmp/hp2ps"
|
||||||
|
"./utils/ghc-pkg/dist-install/build/tmp/ghc-pkg"
|
||||||
|
"./utils/unlit/dist/build/tmp/unlit"
|
||||||
|
"./ghc/stage2/build/tmp/ghc-stage2"))
|
||||||
|
(gmp (assoc-ref inputs "gmp"))
|
||||||
|
(gmp-lib (string-append gmp "/lib"))
|
||||||
|
(gmp-include (string-append gmp "/include"))
|
||||||
|
(ncurses-lib
|
||||||
|
(dirname (search-input-file inputs "/lib/libncurses.so")))
|
||||||
|
(ld-so (search-input-file inputs #$(glibc-dynamic-linker)))
|
||||||
|
(libtinfo-dir
|
||||||
|
(string-append ghc-bootstrap-prefix
|
||||||
|
"/lib/ghc-7.8.4/terminfo-0.4.0.0")))
|
||||||
|
(with-directory-excursion
|
||||||
|
(string-append ghc-bootstrap-path "/ghc-7.8.4")
|
||||||
|
(setenv "CONFIG_SHELL" (which "bash"))
|
||||||
|
(setenv "LD_LIBRARY_PATH" gmp-lib)
|
||||||
|
;; The binaries have "/lib64/ld-linux-x86-64.so.2" hardcoded.
|
||||||
|
(for-each
|
||||||
|
(cut invoke "patchelf" "--set-interpreter" ld-so <>)
|
||||||
|
binaries)
|
||||||
|
;; The binaries include a reference to libtinfo.so.5 which
|
||||||
|
;; is a subset of libncurses.so.5. We create a symlink in a
|
||||||
|
;; directory included in the bootstrap binaries rpath.
|
||||||
|
(mkdir-p libtinfo-dir)
|
||||||
|
(symlink
|
||||||
|
(string-append ncurses-lib "/libncursesw.so."
|
||||||
|
;; Extract "6.0" from "6.0-20170930" if a
|
||||||
|
;; dash-separated version tag exists.
|
||||||
|
#$(let* ((v (package-version ncurses))
|
||||||
|
(d (or (string-index v #\-)
|
||||||
|
(string-length v))))
|
||||||
|
(version-major+minor (string-take v d))))
|
||||||
|
(string-append libtinfo-dir "/libtinfo.so.5"))
|
||||||
|
|
||||||
|
(setenv "PATH"
|
||||||
|
(string-append (getenv "PATH") ":"
|
||||||
|
ghc-bootstrap-prefix "/bin"))
|
||||||
|
(invoke
|
||||||
|
(string-append (getcwd) "/configure")
|
||||||
|
(string-append "--prefix=" ghc-bootstrap-prefix)
|
||||||
|
(string-append "--with-gmp-libraries=" gmp-lib)
|
||||||
|
(string-append "--with-gmp-includes=" gmp-include))))))))))
|
||||||
(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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue