Remove curses dependency

This commit is contained in:
Niklas Larsson 2016-03-03 12:43:50 +01:00
parent d2a9e919fe
commit b64f0fd31b
5 changed files with 9 additions and 28 deletions

View File

@ -1 +1 @@
CABALFLAGS += -f LLVM -f FFI -f curses --disable-documentation --disable-profiling --disable-library-profiling
CABALFLAGS += -f GMP -f FFI --disable-documentation --disable-profiling --disable-library-profiling

View File

@ -839,11 +839,6 @@ Flag GMP
Default: False
manual: True
Flag curses
Description: Use Curses to get the screen width
Default: False
manual: True
-- This flag determines whether to show Git hashes in version strings
-- Defaults to True because Hackage is a source release
Flag release
@ -1002,6 +997,7 @@ Library
, pretty < 1.2
, process < 1.3
, split < 0.3
, terminal-size < 0.4
, text >=1.2.1.0 && < 1.3
, time >= 1.4 && < 1.6
, transformers < 0.5
@ -1053,9 +1049,6 @@ Library
build-depends: libffi < 0.2
extra-libraries: gmp
cpp-options: -DIDRIS_GMP
if flag(curses)
build-depends: hscurses < 1.5
cpp-options: -DCURSES
if flag(freestanding)
other-modules: Target_idris
cpp-options: -DFREESTANDING

View File

@ -1,24 +1,14 @@
{-# LANGUAGE CPP #-}
module Util.ScreenSize(getScreenWidth) where
#ifndef CURSES
getScreenWidth :: IO Int
getScreenWidth = return 80
#else
import UI.HSCurses.Curses
import System.Console.Terminal.Size (size, width)
import System.IO (hIsTerminalDevice, stdout)
getScreenWidth :: IO Int
getScreenWidth = do term <- hIsTerminalDevice stdout
sz <- size
if term
then do
initScr
refresh
size <- scrSize
endWin
return (snd size)
else return 80
#endif
then case sz of
Just w -> return $ width w
Nothing -> return 80
else return 80

View File

@ -7,7 +7,6 @@ let
native_libs = [
libffi
zlib
ncurses
gmp
pkgconfig
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [

View File

@ -9,7 +9,6 @@ flags:
extra-deps:
- annotated-wl-pprint-0.7.0
- cheapskate-0.1.0.4
- hscurses-1.4.2.0
- libffi-0.1
nix:
enable: false