Skip to content

Commit

Permalink
Remove curses dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
melted committed Mar 3, 2016
1 parent d2a9e91 commit b64f0fd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 28 deletions.
2 changes: 1 addition & 1 deletion custom.mk-alldeps
Original file line number Diff line number Diff line change
@@ -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
9 changes: 1 addition & 8 deletions idris.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
24 changes: 7 additions & 17 deletions src/Util/ScreenSize.hs
Original file line number Diff line number Diff line change
@@ -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

1 change: 0 additions & 1 deletion stack-shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ let
native_libs = [
libffi
zlib
ncurses
gmp
pkgconfig
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
Expand Down
1 change: 0 additions & 1 deletion stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b64f0fd

Please sign in to comment.