From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kCEzKvE3hWKgdQEAbAwnHQ (envelope-from ) for ; Wed, 18 May 2022 20:16:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id aI4bKvE3hWLrTwAAauVa8A (envelope-from ) for ; Wed, 18 May 2022 20:16:17 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 47BBA2E604 for ; Wed, 18 May 2022 20:16:16 +0200 (CEST) Received: from localhost ([::1]:43730 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nrODX-0004fy-EC for larch@yhetil.org; Wed, 18 May 2022 14:16:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrOBR-000081-DR for guix-patches@gnu.org; Wed, 18 May 2022 14:14:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39692) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nrOBQ-0005P7-VJ for guix-patches@gnu.org; Wed, 18 May 2022 14:14:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nrOBQ-0006TE-Qt for guix-patches@gnu.org; Wed, 18 May 2022 14:14:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55030] [PATCH v2 22/34] gnu: elm: Support 'elm reactor'. Resent-From: Philip McGrath Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 18 May 2022 18:14: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.165289761924721 (code B ref 55030); Wed, 18 May 2022 18:14:04 +0000 Received: (at 55030) by debbugs.gnu.org; 18 May 2022 18:13:39 +0000 Received: from localhost ([127.0.0.1]:33565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrOB0-0006QZ-Q7 for submit@debbugs.gnu.org; Wed, 18 May 2022 14:13:39 -0400 Received: from mail-vs1-f42.google.com ([209.85.217.42]:37437) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrOAy-0006Oq-0k for 55030@debbugs.gnu.org; Wed, 18 May 2022 14:13:36 -0400 Received: by mail-vs1-f42.google.com with SMTP id w10so460384vsa.4 for <55030@debbugs.gnu.org>; Wed, 18 May 2022 11:13:36 -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=UHfL3C/ibqhoWyMSseXInHhRAjPSYuVXliqi06fgUCQ=; b=E1dixoAik3ep+cOGleYWgwC/gw64M2O0nWBmG9Gn4n0r/DFcu6oS+KDx7LUZu/orIL hKVoBmFvWjjPRFQ03J/o/aJOhjn1KD3okvi6jgM5QcEmupJXO31ZiVtZjkbNBUAMRq7m ORV3CMNsW+8lfDnDcmrrH0ls/Tct0p8tYTzfZvDq4+08OBNh11tyPW66kHP+2O3Z1iR3 dVFbjBTQKdvY88amPOt+eN1HaIw42yQ9EKBJS8N19VGyXSUOIvK6VMpmS8EWXa4FpIf6 JLl2q3Y0v16SbVXeqgGvYEE6rPSNi5K+so6qmtFqr44QT4ymqnHuKLbMn7utMvMzvjpw pzYg== 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=UHfL3C/ibqhoWyMSseXInHhRAjPSYuVXliqi06fgUCQ=; b=a6mRFfFy1Y9/RxusjBAQz7Gu1HVQZkmy6FepIYyHTY+TUmETigCYZkJ1YR99MlJnIe N5G8CqKuvYq2/R0i3Z3e/LGl2t4Ikx5MeNLlOiFCppVFA9WlNo4ZMuMm9hSMK5fbszAh KD7CltJ8/B6IFi3W142fPMCeF0MSXvnoomteN9BMlUamcUtVL5gzypuVrdLg2ILNpmrG O9psTgdujqou85HdEW7cwN9tQ3RwlkSC/UtX2e6G78cY5hh2liyhcFvSoM7ZHTMdr9GM Pl4dSInQU2I+5P6OFRONf1/2v4CpiWMpyOx/MuTrRVk6S0GAIcGqwYpO8euVW/U5Anpk cizQ== X-Gm-Message-State: AOAM5315U0X5qa1PZgOOwZSBV4szqvX9IFQ7wdJHS6rZlByaGunjgXl3 Vi/OL8i51MGPdLstBx+hirzTuurtVHUmHFaJ X-Google-Smtp-Source: ABdhPJysnL8i7NRJ9IHrOBY1BeXhkWEFrPmCtAnZ11ULl2GUDgMnpmq8hOnLqQsOKMb+tcZ12nG24Q== X-Received: by 2002:a05:6102:3002:b0:335:c397:db4f with SMTP id s2-20020a056102300200b00335c397db4fmr648346vsa.37.1652897615527; Wed, 18 May 2022 11:13:35 -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 b19-20020a67cb13000000b0032d275e6909sm261975vsl.9.2022.05.18.11.13.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 May 2022 11:13:35 -0700 (PDT) From: Philip McGrath Date: Wed, 18 May 2022 14:11:09 -0400 Message-Id: <1a6669a4b3f0364cb0686e4ff70a0cdc44b53de6.1652890702.git.philip@philipmcgrath.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: References: <20220419232736.272970-1-philip@philipmcgrath.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652897776; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=UHfL3C/ibqhoWyMSseXInHhRAjPSYuVXliqi06fgUCQ=; b=tyEg8A24uTBWIhWLnADQuoGUwwuGgZu4AB8RN9W1dgRn3MC0um0LL4rVxTfkWlajx4R1Jy OKxfGxEI0B0ZUPzVJOjI5ryBg6IdlvV8O62xkI4/vCQmn/J+BygAcC/E4NfWVLqSxCyAyI FXFNJgPfgbJkXDdQsh0zQh/cb24IX4xy14bFLXfsPJLzp2DrNTMojfOe28KWfSjBM8Pkag JExJlVhJpxKKtuvdqalTGlhGh+150+piH7usDgRZ/27kdZJm4omotbqrH84ZVpXDC+njjF YXukgI9/5DYpkvb80i+Yr8mJHgKtbzwagdC8hCxlpZeH09wc8w2Q3bnR5tnGhA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652897776; a=rsa-sha256; cv=none; b=LVWVAFFCC20Ig4MS9eAzPh7yvVmS94R5+q1T7WicnrET4KFxtiXAGx7+CGKAK1Sn2gNDlF fuxM+zwi/4LLzxyeVUdlubMVVMP3S4F7+ssYlFZJnGAo2LaidBZ/FrpKXWypX26J3K/4NX h7kweRT6xaCBsK0YQjGxPvdp0lANrSMhyL/ooN92PLirI+/NJOiA2hcAaA4tuCLklZMuw/ ynKk3q52vWMtYv+gktcIrIzXGFvNu8LJ5FGPAZmbnkYhXzSdoaKuWR0GAuIzvk6G0punST FUGVfnHMkYxR+T62RcmbAkg16aFZq0rqGMkKWlMlfTg3F7H5cVn7BhDUs3snfw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=E1dixoAi; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 3.96 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=google header.b=E1dixoAi; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 47BBA2E604 X-Spam-Score: 3.96 X-Migadu-Scanner: scn1.migadu.com X-TUID: 05QlCY0HsMXt * gnu/packages/elm.scm (elm): Rename to ... (elm-sans-reactor): ... this new variable. [synopsis, description]: Tweak. (elm): New variable. * guix/build-system/elm.scm (default-elm): Use elm-sans-reactor. * doc/guix.texi (Build Systems)[elm-build-system]: Update accordingly. --- doc/guix.texi | 7 ++-- gnu/packages/elm.scm | 75 +++++++++++++++++++++++++++++++++++++-- guix/build-system/elm.scm | 2 +- 3 files changed, 79 insertions(+), 5 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index d7bc7523cd..282cddf798 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -8724,7 +8724,7 @@ Build Systems @samp{elm install}. The build system adds an Elm compiler package to the set of inputs. The -default compiler package (currently @code{elm}) can be overridden +default compiler package (currently @code{elm-sans-reactor}) can be overridden using the @code{#:elm} argument. Additionally, Elm packages needed by the build system itself are added as implicit inputs if they are not already present: to suppress this behavior, use the @@ -8747,7 +8747,10 @@ Build Systems Elm @dfn{projects} which declare @code{@{ "type": "package" @}} in their @file{elm.json} files. Using @code{elm-build-system} to build Elm @dfn{applications} (which declare @code{@{ "type": "application" @}}) is -possible, but requires ad-hoc modifications to the build phases. +possible, but requires ad-hoc modifications to the build phases. For +an example, see the definition of +the @code{elm} package itself (because the front-end for the +@samp{elm reactor} command is an Elm application). @item Elm supports multiple versions of a package coexisting simultaneously under diff --git a/gnu/packages/elm.scm b/gnu/packages/elm.scm index 8f92eea041..d515d68e8f 100644 --- a/gnu/packages/elm.scm +++ b/gnu/packages/elm.scm @@ -40,9 +40,9 @@ (define-module (gnu packages elm) ;; `elm reactor` exit with a useful error message if they aren't there. (define %reactor-root-base "share/elm/reactor-") -(define-public elm +(define-public elm-sans-reactor (package - (name "elm") + (name "elm-sans-reactor") (version "0.19.1") (source (origin @@ -93,6 +93,77 @@ (define-public elm ghc-vector ghc-zip-archive)) (home-page "https://elm-lang.org") + (synopsis "Minimal variant of @command{elm}") + (description + "This package provides a version of the Elm compiler without support for +the @command{elm reactor} development command.") + (license license:bsd-3))) + +(define-public elm + (package + (name "elm") + (version (package-version elm-sans-reactor)) + (source (package-source elm-sans-reactor)) + (native-inputs (list elm-sans-reactor)) + (inputs (list elm-sans-reactor + elm-browser + elm-core + elm-html + elm-http + elm-json + elm-project-metadata-utils + elm-svg + elm-explorations-markdown)) + (build-system elm-build-system) + (arguments + (list + #:modules + `((srfi srfi-26) + ,@%elm-default-modules) + #:phases + #~(modify-phases %standard-phases + (delete 'stage) + (replace 'configure + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "reactor" + (patch-application-dependencies)))) + (replace 'build + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (with-directory-excursion "reactor" + (invoke (search-input-file (or native-inputs inputs) + "/bin/elm") + "make" + "--optimize" + "src/NotFound.elm" + "src/Errors.elm" + "src/Index.elm")))) + (replace 'install + (lambda* (#:key inputs #:allow-other-keys) + (let* ((out-dir #$output) + (bin-dir (string-append out-dir "/bin")) + (reactor-dir (string-append out-dir + "/" + #$%reactor-root-base + (getenv "GUIX_ELM_VERSION"))) + (reactor-subdir (string-append reactor-dir "/_elm"))) + ;; We can't use a symlink here because Haskell's + ;; `getExecutablePath` follows all symlinks. + ;; Guix can make it a hard link later. + (install-file (search-input-file inputs ;; NOT native-inputs + "/bin/elm") + bin-dir) + (install-file "reactor/assets/favicon.ico" reactor-dir) + (for-each (cut install-file <> reactor-subdir) + '("reactor/elm.js" + "reactor/assets/styles.css" + ;; TODO: these are source-code-pro v1.017 and + ;; source-sans-pro v1.050: there may be breaking + ;; changes in Guix's existing + ;; font-adobe-source-{code,sans}-pro packages + "reactor/assets/source-code-pro.ttf" + "reactor/assets/source-sans-pro.ttf"))))) + (delete 'validate-compiled)))) + (home-page "https://elm-lang.org") (synopsis "Programming language for Web applications") (description "Elm is a statically-typed, purely-functional programming language for diff --git a/guix/build-system/elm.scm b/guix/build-system/elm.scm index 293bcbfb64..f5321f811b 100644 --- a/guix/build-system/elm.scm +++ b/guix/build-system/elm.scm @@ -101,7 +101,7 @@ (define (default-elm) "Return the default Elm package for builds." ;; Lazily resolve the binding to avoid a circular dependency. (let ((elm (resolve-interface '(gnu packages elm)))) - (module-ref elm 'elm))) + (module-ref elm 'elm-sans-reactor))) (define (default-elm-core) "Return the default elm-core package." -- 2.32.0