gnu: chez-scheme: Fix i686 build.

* gnu/packages/scheme.scm (chez-scheme): Add 'configure-flags', generalize
  'configure' phase and simplify 'install-doc' phase.
This commit is contained in:
Federico Beffa 2016-10-17 09:01:11 +02:00
parent 4b86dde0d6
commit f7616df4af
No known key found for this signature in database
GPG Key ID: 58936E0E2F1B5A4C
1 changed files with 12 additions and 9 deletions

View File

@ -645,6 +645,14 @@ threads.")
(guix build utils) (guix build utils)
(ice-9 match)) (ice-9 match))
#:test-target "test" #:test-target "test"
#:configure-flags
(list ,(match (or (%current-target-system) (%current-system))
("x86_64-linux" '(list "--machine=ta6le"))
("i686-linux" '(list "--machine=ti3le"))
;; FIXME: Some people succeeded in cross-compiling to
;; ARM. https://github.com/cisco/ChezScheme/issues/13
(_
'())))
#:phases #:phases
(modify-phases %standard-phases (modify-phases %standard-phases
;; Adapt the custom 'configure' script. ;; Adapt the custom 'configure' script.
@ -673,12 +681,9 @@ threads.")
(substitute* (find-files "./c" "Mf-[a-zA-Z0-9.]+") (substitute* (find-files "./c" "Mf-[a-zA-Z0-9.]+")
(("\\$\\{Kernel\\}: \\$\\{kernelobj\\} \\.\\./zlib/libz\\.a") (("\\$\\{Kernel\\}: \\$\\{kernelobj\\} \\.\\./zlib/libz\\.a")
"${Kernel}: ${kernelobj}") "${Kernel}: ${kernelobj}")
(("ld -melf_x86_64 -r -X -o \\$\\{Kernel\\} \\$\\{kernelobj\\} \\.\\./zlib/libz\\.a") (("ld ([-a-zA-Z0-9_${} ]+) \\.\\./zlib/libz\\.a" all args)
(string-append "ld -melf_x86_64 -r -X -o ${Kernel} ${kernelobj} " (string-append "ld " args " " zlib "/lib/libz.a"))
zlib "/lib/libz.a")) (("\\(cd \\.\\./zlib; ([-a-zA-Z0-9=./ ]+))")
(("\\(cd \\.\\./zlib; CFLAGS=-m64 \\./configure --64)")
(which "true"))
(("(cd \\.\\./zlib; make)")
(which "true"))) (which "true")))
(substitute* (find-files "mats" "Mf-.*") (substitute* (find-files "mats" "Mf-.*")
(("^[[:space:]]+(cc ) *") "\tgcc ")) (("^[[:space:]]+(cc ) *") "\tgcc "))
@ -715,9 +720,7 @@ threads.")
(system* "make" "docs") (system* "make" "docs")
(with-directory-excursion "csug" (with-directory-excursion "csug"
(substitute* "Makefile" (substitute* "Makefile"
(("/tmp/csug9") doc) (("/tmp/csug9") doc))
(("^m = a6le")
"m := $(shell echo '(machine-type)' | scheme -q)"))
(system* "make" "install") (system* "make" "install")
(install-file "csug.pdf" doc)) (install-file "csug.pdf" doc))
(with-directory-excursion "release_notes" (with-directory-excursion "release_notes"