summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Suntsov <protvin@disroot.org>2026-08-03 21:22:24 +0500
committerAndreas Enge <andreas@enge.fr>2026-08-04 17:22:13 +0200
commitd3acc7d021c51e292fe7572d6eef3d2d8d86b1c2 (patch)
treec0d9c15cf4b5e76f2b9e1e43927bbf7ff9a3ae3b
parent86813d5779253bb50002d79ab791eeda5a8b4729 (diff)
gnu: elm-sans-reactor: Fix build.
* gnu/packages/elm.scm (elm-sans-reactor)[source]: Add reference to patch and sort patches. * gnu/packages/patches/elm-bump-ansi-wl-pprint-dependency-fix-build.patch: New file. * gnu/local.mk (dist_patch_DATA): Add reference to it. Fixes: guix/guix#10293 Signed-off-by: Andreas Enge <andreas@enge.fr>
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/elm.scm6
-rw-r--r--gnu/packages/patches/elm-bump-ansi-wl-pprint-dependency-fix-build.patch91
3 files changed, 96 insertions, 2 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 05439ca26ad..362f5ca500f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1248,6 +1248,7 @@ dist_patch_DATA = \
1248 %D%/packages/patches/python-treelib-remove-python2-compat.patch \ 1248 %D%/packages/patches/python-treelib-remove-python2-compat.patch \
1249 %D%/packages/patches/elm-offline-package-registry.patch \ 1249 %D%/packages/patches/elm-offline-package-registry.patch \
1250 %D%/packages/patches/elm-reactor-static-files.patch \ 1250 %D%/packages/patches/elm-reactor-static-files.patch \
1251 %D%/packages/patches/elm-bump-ansi-wl-pprint-dependency-fix-build.patch \
1251 %D%/packages/patches/emacs-deferred-fix-number-of-arguments.patch \ 1252 %D%/packages/patches/emacs-deferred-fix-number-of-arguments.patch \
1252 %D%/packages/patches/emacs-disable-jit-compilation.patch \ 1253 %D%/packages/patches/emacs-disable-jit-compilation.patch \
1253 %D%/packages/patches/emacs-doc-toc-shell-commands.patch \ 1254 %D%/packages/patches/emacs-doc-toc-shell-commands.patch \
diff --git a/gnu/packages/elm.scm b/gnu/packages/elm.scm
index 50e48156d93..b97136c74ea 100644
--- a/gnu/packages/elm.scm
+++ b/gnu/packages/elm.scm
@@ -2,6 +2,7 @@
2;;; Copyright © 2019 Robert Vollmert <rob@vllmrt.net> 2;;; Copyright © 2019 Robert Vollmert <rob@vllmrt.net>
3;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com> 3;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
4;;; Copyright © 2022 jgart <jgart@dismail.de> 4;;; Copyright © 2022 jgart <jgart@dismail.de>
5;;; Copyright © 2026 Konstantin Suntsov <protvin@disroot.org>
5;;; 6;;;
6;;; This file is part of GNU Guix. 7;;; This file is part of GNU Guix.
7;;; 8;;;
@@ -55,9 +56,10 @@
55 (sha256 56 (sha256
56 (base32 "1rdg3xp3js9xadclk3cdypkscm5wahgsfmm4ldcw3xswzhw6ri8w")) 57 (base32 "1rdg3xp3js9xadclk3cdypkscm5wahgsfmm4ldcw3xswzhw6ri8w"))
57 (patches 58 (patches
58 (search-patches "elm-reactor-static-files.patch" 59 (search-patches "elm-bump-ansi-wl-pprint-dependency-fix-build.patch"
60 "elm-ghc9.2.patch"
59 "elm-offline-package-registry.patch" 61 "elm-offline-package-registry.patch"
60 "elm-ghc9.2.patch")))) 62 "elm-reactor-static-files.patch"))))
61 (build-system haskell-build-system) 63 (build-system haskell-build-system)
62 (arguments 64 (arguments
63 (list 65 (list
diff --git a/gnu/packages/patches/elm-bump-ansi-wl-pprint-dependency-fix-build.patch b/gnu/packages/patches/elm-bump-ansi-wl-pprint-dependency-fix-build.patch
new file mode 100644
index 00000000000..857b0aa746c
--- /dev/null
+++ b/gnu/packages/patches/elm-bump-ansi-wl-pprint-dependency-fix-build.patch
@@ -0,0 +1,91 @@
1Adopting changes (rejected elm.cabal reapplied) from:
2https://sources.debian.org/data/main/e/elm-compiler/0.19.1-5/debian/patches/0002-bump-ansi-wl-pprint-dependency-fix-build.patch
3
4From: Hilko Bengen <bengen@debian.org>
5Date: Thu, 28 Nov 2024 01:24:16 +0000
6Subject: bump ansi-wl-pprint dependency, fix build
7
8ANSI support is still missing; until that is fixed, elm reactor won't
9output colored error messages.
10---
11 compiler/src/Reporting/Doc.hs | 21 +++++++++++++--------
12 elm.cabal | 4 +++-
13 2 files changed, 16 insertions(+), 9 deletions(-)
14
15diff --git a/compiler/src/Reporting/Doc.hs b/compiler/src/Reporting/Doc.hs
16index 26c1551..99d1f49 100644
17--- a/compiler/src/Reporting/Doc.hs
18+++ b/compiler/src/Reporting/Doc.hs
19@@ -48,10 +48,12 @@ import Prelude hiding (cycle)
20 import qualified Data.List as List
21 import Data.Monoid ((<>))
22 import qualified Data.Name as Name
23+import qualified Data.Text as Text
24 import qualified System.Console.ANSI.Types as Ansi
25 import qualified System.Info as Info
26 import System.IO (Handle)
27 import qualified Text.PrettyPrint.ANSI.Leijen as P
28+import qualified Prettyprinter as PP
29
30 import qualified Data.Index as Index
31 import qualified Elm.Package as Pkg
32@@ -309,26 +311,29 @@ data Color
33 toJsonHelp :: Style -> [String] -> P.SimpleDoc -> [E.Value]
34 toJsonHelp style revChunks simpleDoc =
35 case simpleDoc of
36- P.SFail ->
37+ PP.SFail ->
38 error $
39 "according to the main implementation, @SFail@ can not\
40 \ appear uncaught in a rendered @SimpleDoc@"
41
42- P.SEmpty ->
43+ PP.SEmpty ->
44 [ encodeChunks style revChunks ]
45
46- P.SChar char rest ->
47+ PP.SChar char rest ->
48 toJsonHelp style ([char] : revChunks) rest
49
50- P.SText _ string rest ->
51- toJsonHelp style (string : revChunks) rest
52+ PP.SText _ text rest ->
53+ toJsonHelp style (Text.unpack text : revChunks) rest
54
55- P.SLine indent rest ->
56+ PP.SLine indent rest ->
57 toJsonHelp style (replicate indent ' ' : "\n" : revChunks) rest
58
59- P.SSGR sgrs rest ->
60- encodeChunks style revChunks : toJsonHelp (sgrToStyle sgrs style) [] rest
61+ -- FIXME need to figure out how to add ANSI SGR handling here
62+ PP.SAnnPop rest ->
63+ toJsonHelp style revChunks rest
64
65+ PP.SAnnPush _ann rest ->
66+ toJsonHelp style revChunks rest
67
68 sgrToStyle :: [Ansi.SGR] -> Style -> Style
69 sgrToStyle sgrs style@(Style bold underline color) =
70diff --git a/elm.cabal b/elm.cabal
71index 144fada..de91020 100644
72--- a/elm.cabal
73+++ b/elm.cabal
74@@ -204,7 +204,8 @@
75
76 Build-depends:
77 ansi-terminal >= 0.8 && < 0.9,
78- ansi-wl-pprint >= 0.6.8 && < 0.7,
79+ ansi-wl-pprint >= 1,
80+ prettyprinter,
81 base >=4.11 && <5,
82 binary >= 0.8 && < 0.9,
83 bytestring >= 0.9 && < 0.11,
84@@ -231,6 +232,7 @@
85 snap-core,
86 snap-server,
87 template-haskell,
88+ text,
89 time >= 1.9.1,
90 unordered-containers,
91 utf8-string,