mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
build-system/node: Add guile-json extension.
* guix/build-system/node.scm (default-guile-json): New variable. (node-build): Use guile-json extension. Signed-off-by: Jelle Licht <jlicht@fsfe.org> Change-Id: I68eb291410fc4943395c876ba702360b4cd7be4f
This commit is contained in:
parent
3e9e164154
commit
7cc5ddf763
1 changed files with 23 additions and 15 deletions
|
@ -80,6 +80,12 @@
|
||||||
(build node-build)
|
(build node-build)
|
||||||
(arguments (strip-keyword-arguments private-keywords arguments)))))
|
(arguments (strip-keyword-arguments private-keywords arguments)))))
|
||||||
|
|
||||||
|
(define (default-guile-json)
|
||||||
|
"Return the default guile-json package."
|
||||||
|
;; Lazily resolve the binding to avoid a circular dependency.
|
||||||
|
(let ((mod (resolve-interface '(gnu packages guile))))
|
||||||
|
(module-ref mod 'guile-json-4)))
|
||||||
|
|
||||||
(define* (node-build name inputs
|
(define* (node-build name inputs
|
||||||
#:key
|
#:key
|
||||||
source
|
source
|
||||||
|
@ -91,26 +97,28 @@
|
||||||
(search-paths '())
|
(search-paths '())
|
||||||
(system (%current-system))
|
(system (%current-system))
|
||||||
(guile #f)
|
(guile #f)
|
||||||
|
(guile-json (default-guile-json))
|
||||||
(imported-modules %node-build-system-modules)
|
(imported-modules %node-build-system-modules)
|
||||||
(modules '((guix build node-build-system)
|
(modules '((guix build node-build-system)
|
||||||
(guix build utils))))
|
(guix build utils))))
|
||||||
"Build SOURCE using NODE and INPUTS."
|
"Build SOURCE using NODE and INPUTS."
|
||||||
(define builder
|
(define builder
|
||||||
(with-imported-modules imported-modules
|
(with-extensions (list guile-json)
|
||||||
#~(begin
|
(with-imported-modules imported-modules
|
||||||
(use-modules #$@(sexp->gexp modules))
|
#~(begin
|
||||||
(node-build #:name #$name
|
(use-modules #$@(sexp->gexp modules))
|
||||||
#:source #+source
|
(node-build #:name #$name
|
||||||
#:system #$system
|
#:source #+source
|
||||||
#:npm-flags #$npm-flags
|
#:system #$system
|
||||||
#:test-target #$test-target
|
#:npm-flags #$npm-flags
|
||||||
#:tests? #$tests?
|
#:test-target #$test-target
|
||||||
#:phases #$phases
|
#:tests? #$tests?
|
||||||
#:outputs #$(outputs->gexp outputs)
|
#:phases #$phases
|
||||||
#:search-paths '#$(sexp->gexp
|
#:outputs #$(outputs->gexp outputs)
|
||||||
(map search-path-specification->sexp
|
#:search-paths '#$(sexp->gexp
|
||||||
search-paths))
|
(map search-path-specification->sexp
|
||||||
#:inputs #$(input-tuples->gexp inputs)))))
|
search-paths))
|
||||||
|
#:inputs #$(input-tuples->gexp inputs))))))
|
||||||
|
|
||||||
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
|
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
|
||||||
system #:graft? #f)))
|
system #:graft? #f)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue