gnu: ccl: Prevent creating invalid derivation on unsupported platforms.
* gnu/packages/lisp.scm (ccl)[inputs]: For the "ccl-bootstrap" input, use the x86 origin as the fallback entry. [arguments]: Add (ice-9 match) in #:modules. Rewrite phases to use the scoped SYSTEM variable instead of splicing in a match on %CURRENT-SYSTEM.
This commit is contained in:
parent
018cffc9c9
commit
bf6438f465
1 changed files with 22 additions and 28 deletions
|
@ -592,25 +592,24 @@ statistical profiler, a code coverage tool, and many other extensions.")
|
||||||
(uri (string-append
|
(uri (string-append
|
||||||
"https://github.com/Clozure/ccl/releases/download/v" version "/"
|
"https://github.com/Clozure/ccl/releases/download/v" version "/"
|
||||||
(match (%current-system)
|
(match (%current-system)
|
||||||
((or "i686-linux" "x86_64-linux") "linuxx86")
|
|
||||||
("armhf-linux" "linuxarm")
|
("armhf-linux" "linuxarm")
|
||||||
;; Prevent errors when querying this package on unsupported
|
;; XXX: This source only works on x86, but provide it as a
|
||||||
;; platforms, e.g. when running "guix package --search="
|
;; catch-all to prevent errors when querying this package
|
||||||
(_ "UNSUPPORTED"))
|
;; on unsupported platforms.
|
||||||
|
(_ "linuxx86"))
|
||||||
".tar.gz"))
|
".tar.gz"))
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
(match (%current-system)
|
(match (%current-system)
|
||||||
((or "i686-linux" "x86_64-linux")
|
|
||||||
"15l7cfa4a7jkfwdzsfm4q3n22jnb57imxahpql3h77xin57v1gbz")
|
|
||||||
("armhf-linux"
|
("armhf-linux"
|
||||||
"0x4bjx6cxsjvxyagijhlvmc7jkyxifdvz5q5zvz37028va65243c")
|
"0x4bjx6cxsjvxyagijhlvmc7jkyxifdvz5q5zvz37028va65243c")
|
||||||
(_ ""))))))))
|
(_ "15l7cfa4a7jkfwdzsfm4q3n22jnb57imxahpql3h77xin57v1gbz"))))))))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(("m4" ,m4)))
|
`(("m4" ,m4)))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:tests? #f ;no 'check' target
|
`(#:tests? #f ;no 'check' target
|
||||||
#:modules ((srfi srfi-26)
|
#:modules ((ice-9 match)
|
||||||
|
(srfi srfi-26)
|
||||||
(guix build utils)
|
(guix build utils)
|
||||||
(guix build gnu-build-system))
|
(guix build gnu-build-system))
|
||||||
#:phases
|
#:phases
|
||||||
|
@ -622,19 +621,16 @@ statistical profiler, a code coverage tool, and many other extensions.")
|
||||||
(add-before 'build 'pre-build
|
(add-before 'build 'pre-build
|
||||||
;; Enter the source directory for the current platform's lisp
|
;; Enter the source directory for the current platform's lisp
|
||||||
;; kernel, and run 'make clean' to remove the precompiled one.
|
;; kernel, and run 'make clean' to remove the precompiled one.
|
||||||
(lambda _
|
(lambda* (#:key system #:allow-other-keys)
|
||||||
(substitute* "lisp-kernel/m4macros.m4"
|
(substitute* "lisp-kernel/m4macros.m4"
|
||||||
(("/bin/pwd") (which "pwd")))
|
(("/bin/pwd") (which "pwd")))
|
||||||
(chdir (string-append
|
(chdir (string-append
|
||||||
"lisp-kernel/"
|
"lisp-kernel/"
|
||||||
,(match (or (%current-target-system) (%current-system))
|
(match system
|
||||||
("i686-linux" "linuxx8632")
|
("i686-linux" "linuxx8632")
|
||||||
("x86_64-linux" "linuxx8664")
|
("x86_64-linux" "linuxx8664")
|
||||||
("armhf-linux" "linuxarm")
|
("armhf-linux" "linuxarm")
|
||||||
;; Prevent errors when querying this package
|
(_ (string-append "unknown system: " system)))))
|
||||||
;; on unsupported platforms, e.g. when running
|
|
||||||
;; "guix package --search="
|
|
||||||
(_ "UNSUPPORTED"))))
|
|
||||||
(substitute* '("Makefile")
|
(substitute* '("Makefile")
|
||||||
(("/bin/rm") "rm"))
|
(("/bin/rm") "rm"))
|
||||||
(setenv "CC" "gcc")
|
(setenv "CC" "gcc")
|
||||||
|
@ -642,7 +638,7 @@ statistical profiler, a code coverage tool, and many other extensions.")
|
||||||
;; XXX Do we need to recompile the heap image as well for Guix?
|
;; XXX Do we need to recompile the heap image as well for Guix?
|
||||||
;; For now just use the one we already got in the tarball.
|
;; For now just use the one we already got in the tarball.
|
||||||
(replace 'install
|
(replace 'install
|
||||||
(lambda* (#:key outputs inputs #:allow-other-keys)
|
(lambda* (#:key outputs inputs system #:allow-other-keys)
|
||||||
;; The lisp kernel built by running 'make' in lisp-kernel/$system
|
;; The lisp kernel built by running 'make' in lisp-kernel/$system
|
||||||
;; is put back into the original directory, so go back. The heap
|
;; is put back into the original directory, so go back. The heap
|
||||||
;; image is there as well.
|
;; image is there as well.
|
||||||
|
@ -653,20 +649,18 @@ statistical profiler, a code coverage tool, and many other extensions.")
|
||||||
(wrapper (string-append bindir "ccl"))
|
(wrapper (string-append bindir "ccl"))
|
||||||
(bash (assoc-ref inputs "bash"))
|
(bash (assoc-ref inputs "bash"))
|
||||||
(kernel
|
(kernel
|
||||||
,(match (or (%current-target-system) (%current-system))
|
(match system
|
||||||
("i686-linux" "lx86cl")
|
("i686-linux" "lx86cl")
|
||||||
("x86_64-linux" "lx86cl64")
|
("x86_64-linux" "lx86cl64")
|
||||||
("armhf-linux" "armcl")
|
("armhf-linux" "armcl")
|
||||||
;; Prevent errors when querying this package
|
;; Unlikely to work, but try it anyway...
|
||||||
;; on unsupported platforms, e.g. when running
|
(_ system)))
|
||||||
;; "guix package --search="
|
|
||||||
(_ "UNSUPPORTED")))
|
|
||||||
(heap (string-append kernel ".image")))
|
(heap (string-append kernel ".image")))
|
||||||
(install-file kernel libdir)
|
(install-file kernel libdir)
|
||||||
(install-file heap libdir)
|
(install-file heap libdir)
|
||||||
|
|
||||||
(let ((dirs '("lib" "library" "examples" "tools" "objc-bridge"
|
(let ((dirs `("lib" "library" "examples" "tools" "objc-bridge"
|
||||||
,@(match (%current-system)
|
,@(match system
|
||||||
("x86_64-linux"
|
("x86_64-linux"
|
||||||
'("x86-headers64"))
|
'("x86-headers64"))
|
||||||
("i686-linux"
|
("i686-linux"
|
||||||
|
|
Reference in a new issue