GNU bug report logs - #50969
[PATCH wip-haskell] gnu: idris: Fix build.

Previous Next

Package: guix-patches;

Reported by: Xinglu Chen <public <at> yoctocell.xyz>

Date: Sat, 2 Oct 2021 15:59:02 UTC

Severity: normal

Tags: patch

Done: Lars-Dominik Braun <lars <at> 6xq.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 50969 in the body.
You can then email your comments to 50969 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to lars <at> 6xq.net, guix-patches <at> gnu.org:
bug#50969; Package guix-patches. (Sat, 02 Oct 2021 15:59:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Xinglu Chen <public <at> yoctocell.xyz>:
New bug report received and forwarded. Copy sent to lars <at> 6xq.net, guix-patches <at> gnu.org. (Sat, 02 Oct 2021 15:59:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Xinglu Chen <public <at> yoctocell.xyz>
To: guix-patches <at> gnu.org
Subject: [PATCH wip-haskell] gnu: idris: Fix build.
Date: Sat, 02 Oct 2021 17:58:32 +0200
Backport some commits from upstream.

* gnu/packages/patches/idris-build-with-haskeline-0.8.patch:
* gnu/packages/patches/idris-build-with-megaparsec-9.patch: New patches
* gnu/local.mk (dist_patch_DATA): Add them.
* gnu/packages/idris.scm (idris): Use them.
---
 gnu/local.mk                                  |  2 +
 gnu/packages/idris.scm                        |  4 +-
 .../idris-build-with-haskeline-0.8.patch      | 85 +++++++++++++++++++
 .../idris-build-with-megaparsec-9.patch       | 27 ++++++
 4 files changed, 117 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/idris-build-with-haskeline-0.8.patch
 create mode 100644 gnu/packages/patches/idris-build-with-megaparsec-9.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ac5337b491..12661d8c94 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1257,6 +1257,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/id3lib-CVE-2007-4460.patch			\
   %D%/packages/patches/id3lib-UTF16-writing-bug.patch			\
   %D%/packages/patches/idris-disable-test.patch			\
+  %D%/packages/patches/idris-build-with-haskeline-0.8.patch	\
+  %D%/packages/patches/idris-build-with-megaparsec-9.patch	\
   %D%/packages/patches/ilmbase-fix-tests.patch			\
   %D%/packages/patches/imagemagick-CVE-2020-27829.patch		\
   %D%/packages/patches/imagemagick-ReadDCMImage-fix.patch	\
diff --git a/gnu/packages/idris.scm b/gnu/packages/idris.scm
index 0e8502b908..10ad154923 100644
--- a/gnu/packages/idris.scm
+++ b/gnu/packages/idris.scm
@@ -47,7 +47,9 @@ (define-public idris
               (sha256
                (base32
                 "1pachwc6msw3n1mz2z1r1w6h518w9gbhdvbaa5vi1qp3cn3wm6q4"))
-              (patches (search-patches "idris-disable-test.patch"))))
+              (patches (search-patches "idris-disable-test.patch"
+                                       "idris-build-with-haskeline-0.8.patch"
+                                       "idris-build-with-megaparsec-9.patch"))))
     (build-system haskell-build-system)
     (native-inputs                      ;For tests
      `(("perl" ,perl)
diff --git a/gnu/packages/patches/idris-build-with-haskeline-0.8.patch b/gnu/packages/patches/idris-build-with-haskeline-0.8.patch
new file mode 100644
index 0000000000..5d1fec2409
--- /dev/null
+++ b/gnu/packages/patches/idris-build-with-haskeline-0.8.patch
@@ -0,0 +1,85 @@
+From 89a87cf666eb8b27190c779e72d0d76eadc1bc14 Mon Sep 17 00:00:00 2001
+From: Niklas Larsson <niklas <at> mm.st>
+Date: Sat, 6 Jun 2020 15:29:45 +0200
+Subject: [PATCH] Fix to unblock haskeline-0.8
+
+---
+Taken from <https://github.com/idris-lang/Idris-dev/pull/4871>
+
+ idris.cabal         |  2 +-
+ src/Idris/Output.hs |  8 --------
+ src/Idris/REPL.hs   | 12 +++++-------
+ 3 files changed, 6 insertions(+), 16 deletions(-)
+
+diff --git a/idris.cabal b/idris.cabal
+index 38359019a9..bc9e265023 100644
+--- a/idris.cabal
++++ b/idris.cabal
+@@ -336,7 +336,7 @@ Library
+                 , directory >= 1.2.2.0 && < 1.2.3.0 || > 1.2.3.0
+                 , filepath < 1.5
+                 , fingertree >= 0.1.4.1 && < 0.2
+-                , haskeline >= 0.7 && < 0.8
++                , haskeline >= 0.8 && < 0.9
+                 , ieee754 >= 0.7 && < 0.9
+                 , megaparsec >= 7.0.4 && < 9
+                 , mtl >= 2.1 && < 2.3
+diff --git a/src/Idris/Output.hs b/src/Idris/Output.hs
+index 70b4d48a30..6b5d59948c 100644
+--- a/src/Idris/Output.hs
++++ b/src/Idris/Output.hs
+@@ -37,21 +37,13 @@ import Prelude hiding ((<$>))
+ #endif
+ 
+ import Control.Arrow (first)
+-import Control.Monad.Trans.Except (ExceptT(ExceptT), runExceptT)
+ import Data.List (intersperse, nub)
+ import Data.Maybe (fromJust, fromMaybe, isJust, listToMaybe)
+ import qualified Data.Set as S
+-import System.Console.Haskeline.MonadException (MonadException(controlIO),
+-                                                RunIO(RunIO))
+ import System.FilePath (replaceExtension)
+ import System.IO (Handle, hPutStr, hPutStrLn)
+ import System.IO.Error (tryIOError)
+ 
+-instance MonadException m => MonadException (ExceptT Err m) where
+-    controlIO f = ExceptT $ controlIO $ \(RunIO run) -> let
+-                    run' = RunIO (fmap ExceptT . run . runExceptT)
+-                    in fmap runExceptT $ f run'
+-
+ pshow :: IState -> Err -> String
+ pshow ist err = displayDecorated (consoleDecorate ist) .
+                 renderPretty 1.0 80 .
+diff --git a/src/Idris/REPL.hs b/src/Idris/REPL.hs
+index 05587d9672..5e0dc21089 100644
+--- a/src/Idris/REPL.hs
++++ b/src/Idris/REPL.hs
+@@ -122,23 +122,21 @@ repl orig mods efile
+                              (if colour && not isWindows
+                                 then colourisePrompt theme str
+                                 else str) ++ " "
+-        x <- H.catch (H.withInterrupt $ getInputLine prompt)
+-                     (ctrlC (return $ Just ""))
++        x <- H.handleInterrupt (ctrlC (return $ Just "")) (H.withInterrupt $ getInputLine prompt)
+         case x of
+             Nothing -> do lift $ when (not quiet) (iputStrLn "Bye bye")
+                           return ()
+             Just input -> -- H.catch
+-                do ms <- H.catch (H.withInterrupt $ lift $ processInput input orig mods efile)
+-                                 (ctrlC (return (Just mods)))
++                do ms <- H.handleInterrupt (ctrlC (return (Just mods))) (H.withInterrupt $ lift $ processInput input orig mods efile)
+                    case ms of
+                         Just mods -> let efile' = fromMaybe efile (listToMaybe mods)
+                                      in repl orig mods efile'
+                         Nothing -> return ()
+ --                             ctrlC)
+ --       ctrlC
+-   where ctrlC :: InputT Idris a -> SomeException -> InputT Idris a
+-         ctrlC act e = do lift $ iputStrLn (show e)
+-                          act -- repl orig mods
++   where ctrlC :: InputT Idris a -> InputT Idris a
++         ctrlC act = do lift $ iputStrLn "Interrupted"
++                        act -- repl orig mods
+ 
+          showMVs c thm [] = ""
+          showMVs c thm ms = "Holes: " ++
diff --git a/gnu/packages/patches/idris-build-with-megaparsec-9.patch b/gnu/packages/patches/idris-build-with-megaparsec-9.patch
new file mode 100644
index 0000000000..6d7ff1d713
--- /dev/null
+++ b/gnu/packages/patches/idris-build-with-megaparsec-9.patch
@@ -0,0 +1,27 @@
+From 6ea9bc913877d765048d7cdb7fc5aec60b196fac Mon Sep 17 00:00:00 2001
+From: Felix Yan <felixonmars <at> archlinux.org>
+Date: Wed, 16 Dec 2020 21:48:32 +0800
+Subject: [PATCH] Fix compatibility with megaparsec 9
+
+---
+Taken from <https://github.com/idris-lang/Idris-dev/pull/4892>
+
+ src/Idris/Parser/Stack.hs | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/Idris/Parser/Stack.hs b/src/Idris/Parser/Stack.hs
+index fb7b611440..879786f4d2 100644
+--- a/src/Idris/Parser/Stack.hs
++++ b/src/Idris/Parser/Stack.hs
+@@ -84,7 +84,11 @@ instance Message ParseError where
+       (pos, _) = P.reachOffsetNoLine (parseErrorOffset err) (parseErrorPosState err)
+ #endif
+   messageText = PP.text . init . P.parseErrorTextPretty . parseError
++#if MIN_VERSION_megaparsec(9,0,0)
++  messageSource err = sline
++#else
+   messageSource err = Just sline
++#endif
+     where
+ #if MIN_VERSION_megaparsec(8,0,0)
+       (sline, _) = P.reachOffset (parseErrorOffset err) (parseErrorPosState err)

base-commit: 8dfb377a135e1b068eb51e9958b0f1f56f8613e2
-- 
2.33.0







Reply sent to Lars-Dominik Braun <lars <at> 6xq.net>:
You have taken responsibility. (Sun, 03 Oct 2021 06:27:01 GMT) Full text and rfc822 format available.

Notification sent to Xinglu Chen <public <at> yoctocell.xyz>:
bug acknowledged by developer. (Sun, 03 Oct 2021 06:27:02 GMT) Full text and rfc822 format available.

Message #10 received at 50969-done <at> debbugs.gnu.org (full text, mbox):

From: Lars-Dominik Braun <lars <at> 6xq.net>
To: Xinglu Chen <public <at> yoctocell.xyz>
Cc: 50969-done <at> debbugs.gnu.org
Subject: Re: [bug#50969] [PATCH wip-haskell] gnu: idris: Fix build.
Date: Sun, 3 Oct 2021 08:26:06 +0200
Hi,

looks good, merged!

Thank you very much,
Lars





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 31 Oct 2021 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 178 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.