avoid pretty-show with GHC < 7.4; update tested-with (fixes #155)
hledger builds with GHC 7.2 through 7.8. 7.0 is not supported because we require shakespeare which requires the DeriveGeneric extension.
This commit is contained in:
parent
da0ce23144
commit
ef1cc06cab
@ -24,7 +24,9 @@ module Hledger.Utils (---- provide these frequently used modules - or not, for c
|
|||||||
-- module Data.PPrint,
|
-- module Data.PPrint,
|
||||||
-- module Hledger.Utils.UTF8IOCompat
|
-- module Hledger.Utils.UTF8IOCompat
|
||||||
SystemString,fromSystemString,toSystemString,error',userError',
|
SystemString,fromSystemString,toSystemString,error',userError',
|
||||||
|
#if __GLASGOW_HASKELL__ >= 704
|
||||||
ppShow
|
ppShow
|
||||||
|
#endif
|
||||||
-- the rest need to be done in each module I think
|
-- the rest need to be done in each module I think
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
@ -52,13 +54,20 @@ import Text.ParserCombinators.Parsec
|
|||||||
import Text.Printf
|
import Text.Printf
|
||||||
import Text.Regex.TDFA
|
import Text.Regex.TDFA
|
||||||
import Text.RegexPR
|
import Text.RegexPR
|
||||||
import Text.Show.Pretty
|
|
||||||
-- import qualified Data.Map as Map
|
-- import qualified Data.Map as Map
|
||||||
--
|
--
|
||||||
-- import Prelude hiding (readFile,writeFile,appendFile,getContents,putStr,putStrLn)
|
-- import Prelude hiding (readFile,writeFile,appendFile,getContents,putStr,putStrLn)
|
||||||
-- import Hledger.Utils.UTF8IOCompat (readFile,writeFile,appendFile,getContents,putStr,putStrLn)
|
-- import Hledger.Utils.UTF8IOCompat (readFile,writeFile,appendFile,getContents,putStr,putStrLn)
|
||||||
import Hledger.Utils.UTF8IOCompat (SystemString,fromSystemString,toSystemString,error',userError')
|
import Hledger.Utils.UTF8IOCompat (SystemString,fromSystemString,toSystemString,error',userError')
|
||||||
|
|
||||||
|
#if __GLASGOW_HASKELL__ >= 704
|
||||||
|
import Text.Show.Pretty (ppShow)
|
||||||
|
#else
|
||||||
|
-- the required pretty-show version requires GHC >= 7.4
|
||||||
|
ppShow :: Show a => a -> String
|
||||||
|
ppShow = show
|
||||||
|
#endif
|
||||||
|
|
||||||
-- strings
|
-- strings
|
||||||
|
|
||||||
lowercase = map toLower
|
lowercase = map toLower
|
||||||
|
|||||||
@ -17,7 +17,7 @@ author: Simon Michael <simon@joyful.com>
|
|||||||
maintainer: Simon Michael <simon@joyful.com>
|
maintainer: Simon Michael <simon@joyful.com>
|
||||||
homepage: http://hledger.org
|
homepage: http://hledger.org
|
||||||
bug-reports: http://hledger.org/bugs
|
bug-reports: http://hledger.org/bugs
|
||||||
tested-with: GHC==7.4.2, GHC==7.6.3
|
tested-with: GHC==7.2.2, GHC==7.4.2, GHC==7.6.3, GHC==7.8
|
||||||
cabal-version: >= 1.10
|
cabal-version: >= 1.10
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
-- data-dir: data
|
-- data-dir: data
|
||||||
@ -31,6 +31,7 @@ extra-source-files: tests/suite.hs
|
|||||||
library
|
library
|
||||||
-- should set patchlevel here as in Makefile
|
-- should set patchlevel here as in Makefile
|
||||||
cpp-options: -DPATCHLEVEL=0
|
cpp-options: -DPATCHLEVEL=0
|
||||||
|
default-language: Haskell2010
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
Hledger
|
Hledger
|
||||||
Hledger.Data
|
Hledger.Data
|
||||||
@ -75,7 +76,6 @@ library
|
|||||||
,old-locale
|
,old-locale
|
||||||
,old-time
|
,old-time
|
||||||
,parsec
|
,parsec
|
||||||
,pretty-show >= 1.6.4
|
|
||||||
,regex-tdfa
|
,regex-tdfa
|
||||||
,regexpr >= 0.5.1
|
,regexpr >= 0.5.1
|
||||||
,safe >= 0.2
|
,safe >= 0.2
|
||||||
@ -84,7 +84,8 @@ library
|
|||||||
,transformers >= 0.2 && < 0.4
|
,transformers >= 0.2 && < 0.4
|
||||||
,utf8-string >= 0.3.5 && < 0.4
|
,utf8-string >= 0.3.5 && < 0.4
|
||||||
,HUnit
|
,HUnit
|
||||||
default-language: Haskell2010
|
if impl(ghc >= 7.4)
|
||||||
|
build-depends: pretty-show >= 1.6.4
|
||||||
|
|
||||||
source-repository head
|
source-repository head
|
||||||
type: git
|
type: git
|
||||||
@ -94,6 +95,7 @@ test-suite tests
|
|||||||
type: exitcode-stdio-1.0
|
type: exitcode-stdio-1.0
|
||||||
main-is: tests/suite.hs
|
main-is: tests/suite.hs
|
||||||
ghc-options: -Wall
|
ghc-options: -Wall
|
||||||
|
default-language: Haskell2010
|
||||||
build-depends: hledger-lib
|
build-depends: hledger-lib
|
||||||
, base >= 4.3 && < 5
|
, base >= 4.3 && < 5
|
||||||
, cmdargs
|
, cmdargs
|
||||||
@ -107,7 +109,6 @@ test-suite tests
|
|||||||
, old-locale
|
, old-locale
|
||||||
, old-time
|
, old-time
|
||||||
, parsec
|
, parsec
|
||||||
, pretty-show >= 1.6.4
|
|
||||||
, regex-tdfa
|
, regex-tdfa
|
||||||
, regexpr
|
, regexpr
|
||||||
, safe
|
, safe
|
||||||
@ -116,7 +117,8 @@ test-suite tests
|
|||||||
, test-framework-hunit
|
, test-framework-hunit
|
||||||
, time
|
, time
|
||||||
, transformers
|
, transformers
|
||||||
default-language: Haskell2010
|
if impl(ghc >= 7.4)
|
||||||
|
build-depends: pretty-show >= 1.6.4
|
||||||
|
|
||||||
-- cf http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.html
|
-- cf http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.html
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@ author: Simon Michael <simon@joyful.com>
|
|||||||
maintainer: Simon Michael <simon@joyful.com>
|
maintainer: Simon Michael <simon@joyful.com>
|
||||||
homepage: http://hledger.org
|
homepage: http://hledger.org
|
||||||
bug-reports: http://hledger.org/bugs
|
bug-reports: http://hledger.org/bugs
|
||||||
tested-with: GHC==7.4.2, GHC==7.6.3
|
tested-with: GHC==7.2.2, GHC==7.4.2, GHC==7.6.3, GHC==7.8
|
||||||
cabal-version: >= 1.10
|
cabal-version: >= 1.10
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
-- data-dir: data
|
-- data-dir: data
|
||||||
@ -43,6 +43,7 @@ flag threaded
|
|||||||
library
|
library
|
||||||
cpp-options: -DVERSION="0.22.98"
|
cpp-options: -DVERSION="0.22.98"
|
||||||
ghc-options: -W
|
ghc-options: -W
|
||||||
|
default-language: Haskell2010
|
||||||
-- should be the same as below
|
-- should be the same as below
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
Hledger.Cli
|
Hledger.Cli
|
||||||
@ -86,7 +87,8 @@ library
|
|||||||
,time
|
,time
|
||||||
,utf8-string >= 0.3.5 && < 0.4
|
,utf8-string >= 0.3.5 && < 0.4
|
||||||
,wizards == 1.0.*
|
,wizards == 1.0.*
|
||||||
default-language: Haskell2010
|
if impl(ghc >= 7.4)
|
||||||
|
build-depends: pretty-show >= 1.6.4
|
||||||
|
|
||||||
-- should depend on the above to avoid double compilation but this is
|
-- should depend on the above to avoid double compilation but this is
|
||||||
-- still too complicated as of 2011/6/1 because:
|
-- still too complicated as of 2011/6/1 because:
|
||||||
@ -119,6 +121,7 @@ executable hledger
|
|||||||
if flag(threaded)
|
if flag(threaded)
|
||||||
ghc-options: -threaded
|
ghc-options: -threaded
|
||||||
-- should be the same as above
|
-- should be the same as above
|
||||||
|
default-language: Haskell2010
|
||||||
build-depends:
|
build-depends:
|
||||||
hledger-lib == 0.22.98
|
hledger-lib == 0.22.98
|
||||||
,base >= 4.3 && < 5
|
,base >= 4.3 && < 5
|
||||||
@ -143,12 +146,14 @@ executable hledger
|
|||||||
,time
|
,time
|
||||||
,utf8-string >= 0.3.5 && < 0.4
|
,utf8-string >= 0.3.5 && < 0.4
|
||||||
,wizards == 1.0.*
|
,wizards == 1.0.*
|
||||||
default-language: Haskell2010
|
if impl(ghc >= 7.4)
|
||||||
|
build-depends: pretty-show >= 1.6.4
|
||||||
|
|
||||||
test-suite tests
|
test-suite tests
|
||||||
type: exitcode-stdio-1.0
|
type: exitcode-stdio-1.0
|
||||||
main-is: tests/suite.hs
|
main-is: tests/suite.hs
|
||||||
ghc-options: -Wall
|
ghc-options: -Wall
|
||||||
|
default-language: Haskell2010
|
||||||
build-depends: hledger-lib
|
build-depends: hledger-lib
|
||||||
, hledger
|
, hledger
|
||||||
, base >= 4.3 && < 5
|
, base >= 4.3 && < 5
|
||||||
@ -164,7 +169,6 @@ test-suite tests
|
|||||||
, old-locale
|
, old-locale
|
||||||
, old-time
|
, old-time
|
||||||
, parsec
|
, parsec
|
||||||
, pretty-show >= 1.6.4
|
|
||||||
, process
|
, process
|
||||||
, regexpr
|
, regexpr
|
||||||
, safe
|
, safe
|
||||||
@ -177,4 +181,5 @@ test-suite tests
|
|||||||
, time
|
, time
|
||||||
, transformers
|
, transformers
|
||||||
, wizards == 1.0.*
|
, wizards == 1.0.*
|
||||||
default-language: Haskell2010
|
if impl(ghc >= 7.4)
|
||||||
|
build-depends: pretty-show >= 1.6.4
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user