on master help sign in
Remove curses dependency
b64f0fdNiklas Larsson
custom.mk-alldeps+1−1
@@ -1 +1 @@
1−CABALFLAGS += -f LLVM -f FFI -f curses --disable-documentation --disable-profiling --disable-library-profiling
1+CABALFLAGS += -f GMP -f FFI --disable-documentation --disable-profiling --disable-library-profiling
idris.cabal+1−8
@@ -839,11 +839,6 @@ Flag GMP
839 Default: False
839 Default: False
840 manual: True
840 manual: True
841
841
842−Flag curses
843− Description: Use Curses to get the screen width
844− Default: False
845− manual: True
846−
847-- This flag determines whether to show Git hashes in version strings
842-- This flag determines whether to show Git hashes in version strings
848-- Defaults to True because Hackage is a source release
843-- Defaults to True because Hackage is a source release
849Flag release
844Flag release
@@ -1002,6 +997,7 @@ Library
1002 , pretty < 1.2
997 , pretty < 1.2
1003 , process < 1.3
998 , process < 1.3
1004 , split < 0.3
999 , split < 0.3
1000+ , terminal-size < 0.4
1005 , text >=1.2.1.0 && < 1.3
1001 , text >=1.2.1.0 && < 1.3
1006 , time >= 1.4 && < 1.6
1002 , time >= 1.4 && < 1.6
1007 , transformers < 0.5
1003 , transformers < 0.5
@@ -1053,9 +1049,6 @@ Library
1053 build-depends: libffi < 0.2
1049 build-depends: libffi < 0.2
1054 extra-libraries: gmp
1050 extra-libraries: gmp
1055 cpp-options: -DIDRIS_GMP
1051 cpp-options: -DIDRIS_GMP
1056− if flag(curses)
1057− build-depends: hscurses < 1.5
1058− cpp-options: -DCURSES
1059 if flag(freestanding)
1052 if flag(freestanding)
1060 other-modules: Target_idris
1053 other-modules: Target_idris
1061 cpp-options: -DFREESTANDING
1054 cpp-options: -DFREESTANDING
src/Util/ScreenSize.hs+7−17
@@ -1,24 +1,14 @@
1−{-# LANGUAGE CPP #-}
2module Util.ScreenSize(getScreenWidth) where
1module Util.ScreenSize(getScreenWidth) where
3
2
4−#ifndef CURSES
3+import System.Console.Terminal.Size (size, width)
5−
6−getScreenWidth :: IO Int
7−getScreenWidth = return 80
8−
9−#else
10−
11−import UI.HSCurses.Curses
12import System.IO (hIsTerminalDevice, stdout)
4import System.IO (hIsTerminalDevice, stdout)
13
5
14getScreenWidth :: IO Int
6getScreenWidth :: IO Int
15getScreenWidth = do term <- hIsTerminalDevice stdout
7getScreenWidth = do term <- hIsTerminalDevice stdout
8+ sz <- size
16 if term
9 if term
17− then do
10+ then case sz of
18− initScr
19− refresh
20− size <- scrSize
21− endWin
22− return (snd size)
11+ Just w -> return $ width w
12+ Nothing -> return 80
23− else return 80
13+ else return 80
24−#endif
14+
stack-shell.nix−1
@@ -7,7 +7,6 @@ let
7 native_libs = [
7 native_libs = [
8 libffi
8 libffi
9 zlib
9 zlib
10− ncurses
11 gmp
10 gmp
12 pkgconfig
11 pkgconfig
13 ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
12 ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
stack.yaml−1
@@ -9,7 +9,6 @@ flags:
9extra-deps:
9extra-deps:
10- annotated-wl-pprint-0.7.0
10- annotated-wl-pprint-0.7.0
11- cheapskate-0.1.0.4
11- cheapskate-0.1.0.4
12−- hscurses-1.4.2.0
13- libffi-0.1
12- libffi-0.1
14nix:
13nix:
15 enable: false
14 enable: false