build-system/asdf: Retain references to source files for binary outputs.

In support of long-running programs in which the users would like to be able
to jump to the source of a definition of any of the dependencies (itself
included) of the program.

* guix/build/asdf-build-system.scm (library-outputs): Move from here ...
* guix/build/lisp-utils.scm (library-outputs): ... to here.
(build-program): Accept dependency-prefixes argument, to allow the caller to
specify references which should be retained.  Default to the library's output.
(build-image): Likewise.
(generate-executable): Likewise.
* gnu/packages/lisp.scm (sbcl-stumpwm+slynk, sbcl-slynk, sbcl-stumpwm): Adjust
accordingly to the new interface.
(sbcl-stumpwm+slynk)[native-inputs]: Move to ...
[inputs]: ... here.
This commit is contained in:
Andy Patterson 2017-04-03 09:01:33 -04:00 committed by Ricardo Wurmus
parent b9afcb9ed4
commit 4209c31b8f
No known key found for this signature in database
GPG key ID: 197A5888235FACAC
3 changed files with 47 additions and 14 deletions

View file

@ -904,6 +904,7 @@ from other CLXes around the net.")
(lambda* (#:key outputs #:allow-other-keys)
(build-program
(string-append (assoc-ref outputs "out") "/bin/stumpwm")
outputs
#:entry-program '((stumpwm:stumpwm) 0))))
(add-after 'build-program 'create-desktop-file
(lambda* (#:key outputs #:allow-other-keys)
@ -1153,6 +1154,7 @@ multiple inspectors with independent history.")
(build-image (string-append
(assoc-ref %outputs "image")
"/bin/slynk")
%outputs
#:dependencies ',slynk-systems)))))))
(define-public ecl-slynk
@ -1182,7 +1184,7 @@ multiple inspectors with independent history.")
(inherit sbcl-stumpwm)
(name "sbcl-stumpwm-with-slynk")
(outputs '("out"))
(native-inputs
(inputs
`(("stumpwm" ,sbcl-stumpwm "lib")
("slynk" ,sbcl-slynk)))
(arguments
@ -1190,13 +1192,16 @@ multiple inspectors with independent history.")
((#:phases phases)
`(modify-phases ,phases
(replace 'build-program
(lambda* (#:key outputs #:allow-other-keys)
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(program (string-append out "/bin/stumpwm")))
(build-program program
(build-program program outputs
#:entry-program '((stumpwm:stumpwm) 0)
#:dependencies '("stumpwm"
,@slynk-systems))
,@slynk-systems)
#:dependency-prefixes
(map (lambda (input) (assoc-ref inputs input))
'("stumpwm" "slynk")))
;; Remove unneeded file.
(delete-file (string-append out "/bin/stumpwm-exec.fasl"))
#t)))