build-system: asdf: Add asd-operation parameter.
The 'asd-operation' parameter can be used to specify the ASDF operation to use in the build phase. It's default value is "load-system". * guix/build-system/asdf.scm (package-with-build-system, asdf-build): Add 'asd-operation' parameter. * guix/build/asdf-buid-system.scm (build): Add 'asd-operation' parameter and use it. * guix/build/lisp-utils.scm (compile-systems): Add 'asd-operation' parameter and use it.
This commit is contained in:
parent
369377a0fb
commit
c232375340
@ -1,6 +1,6 @@
|
|||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2016, 2017 Andy Patterson <ajpatter@uwaterloo.ca>
|
;;; Copyright © 2016, 2017 Andy Patterson <ajpatter@uwaterloo.ca>
|
||||||
;;; Copyright © 2019, 2020, 2021 Guillaume Le Vaillant <glv@posteo.net>
|
;;; Copyright © 2019, 2020, 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
|
||||||
;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2022 Pierre Neidhardt <mail@ambrevar.xyz>
|
;;; Copyright © 2022 Pierre Neidhardt <mail@ambrevar.xyz>
|
||||||
;;;
|
;;;
|
||||||
@ -203,7 +203,7 @@ set up using CL source package conventions."
|
|||||||
(define base-arguments
|
(define base-arguments
|
||||||
(if target-is-source?
|
(if target-is-source?
|
||||||
(strip-keyword-arguments
|
(strip-keyword-arguments
|
||||||
'(#:tests? #:lisp #:asd-systems #:asd-test-systems)
|
'(#:tests? #:lisp #:asd-systems #:asd-test-systems #:asd-operation)
|
||||||
(package-arguments pkg))
|
(package-arguments pkg))
|
||||||
(package-arguments pkg)))
|
(package-arguments pkg)))
|
||||||
|
|
||||||
@ -273,6 +273,7 @@ set up using CL source package conventions."
|
|||||||
(tests? #t)
|
(tests? #t)
|
||||||
(asd-systems ''())
|
(asd-systems ''())
|
||||||
(asd-test-systems ''())
|
(asd-test-systems ''())
|
||||||
|
(asd-operation "load-system")
|
||||||
(phases '%standard-phases)
|
(phases '%standard-phases)
|
||||||
(search-paths '())
|
(search-paths '())
|
||||||
(system (%current-system))
|
(system (%current-system))
|
||||||
@ -309,6 +310,7 @@ set up using CL source package conventions."
|
|||||||
#:source #+source
|
#:source #+source
|
||||||
#:asd-systems #$systems
|
#:asd-systems #$systems
|
||||||
#:asd-test-systems #$test-systems
|
#:asd-test-systems #$test-systems
|
||||||
|
#:asd-operation #$asd-operation
|
||||||
#:system #$system
|
#:system #$system
|
||||||
#:tests? #$tests?
|
#:tests? #$tests?
|
||||||
#:phases #$phases
|
#:phases #$phases
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2016, 2017 Andy Patterson <ajpatter@uwaterloo.ca>
|
;;; Copyright © 2016, 2017 Andy Patterson <ajpatter@uwaterloo.ca>
|
||||||
;;; Copyright © 2020, 2021 Guillaume Le Vaillant <glv@posteo.net>
|
;;; Copyright © 2020, 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
|
||||||
;;; Copyright © 2022 Pierre Neidhardt <mail@ambrevar.xyz>
|
;;; Copyright © 2022 Pierre Neidhardt <mail@ambrevar.xyz>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
@ -181,7 +181,7 @@ if it's present in the native-inputs."
|
|||||||
(setenv "XDG_CONFIG_DIRS" (string-append out "/etc")))
|
(setenv "XDG_CONFIG_DIRS" (string-append out "/etc")))
|
||||||
#t)
|
#t)
|
||||||
|
|
||||||
(define* (build #:key outputs inputs asd-systems
|
(define* (build #:key outputs inputs asd-systems asd-operation
|
||||||
#:allow-other-keys)
|
#:allow-other-keys)
|
||||||
"Compile the system."
|
"Compile the system."
|
||||||
(let* ((out (library-output outputs))
|
(let* ((out (library-output outputs))
|
||||||
@ -193,7 +193,9 @@ if it's present in the native-inputs."
|
|||||||
(setenv "ASDF_OUTPUT_TRANSLATIONS"
|
(setenv "ASDF_OUTPUT_TRANSLATIONS"
|
||||||
(replace-escaped-macros (format #f "~S" translations)))
|
(replace-escaped-macros (format #f "~S" translations)))
|
||||||
(setenv "HOME" out) ; ecl's asdf sometimes wants to create $HOME/.cache
|
(setenv "HOME" out) ; ecl's asdf sometimes wants to create $HOME/.cache
|
||||||
(compile-systems asd-systems (lisp-source-directory out system-name)))
|
(compile-systems asd-systems
|
||||||
|
(lisp-source-directory out system-name)
|
||||||
|
asd-operation))
|
||||||
#t)
|
#t)
|
||||||
|
|
||||||
(define* (check #:key tests? outputs inputs asd-test-systems
|
(define* (check #:key tests? outputs inputs asd-test-systems
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2016, 2017 Andy Patterson <ajpatter@uwaterloo.ca>
|
;;; Copyright © 2016, 2017 Andy Patterson <ajpatter@uwaterloo.ca>
|
||||||
;;; Copyright © 2020 Guillaume Le Vaillant <glv@posteo.net>
|
;;; Copyright © 2020, 2022 Guillaume Le Vaillant <glv@posteo.net>
|
||||||
;;; Copyright © 2022 Pierre Neidhardt <mail@ambrevar.xyz>
|
;;; Copyright © 2022 Pierre Neidhardt <mail@ambrevar.xyz>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
@ -108,9 +108,8 @@ with PROGRAM."
|
|||||||
"--eval" "(quit)"))
|
"--eval" "(quit)"))
|
||||||
(_ (error "The LISP provided is not supported at this time."))))
|
(_ (error "The LISP provided is not supported at this time."))))
|
||||||
|
|
||||||
(define (compile-systems systems directory)
|
(define (compile-systems systems directory operation)
|
||||||
"Use a lisp implementation to compile the SYSTEMS using asdf.
|
"Use a lisp implementation to compile the SYSTEMS using asdf."
|
||||||
Load ASD-FILES first."
|
|
||||||
(lisp-eval-program
|
(lisp-eval-program
|
||||||
`((require :asdf)
|
`((require :asdf)
|
||||||
(asdf:initialize-source-registry
|
(asdf:initialize-source-registry
|
||||||
@ -119,12 +118,11 @@ Load ASD-FILES first."
|
|||||||
:ensure-directory t))
|
:ensure-directory t))
|
||||||
:inherit-configuration))
|
:inherit-configuration))
|
||||||
,@(map (lambda (system)
|
,@(map (lambda (system)
|
||||||
`(asdf:load-system ,system))
|
(list (string->symbol (string-append "asdf:" operation)) system))
|
||||||
systems))))
|
systems))))
|
||||||
|
|
||||||
(define (test-system test-systems directory)
|
(define (test-system test-systems directory)
|
||||||
"Use a lisp implementation to test SYSTEM using asdf. Load ASD-FILES first.
|
"Use a lisp implementation to test the TEST-SYSTEMS using asdf."
|
||||||
Also load TEST-ASD-FILE if necessary."
|
|
||||||
(lisp-eval-program
|
(lisp-eval-program
|
||||||
`((require :asdf)
|
`((require :asdf)
|
||||||
(asdf:initialize-source-registry
|
(asdf:initialize-source-registry
|
||||||
|
Loading…
Reference in New Issue
Block a user