summary refs log tree commit diff
path: root/gnu/packages/elm.scm
diff options
context:
space:
mode:
authorPhilip McGrath <philip@philipmcgrath.com>2022-05-18 14:10:48 -0400
committerLudovic Courtès <ludo@gnu.org>2022-05-22 01:07:51 +0200
commit4e99510deadff2fe1f0e8ee5e030e0ff28d569f0 (patch)
tree87f04391802a723573e674623a953708bbb9c8b8 /gnu/packages/elm.scm
parent014f97544dbe4f08405320d129a1a5d9c1f775f0 (diff)
downloadguix-4e99510deadff2fe1f0e8ee5e030e0ff28d569f0.tar.gz
gnu: elm-compiler: Update to 0.19.1.
* gnu/packages/patches/elm-compiler-disable-reactor.patch,
gnu/packages/patches/elm-compiler-fix-map-key.patch: Delete files.
* gnu/packages/patches/elm-reactor-static-files.patch: New file.
* gnu/local.mk (dist_patch_DATA): Update accordingly.
* gnu/packages/elm.scm (elm-compiler): Update to 0.19.1.
[origin]<patches>: Remove stale patches. Add new patch.
[arguments]: Use G-expressions. Add #:configure-flags for new patch.
[inputs]: Remove ghc-file-embed. Add ghc-filelock.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/elm.scm')
-rw-r--r--gnu/packages/elm.scm44
1 files changed, 28 insertions, 16 deletions
diff --git a/gnu/packages/elm.scm b/gnu/packages/elm.scm
index ca7c61041b..988cc02de1 100644
--- a/gnu/packages/elm.scm
+++ b/gnu/packages/elm.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2019 Robert Vollmert <rob@vllmrt.net>
+;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -24,18 +25,24 @@
   #:use-module (gnu packages haskell-xyz)
   #:use-module (gnu packages haskell-web)
   #:use-module (guix build-system haskell)
+  #:use-module (guix gexp)
   #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages))
 
-;; The full elm build calls out to itself via Template Haskell to
-;; compile the elm reactor web app. elm reactor isn't required to
-;; compile elm applications, so we take this part out of this
-;; bootstrap package.
+;; The `elm` build usually calls out to itself via Template Haskell to compile
+;; the `elm reactor` web app (which depends on additional Elm packages) and
+;; embeds the static files into itself.  The reactor isn't required to compile
+;; Elm applications, so we want to skip it for the bootstrap package, but we
+;; also want to be able to enable it once we can build it.  We patch Elm to
+;; instead look for the files on disk relative to the executable and to have
+;; `elm reactor` exit with a useful error message if they aren't there.
+(define %reactor-root-base
+  "share/elm/reactor-")
 (define-public elm-compiler
   (package
     (name "elm-compiler")
-    (version "0.19.0")
+    (version "0.19.1")
     (source
      (origin
        (method git-fetch)
@@ -44,24 +51,29 @@
              (url "https://github.com/elm/compiler/")
              (commit version)))
        (sha256
-        (base32 "0s93z9vr0vp5w894ghc5s34nsq09sg1msf59zfiba87sid5vgjqy"))
+        (base32 "1rdg3xp3js9xadclk3cdypkscm5wahgsfmm4ldcw3xswzhw6ri8w"))
        (patches
-        (search-patches "elm-compiler-disable-reactor.patch"
-                        "elm-compiler-fix-map-key.patch"))))
+        (search-patches "elm-reactor-static-files.patch"))))
     (build-system haskell-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-before 'configure 'update-constraints
-           (lambda _
-             (substitute* "elm.cabal"
-               (("(ansi-terminal|containers|network|http-client|language-glsl)\\s+[^,]+" all dep)
-                dep)))))))
+     (list
+      #:configure-flags
+      #~(list (string-append "--ghc-option=-DGUIX_REACTOR_STATIC_REL_ROOT="
+                             "\"../" #$%reactor-root-base
+                             #$(package-version this-package)
+                             "\""))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'configure 'update-constraints
+            (lambda _
+              (substitute* "elm.cabal"
+                (("(ansi-terminal|containers|network|http-client|language-glsl)\\s+[^,]+" all dep)
+                 dep)))))))
     (inputs
      (list ghc-ansi-terminal
            ghc-ansi-wl-pprint
            ghc-edit-distance
-           ghc-file-embed
+           ghc-filelock
            ghc-http
            ghc-http-client
            ghc-http-client-tls