[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#55030] [PATCH v2 05/34] build-system/elm: Add implicit Elm inputs.
From: |
Philip McGrath |
Subject: |
[bug#55030] [PATCH v2 05/34] build-system/elm: Add implicit Elm inputs. |
Date: |
Wed, 18 May 2022 14:10:52 -0400 |
* guix/build-system/elm.scm (default-elm-core): New variable.
(default-elm-json): Likewise
(lower): Use them as implicit inputs when applicable.
---
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 @@ (define (default-elm)
(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 @@ (define* (lower name
'())
,@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)
--
2.32.0
- [bug#55030] [PATCH v2 00/34] gnu: elm: Update to 0.19.1. Add build system & importer., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 03/34] guix: Add elm-build-system., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 04/34] gnu: Add elm-core and elm-json., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 01/34] gnu: elm-compiler: Update to 0.19.1., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 06/34] http-client: Accept '#:headers' in 'http-fetched/cached'., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 08/34] import: json: Accept '#:http-fetch' in 'json-fetch'., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 09/34] import: Add Elm importer., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 02/34] gnu: elm: Rename package to match the command., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 07/34] http-client: 'http-fetch/cached' converts strings to URIs., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 05/34] build-system/elm: Add implicit Elm inputs.,
Philip McGrath <=
- [bug#55030] [PATCH v2 13/34] gnu: Add elm-time., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 14/34] gnu: Add elm-url., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 10/34] gnu: Add elm-virtual-dom., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 12/34] gnu: Add elm-svg., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 11/34] gnu: Add elm-html., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 15/34] gnu: Add elm-browser., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 22/34] gnu: elm: Support 'elm reactor'., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 21/34] gnu: Add elm-explorations-markdown., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 23/34] gnu: Add elm-todomvc., Philip McGrath, 2022/05/18
- [bug#55030] [PATCH v2 24/34] gnu: Add elm-debois-elm-dom., Philip McGrath, 2022/05/18