mirror of
https://github.com/ilyakooo0/Idris-dev.git
synced 2024-10-26 09:54:23 +03:00
Remove curses dependency
This commit is contained in:
parent
d2a9e919fe
commit
b64f0fd31b
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -7,7 +7,6 @@ let
|
||||
native_libs = [
|
||||
libffi
|
||||
zlib
|
||||
ncurses
|
||||
gmp
|
||||
pkgconfig
|
||||
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user