[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/35: build-system/elm: Add implicit Elm inputs.
From: |
guix-commits |
Subject: |
05/35: build-system/elm: Add implicit Elm inputs. |
Date: |
Sat, 21 May 2022 19:43:04 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit dce724dc82c4ec4b55288b539e23239eb9677350
Author: Philip McGrath <philip@philipmcgrath.com>
AuthorDate: Wed May 18 14:10:52 2022 -0400
build-system/elm: Add implicit Elm inputs.
* guix/build-system/elm.scm (default-elm-core): New variable.
(default-elm-json): Likewise
(lower): Use them as implicit inputs when applicable.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
guix/build-system/elm.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)
diff --git a/guix/build-system/elm.scm b/guix/build-system/elm.scm
index b54954bf4e..293bcbfb64 100644
--- a/guix/build-system/elm.scm
+++ b/guix/build-system/elm.scm
@@ -103,6 +103,18 @@ given VERSION with sha256 checksum HASH."
(let ((elm (resolve-interface '(gnu packages elm))))
(module-ref elm 'elm)))
+(define (default-elm-core)
+ "Return the default elm-core package."
+ ;; Lazily resolve the binding to avoid a circular dependency.
+ (let ((elm (resolve-interface '(gnu packages elm))))
+ (module-ref elm 'elm-core)))
+
+(define (default-elm-json)
+ "Return the default elm-json package."
+ ;; Lazily resolve the binding to avoid a circular dependency.
+ (let ((elm (resolve-interface '(gnu packages elm))))
+ (module-ref elm 'elm-json)))
+
(define* (lower name
#:key source inputs native-inputs outputs system target
(implicit-elm-package-inputs? #t)
@@ -127,6 +139,28 @@ given VERSION with sha256 checksum HASH."
'())
,@inputs
("elm" ,elm)
+ ,@(cond
+ (implicit-elm-package-inputs?
+ ;; These are needed for elm-build-system even if not actually
+ ;; needed by the package being built. But "elm/json" is often
+ ;; present in practice, and "elm/core" always is: only add the
+ ;; default packages if no suitable inputs have been given
+ ;; explicitly.
+ (filter-map
+ (match-lambda
+ ((name get-default)
+ (cond
+ ((find (match-lambda
+ ((_ pkg . _)
+ (equal? name (guix-package->elm-name pkg))))
+ inputs)
+ #f)
+ (else
+ `(,name ,(get-default))))))
+ `(("elm/core" ,default-elm-core)
+ ("elm/json" ,default-elm-json))))
+ (else
+ '()))
;; TODO: probably don't need most of (standard-packages)
,@(standard-packages)))
(outputs outputs)
- 29/35: gnu: Add elm-justinmimbs-date., (continued)
- 29/35: gnu: Add elm-justinmimbs-date., guix-commits, 2022/05/21
- 20/35: gnu: Add elm-project-metadata-utils., guix-commits, 2022/05/21
- 23/35: gnu: Add elm-todomvc., guix-commits, 2022/05/21
- 27/35: gnu: Add elm-danhandrea-elm-date-format., guix-commits, 2022/05/21
- 33/35: gnu: Add elm-terezka-intervals., guix-commits, 2022/05/21
- 21/35: gnu: Add elm-explorations-markdown., guix-commits, 2022/05/21
- 30/35: gnu: Add elm-justinmimbs-time-extra., guix-commits, 2022/05/21
- 18/35: gnu: Add elm-http., guix-commits, 2022/05/21
- 11/35: gnu: Add elm-html., guix-commits, 2022/05/21
- 01/35: gnu: elm-compiler: Update to 0.19.1., guix-commits, 2022/05/21
- 05/35: build-system/elm: Add implicit Elm inputs.,
guix-commits <=
- 03/35: guix: Add elm-build-system., guix-commits, 2022/05/21
- 24/35: gnu: Add elm-debois-elm-dom., guix-commits, 2022/05/21
- 09/35: import: Add Elm importer., guix-commits, 2022/05/21
- 28/35: gnu: Add elm-danhandrea-elm-time-extra., guix-commits, 2022/05/21
- 13/35: gnu: Add elm-time., guix-commits, 2022/05/21
- 10/35: gnu: Add elm-virtual-dom., guix-commits, 2022/05/21
- 07/35: http-client: 'http-fetch/cached' converts strings to URIs., guix-commits, 2022/05/21
- 34/35: gnu: Add elm-terezka-elm-charts., guix-commits, 2022/05/21