Unverified Commit c2b72bec authored by Jack Todaro's avatar Jack Todaro
Browse files

dev-lang/idris: patch for haskeline-0.8



Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: default avatarJack Todaro <solpeth@posteo.org>
parent c8c0bbb3
From 89a87cf666eb8b27190c779e72d0d76eadc1bc14 Mon Sep 17 00:00:00 2001
From: Niklas Larsson <niklas@mm.st>
Date: Sat, 6 Jun 2020 15:29:45 +0200
Subject: [PATCH] Fix to unblock haskeline-0.8
---
src/Idris/Output.hs | 8 --------
src/Idris/REPL.hs | 12 +++++-------
3 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/src/Idris/Output.hs b/src/Idris/Output.hs
index 70b4d48a3..6b5d59948 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 05587d967..5e0dc2108 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: " ++
......@@ -32,7 +32,7 @@ RDEPEND=">=dev-haskell/aeson-0.6:=[profile?] <dev-haskell/aeson-1.5:=[profile?]
>=dev-haskell/code-page-0.1:=[profile?] <dev-haskell/code-page-0.3:=[profile?]
>=dev-haskell/fingertree-0.1.4.1:=[profile?] <dev-haskell/fingertree-0.2:=[profile?]
>=dev-haskell/fsnotify-0.2:=[profile?] <dev-haskell/fsnotify-0.4:=[profile?]
>=dev-haskell/haskeline-0.7:=[profile?] <dev-haskell/haskeline-0.8:=[profile?]
>=dev-haskell/haskeline-0.8:=[profile?]
>=dev-haskell/ieee754-0.7:=[profile?] <dev-haskell/ieee754-0.9:=[profile?]
>=dev-haskell/megaparsec-7.0.4:=[profile?] <dev-haskell/megaparsec-9:=[profile?]
>=dev-haskell/mtl-2.1:=[profile?] <dev-haskell/mtl-2.3:=[profile?]
......@@ -63,6 +63,8 @@ DEPEND="${RDEPEND}
>=dev-haskell/tasty-rerun-1.0.0 )
"
PATCHES=( "${FILESDIR}"/${P}-haskeline-0.8.patch )
src_prepare() {
default
# runs dist/build/idris directly and breaks sandboxing
......@@ -76,7 +78,8 @@ src_prepare() {
tc-export AR CC RANLIB
cabal_chdeps \
'Cabal >= 2.4 && < 3.1' 'Cabal >= 2.4'
'Cabal >= 2.4 && < 3.1' 'Cabal >= 2.4' \
'haskeline >= 0.7 && < 0.8' 'haskeline >= 0.8'
}
src_configure() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment