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.master
parent
018cffc9c9
commit
bf6438f465
|
@ -592,25 +592,24 @@ statistical profiler, a code coverage tool, and many other extensions.")
|
|||
(uri (string-append
|
||||
"https://github.com/Clozure/ccl/releases/download/v" version "/"
|
||||
(match (%current-system)
|
||||
((or "i686-linux" "x86_64-linux") "linuxx86")
|
||||
("armhf-linux" "linuxarm")
|
||||
;; Prevent errors when querying this package on unsupported
|
||||
;; platforms, e.g. when running "guix package --search="
|
||||
(_ "UNSUPPORTED"))
|
||||
;; XXX: This source only works on x86, but provide it as a
|
||||
;; catch-all to prevent errors when querying this package
|
||||
;; on unsupported platforms.
|
||||
(_ "linuxx86"))
|
||||
".tar.gz"))
|
||||
(sha256
|
||||
(base32
|
||||
(match (%current-system)
|
||||
((or "i686-linux" "x86_64-linux")
|
||||
"15l7cfa4a7jkfwdzsfm4q3n22jnb57imxahpql3h77xin57v1gbz")
|
||||
("armhf-linux"
|
||||
"0x4bjx6cxsjvxyagijhlvmc7jkyxifdvz5q5zvz37028va65243c")
|
||||
(_ ""))))))))
|
||||
(_ "15l7cfa4a7jkfwdzsfm4q3n22jnb57imxahpql3h77xin57v1gbz"))))))))
|
||||
(native-inputs
|
||||
`(("m4" ,m4)))
|
||||
(arguments
|
||||
`(#:tests? #f ;no 'check' target
|
||||
#:modules ((srfi srfi-26)
|
||||
#:modules ((ice-9 match)
|
||||
(srfi srfi-26)
|
||||
(guix build utils)
|
||||
(guix build gnu-build-system))
|
||||
#:phases
|
||||
|
@ -622,19 +621,16 @@ statistical profiler, a code coverage tool, and many other extensions.")
|
|||
(add-before 'build 'pre-build
|
||||
;; Enter the source directory for the current platform's lisp
|
||||
;; kernel, and run 'make clean' to remove the precompiled one.
|
||||
(lambda _
|
||||
(lambda* (#:key system #:allow-other-keys)
|
||||
(substitute* "lisp-kernel/m4macros.m4"
|
||||
(("/bin/pwd") (which "pwd")))
|
||||
(chdir (string-append
|
||||
"lisp-kernel/"
|
||||
,(match (or (%current-target-system) (%current-system))
|
||||
("i686-linux" "linuxx8632")
|
||||
("x86_64-linux" "linuxx8664")
|
||||
("armhf-linux" "linuxarm")
|
||||
;; Prevent errors when querying this package
|
||||
;; on unsupported platforms, e.g. when running
|
||||
;; "guix package --search="
|
||||
(_ "UNSUPPORTED"))))
|
||||
(match system
|
||||
("i686-linux" "linuxx8632")
|
||||
("x86_64-linux" "linuxx8664")
|
||||
("armhf-linux" "linuxarm")
|
||||
(_ (string-append "unknown system: " system)))))
|
||||
(substitute* '("Makefile")
|
||||
(("/bin/rm") "rm"))
|
||||
(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?
|
||||
;; For now just use the one we already got in the tarball.
|
||||
(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
|
||||
;; is put back into the original directory, so go back. The heap
|
||||
;; image is there as well.
|
||||
|
@ -653,20 +649,18 @@ statistical profiler, a code coverage tool, and many other extensions.")
|
|||
(wrapper (string-append bindir "ccl"))
|
||||
(bash (assoc-ref inputs "bash"))
|
||||
(kernel
|
||||
,(match (or (%current-target-system) (%current-system))
|
||||
("i686-linux" "lx86cl")
|
||||
("x86_64-linux" "lx86cl64")
|
||||
("armhf-linux" "armcl")
|
||||
;; Prevent errors when querying this package
|
||||
;; on unsupported platforms, e.g. when running
|
||||
;; "guix package --search="
|
||||
(_ "UNSUPPORTED")))
|
||||
(match system
|
||||
("i686-linux" "lx86cl")
|
||||
("x86_64-linux" "lx86cl64")
|
||||
("armhf-linux" "armcl")
|
||||
;; Unlikely to work, but try it anyway...
|
||||
(_ system)))
|
||||
(heap (string-append kernel ".image")))
|
||||
(install-file kernel libdir)
|
||||
(install-file heap libdir)
|
||||
|
||||
(let ((dirs '("lib" "library" "examples" "tools" "objc-bridge"
|
||||
,@(match (%current-system)
|
||||
(let ((dirs `("lib" "library" "examples" "tools" "objc-bridge"
|
||||
,@(match system
|
||||
("x86_64-linux"
|
||||
'("x86-headers64"))
|
||||
("i686-linux"
|
||||
|
|
Reference in New Issue