adapt to GHC-7.10's time-1.5 (#239)
This commit is contained in:
		
							parent
							
								
									b8974c4bcc
								
							
						
					
					
						commit
						e60eb71467
					
				| @ -1,3 +1,4 @@ | ||||
| {-# LANGUAGE CPP #-} | ||||
| {-# LANGUAGE NoMonoLocalBinds #-} | ||||
| {-# LANGUAGE FlexibleContexts #-} | ||||
| {-| | ||||
| @ -67,14 +68,18 @@ import Control.Applicative ((<*)) | ||||
| import Control.Monad | ||||
| import Data.List | ||||
| import Data.Maybe | ||||
| #if MIN_VERSION_time(1,5,0) | ||||
| import Data.Time.Format hiding (months) | ||||
| #else | ||||
| import Data.Time.Format | ||||
| import System.Locale (defaultTimeLocale) | ||||
| #endif | ||||
| import Data.Time.Calendar | ||||
| import Data.Time.Calendar.OrdinalDate | ||||
| import Data.Time.Calendar.WeekDate | ||||
| import Data.Time.Clock | ||||
| import Data.Time.LocalTime | ||||
| import Safe (headMay, lastMay, readMay) | ||||
| import System.Locale (defaultTimeLocale) | ||||
| import Test.HUnit | ||||
| import Text.Parsec | ||||
| import Text.Printf | ||||
|  | ||||
| @ -1,3 +1,4 @@ | ||||
| {-# LANGUAGE CPP #-} | ||||
| {-| | ||||
| 
 | ||||
| A 'TimeLogEntry' is a clock-in, clock-out, or other directive in a timelog | ||||
| @ -13,7 +14,9 @@ import Data.Time.Calendar | ||||
| import Data.Time.Clock | ||||
| import Data.Time.Format | ||||
| import Data.Time.LocalTime | ||||
| #if !MIN_VERSION_time(1,5,0) | ||||
| import System.Locale (defaultTimeLocale) | ||||
| #endif | ||||
| import Test.HUnit | ||||
| import Text.Printf | ||||
| 
 | ||||
|  | ||||
| @ -1,3 +1,4 @@ | ||||
| {-# LANGUAGE CPP #-} | ||||
| {-| | ||||
| 
 | ||||
| A reader for CSV data, using an extra rules file to help interpret the data. | ||||
| @ -30,11 +31,15 @@ import Data.Maybe | ||||
| import Data.Ord | ||||
| import Data.Time.Calendar (Day) | ||||
| import Data.Time.Format (parseTime) | ||||
| #if MIN_VERSION_time(1,5,0) | ||||
| import Data.Time.Format (defaultTimeLocale) | ||||
| #else | ||||
| import System.Locale (defaultTimeLocale) | ||||
| #endif | ||||
| import Safe | ||||
| import System.Directory (doesFileExist) | ||||
| import System.FilePath | ||||
| import System.IO (stderr) | ||||
| import System.Locale (defaultTimeLocale) | ||||
| import Test.HUnit | ||||
| import Text.CSV (parseCSV, CSV) | ||||
| import Text.Parsec hiding (parse) | ||||
|  | ||||
| @ -39,6 +39,12 @@ flag double | ||||
|     Default:       False | ||||
| 
 | ||||
| 
 | ||||
| flag old-locale | ||||
|   description: A compatibility flag, set automatically by cabal. | ||||
|                If false then depend on time >= 1.5,  | ||||
|                if true then depend on time < 1.5 together with old-locale. | ||||
|   default: False | ||||
| 
 | ||||
| library | ||||
|   -- should set patchlevel here as in Makefile | ||||
|   cpp-options: -DPATCHLEVEL=0 | ||||
| @ -93,20 +99,21 @@ library | ||||
|                  ,directory | ||||
|                  ,filepath | ||||
|                  ,mtl | ||||
|                  ,old-locale | ||||
|                  ,old-time | ||||
|                  ,parsec >= 3 | ||||
|                  ,regex-tdfa | ||||
|                  ,regexpr >= 0.5.1 | ||||
|                  ,safe >= 0.2 | ||||
|                  ,split >= 0.1 && < 0.3 | ||||
|                  ,time | ||||
|                  ,transformers >= 0.2 && < 0.5 | ||||
|                  ,utf8-string >= 0.3.5 && < 1.1 | ||||
|                  ,HUnit | ||||
|   if impl(ghc >= 7.4) | ||||
|     build-depends: pretty-show >= 1.6.4 | ||||
| 
 | ||||
|   if flag(old-locale) | ||||
|     build-depends: time < 1.5, old-locale | ||||
|   else | ||||
|     build-depends: time >= 1.5 | ||||
| 
 | ||||
| test-suite tests | ||||
|   type:     exitcode-stdio-1.0 | ||||
| @ -128,7 +135,6 @@ test-suite tests | ||||
|                , filepath | ||||
|                , HUnit | ||||
|                , mtl | ||||
|                , old-locale | ||||
|                , old-time | ||||
|                , parsec >= 3 | ||||
|                , regex-tdfa | ||||
| @ -137,10 +143,13 @@ test-suite tests | ||||
|                , split | ||||
|                , test-framework | ||||
|                , test-framework-hunit | ||||
|                , time | ||||
|                , transformers | ||||
|   if impl(ghc >= 7.4) | ||||
|     build-depends: pretty-show >= 1.6.4 | ||||
|   if flag(old-locale) | ||||
|     build-depends: time < 1.5, old-locale | ||||
|   else | ||||
|     build-depends: time >= 1.5 | ||||
| 
 | ||||
| -- cf http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.html | ||||
| 
 | ||||
|  | ||||
| @ -110,6 +110,11 @@ flag library-only | ||||
|     Description:   Build for use with "yesod devel" | ||||
|     Default:       False | ||||
| 
 | ||||
| flag old-locale | ||||
|   description: A compatibility flag, set automatically by cabal. | ||||
|                If false then depend on time >= 1.5,  | ||||
|                if true then depend on time < 1.5 together with old-locale. | ||||
|   default: False | ||||
| 
 | ||||
| library | ||||
|     cpp-options:   -DVERSION="0.24.98" | ||||
| @ -171,14 +176,12 @@ library | ||||
|                    , HUnit | ||||
|                    , network-conduit | ||||
|                    , conduit-extra | ||||
|                    , old-locale | ||||
|                    , parsec               >= 3 | ||||
|                    , regexpr              >= 0.5.1 | ||||
|                    , safe                 >= 0.2 | ||||
|                    , shakespeare          >= 2.0 | ||||
|                    , template-haskell | ||||
|                    , text | ||||
|                    , time | ||||
|                    , transformers | ||||
|                    , wai | ||||
|                    , wai-extra | ||||
| @ -194,6 +197,10 @@ library | ||||
|                    -- , fsnotify | ||||
|                    -- , hsdev | ||||
|                    -- , mtl | ||||
|   if flag(old-locale) | ||||
|     build-depends: time < 1.5, old-locale | ||||
|   else | ||||
|     build-depends: time >= 1.5 | ||||
| 
 | ||||
| 
 | ||||
| executable         hledger-web | ||||
| @ -243,14 +250,12 @@ executable         hledger-web | ||||
|                    , HUnit | ||||
|                    , network-conduit | ||||
|                    , conduit-extra | ||||
|                    , old-locale | ||||
|                    , parsec               >= 3 | ||||
|                    , regexpr              >= 0.5.1 | ||||
|                    , safe                 >= 0.2 | ||||
|                    , shakespeare          >= 2.0 && < 2.1 | ||||
|                    , template-haskell | ||||
|                    , text | ||||
|                    , time | ||||
|                    , transformers | ||||
|                    , wai | ||||
|                    , wai-extra | ||||
| @ -266,6 +271,10 @@ executable         hledger-web | ||||
|                    -- , fsnotify | ||||
|                    -- , hsdev | ||||
|                    -- , mtl | ||||
|   if flag(old-locale) | ||||
|     build-depends: time < 1.5, old-locale | ||||
|   else | ||||
|     build-depends: time >= 1.5 | ||||
| 
 | ||||
| test-suite test | ||||
|     type:              exitcode-stdio-1.0 | ||||
|  | ||||
| @ -45,6 +45,12 @@ flag curses | ||||
|     Description:   On POSIX systems, enable curses support for auto-detecting terminal width. | ||||
|     Default:       True | ||||
| 
 | ||||
| flag old-locale | ||||
|   description: A compatibility flag, set automatically by cabal. | ||||
|                If false then depend on time >= 1.5,  | ||||
|                if true then depend on time < 1.5 together with old-locale. | ||||
|   default: False | ||||
| 
 | ||||
| 
 | ||||
| library | ||||
|   cpp-options: -DVERSION="0.24.98" | ||||
| @ -81,7 +87,6 @@ library | ||||
|                  ,haskeline >= 0.6 && <= 0.8 | ||||
|                  ,HUnit | ||||
|                  ,mtl | ||||
|                  ,old-locale | ||||
|                  ,old-time | ||||
|                  ,parsec >= 3 | ||||
|                  ,process | ||||
| @ -101,9 +106,12 @@ library | ||||
|                  ,split >= 0.1 && < 0.3 | ||||
|                  ,text >= 0.11 | ||||
|                  ,tabular >= 0.2 && < 0.3 | ||||
|                  ,time | ||||
|                  ,utf8-string >= 0.3.5 && < 1.1 | ||||
|                  ,wizards == 1.0.* | ||||
|   if flag(old-locale) | ||||
|     build-depends: time < 1.5, old-locale | ||||
|   else | ||||
|     build-depends: time >= 1.5 | ||||
|   if impl(ghc >= 7.4) | ||||
|     build-depends: pretty-show >= 1.6.4 | ||||
|   if !os(windows) && flag(curses) | ||||
| @ -132,7 +140,6 @@ executable hledger | ||||
|                  ,haskeline >= 0.6 && <= 0.8 | ||||
|                  ,HUnit | ||||
|                  ,mtl | ||||
|                  ,old-locale | ||||
|                  ,old-time | ||||
|                  ,parsec >= 3 | ||||
|                  ,process | ||||
| @ -144,9 +151,12 @@ executable hledger | ||||
|                  ,split >= 0.1 && < 0.3 | ||||
|                  ,tabular >= 0.2 && < 0.3 | ||||
|                  ,text >= 0.11 | ||||
|                  ,time | ||||
|                  ,utf8-string >= 0.3.5 && < 1.1 | ||||
|                  ,wizards == 1.0.* | ||||
|   if flag(old-locale) | ||||
|     build-depends: time < 1.5, old-locale | ||||
|   else | ||||
|     build-depends: time >= 1.5 | ||||
|   if impl(ghc >= 7.4) | ||||
|     build-depends: pretty-show >= 1.6.4 | ||||
| 
 | ||||
| @ -171,7 +181,6 @@ test-suite tests | ||||
|                , haskeline | ||||
|                , HUnit | ||||
|                , mtl | ||||
|                , old-locale | ||||
|                , old-time | ||||
|                , parsec >= 3 | ||||
|                , process | ||||
| @ -185,9 +194,12 @@ test-suite tests | ||||
|                , test-framework | ||||
|                , test-framework-hunit | ||||
|                , text | ||||
|                , time | ||||
|                , transformers | ||||
|                , wizards == 1.0.* | ||||
|   if flag(old-locale) | ||||
|     build-depends: time < 1.5, old-locale | ||||
|   else | ||||
|     build-depends: time >= 1.5 | ||||
|   if impl(ghc >= 7.4) | ||||
|     build-depends: pretty-show >= 1.6.4 | ||||
| 
 | ||||
| @ -203,11 +215,13 @@ benchmark bench | ||||
|   build-depends:    hledger-lib, | ||||
|                     hledger, | ||||
|                     base >= 4.3 && < 5, | ||||
|                     old-locale, | ||||
|                     time, | ||||
|                     html, | ||||
|                     tabular >= 0.2 && < 0.3, | ||||
|                     process, | ||||
|                     filepath, | ||||
|                     directory | ||||
|   if flag(old-locale) | ||||
|     build-depends: time < 1.5, old-locale | ||||
|   else | ||||
|     build-depends: time >= 1.5 | ||||
|    | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user