From patchwork Wed May 18 18:10:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip McGrath X-Patchwork-Id: 39478 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 19CBC27BBE9; Wed, 18 May 2022 19:14:29 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 78F9C27BBEB for ; Wed, 18 May 2022 19:14:28 +0100 (BST) Received: from localhost ([::1]:37066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nrOBn-00008w-KJ for patchwork@mira.cbaines.net; Wed, 18 May 2022 14:14:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrOAS-0007kX-Vs for guix-patches@gnu.org; Wed, 18 May 2022 14:13:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39622) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nrOAS-0005Dm-Ky for guix-patches@gnu.org; Wed, 18 May 2022 14:13:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nrOAS-0006Lz-Gn for guix-patches@gnu.org; Wed, 18 May 2022 14:13:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55030] [PATCH v2 05/34] build-system/elm: Add implicit Elm inputs. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 18 May 2022 18:13:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55030 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55030@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , Philip McGrath Received: via spool by 55030-submit@debbugs.gnu.org id=B55030.165289755224222 (code B ref 55030); Wed, 18 May 2022 18:13:04 +0000 Received: (at 55030) by debbugs.gnu.org; 18 May 2022 18:12:32 +0000 Received: from localhost ([127.0.0.1]:33485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrO9w-0006IX-86 for submit@debbugs.gnu.org; Wed, 18 May 2022 14:12:32 -0400 Received: from mail-vs1-f41.google.com ([209.85.217.41]:37860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrO9t-0006Hi-Or for 55030@debbugs.gnu.org; Wed, 18 May 2022 14:12:30 -0400 Received: by mail-vs1-f41.google.com with SMTP id w10so458218vsa.4 for <55030@debbugs.gnu.org>; Wed, 18 May 2022 11:12:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=philipmcgrath.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8eB+KxS+XvMi+vTosChUMKJY/hyck4QM8yg+N6olk1s=; b=BXHLGE8s+9TulrS/pEb/GifG7zz/ETI3t7rNXUEr8y0Qhs8+8Dx1X/evm2OrmST3LW P0W0WFkfYLuNcP+4bCDG6ccSK1kFDIoxjFYI7ffll9PDmupzqmJiKlvnt4yAU6dnUN/O FI29ni4Onj3Y5buRG8XxJukJXQzjmmaMTOHKzY06BmMrW8+EnMW9E/Qdb8HNRve2poYN g0ZNtyGFOfKYc/wzFPPLHBrABMvAAbmObHm/eZ+uPE8jwIpa6QlWIyXZiuanuEDZE2dT RJTOKvJUwPtUUUWUWl1ZVTn5evWz50TD1B48Sqc6UUtucU0li4+oQz5Th4BgTMFGr5Oo fOBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8eB+KxS+XvMi+vTosChUMKJY/hyck4QM8yg+N6olk1s=; b=SH9nckdFz/ayePuhB0De1X4gM+7RMJcNv0ZLQWekO+EfHL2AqD8LjaY4kXcLYMZmp1 BRxqV5nOVzBmb2uGaHkAy+3gXABpXb4AuIjkl5tbOQG1TTxDpnZBCPIY9RBvSiJNI2uF u5bp0TAWqbPrluoIin67kf3AwKA5+7ZmoyLZGaUbqeIsZPNb8mkmV7gUSsgnhmhUf1aq ojF/3Bte3EAEP3fnLucxga4k/vWglfSaYx1K9A5057c+9m1rp+gMeVSy0SMIx7xvoUmU lqn5h2UxGPB7nIz9S4P1Xt4hW+2kmfhNV44N7/zXlyhI+aocqu1/318L5Moukft209Dq n72A== X-Gm-Message-State: AOAM530l6gTLL7Pk41bI0srOMg/EuYLUhHDvzpNp7BHF4HJCZoLHDIV8 jWiIbEVw9G+TD1+OJmrzaqYGanA4Y+fE1Vd4 X-Google-Smtp-Source: ABdhPJzkEf1hHdlTRML/ImcwpgkCMizS4ddukbYG9PCt+PXOYSXjFWrrXl+7f2irXt683gvHfCYZQw== X-Received: by 2002:a05:6102:6d1:b0:32d:35ae:f68e with SMTP id m17-20020a05610206d100b0032d35aef68emr588781vsg.7.1652897544395; Wed, 18 May 2022 11:12:24 -0700 (PDT) Received: from localhost (c-73-125-98-51.hsd1.fl.comcast.net. [73.125.98.51]) by smtp.gmail.com with UTF8SMTPSA id a18-20020ab03c92000000b003626f894deasm342446uax.24.2022.05.18.11.12.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 May 2022 11:12:24 -0700 (PDT) From: Philip McGrath Date: Wed, 18 May 2022 14:10:52 -0400 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: <20220419232736.272970-1-philip@philipmcgrath.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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)