GHC7 fixes
This commit is contained in:
parent
fb3e6fa73f
commit
b2fbdb4f65
7
Yesod.hs
7
Yesod.hs
@ -1,4 +1,5 @@
|
|||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
{-# LANGUAGE CPP #-}
|
||||||
-- | This module simply re-exports from other modules for your convenience.
|
-- | This module simply re-exports from other modules for your convenience.
|
||||||
module Yesod
|
module Yesod
|
||||||
( -- * Re-exports from yesod-core
|
( -- * Re-exports from yesod-core
|
||||||
@ -59,7 +60,9 @@ import Yesod.Json
|
|||||||
import Yesod.Persist
|
import Yesod.Persist
|
||||||
import Network.Wai (Application)
|
import Network.Wai (Application)
|
||||||
import Network.Wai.Middleware.Debug
|
import Network.Wai.Middleware.Debug
|
||||||
|
#if !GHC7
|
||||||
import Network.Wai.Handler.DevelServer (runQuit)
|
import Network.Wai.Handler.DevelServer (runQuit)
|
||||||
|
#endif
|
||||||
import Control.Monad.Trans.Class (lift)
|
import Control.Monad.Trans.Class (lift)
|
||||||
import Control.Monad.IO.Class (liftIO)
|
import Control.Monad.IO.Class (liftIO)
|
||||||
import Control.Monad.IO.Peel (MonadPeelIO)
|
import Control.Monad.IO.Peel (MonadPeelIO)
|
||||||
@ -100,6 +103,9 @@ develServer :: Int -- ^ port number
|
|||||||
-> String -- ^ module name holding the code
|
-> String -- ^ module name holding the code
|
||||||
-> String -- ^ name of function providing a with-application
|
-> String -- ^ name of function providing a with-application
|
||||||
-> IO ()
|
-> IO ()
|
||||||
|
#if GHC7
|
||||||
|
develServer = error "Unfortunately, the hint package has not yet been ported to GHC 7, and therefore wai-handler-devel has not either. Once this situation is addressed, a new version of Yesod will be released."
|
||||||
|
#else
|
||||||
develServer port modu func = do
|
develServer port modu func = do
|
||||||
mapM_ putStrLn
|
mapM_ putStrLn
|
||||||
[ "Starting your server process. Code changes will be automatically"
|
[ "Starting your server process. Code changes will be automatically"
|
||||||
@ -108,6 +114,7 @@ develServer port modu func = do
|
|||||||
, ""
|
, ""
|
||||||
]
|
]
|
||||||
runQuit port modu func determineHamletDeps
|
runQuit port modu func determineHamletDeps
|
||||||
|
#endif
|
||||||
|
|
||||||
data TempType = Hamlet | Cassius | Julius | Widget
|
data TempType = Hamlet | Cassius | Julius | Widget
|
||||||
deriving Show
|
deriving Show
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{-# LANGUAGE QuasiQuotes, TypeFamilies, GeneralizedNewtypeDeriving #-}
|
{-# LANGUAGE QuasiQuotes, TypeFamilies, GeneralizedNewtypeDeriving, TemplateHaskell #-}
|
||||||
module Model where
|
module Model where
|
||||||
|
|
||||||
import Yesod
|
import Yesod
|
||||||
|
|||||||
@ -51,8 +51,6 @@ executable ~project~-production
|
|||||||
executable ~project~-devel
|
executable ~project~-devel
|
||||||
if flag(production)
|
if flag(production)
|
||||||
Buildable: False
|
Buildable: False
|
||||||
else
|
|
||||||
build-depends: wai-handler-devel >= 0.2 && < 0.3
|
|
||||||
main-is: devel-server.hs
|
main-is: devel-server.hs
|
||||||
ghc-options: -Wall -O2 -threaded
|
ghc-options: -Wall -O2 -threaded
|
||||||
|
|
||||||
|
|||||||
21
yesod.cabal
21
yesod.cabal
@ -16,13 +16,16 @@ build-type: Simple
|
|||||||
homepage: http://docs.yesodweb.com/
|
homepage: http://docs.yesodweb.com/
|
||||||
extra-source-files: scaffold/*.cg
|
extra-source-files: scaffold/*.cg
|
||||||
|
|
||||||
flag test
|
flag ghc7
|
||||||
description: Build the executable to run unit tests
|
|
||||||
default: False
|
|
||||||
|
|
||||||
library
|
library
|
||||||
build-depends: base >= 4 && < 5
|
if flag(ghc7)
|
||||||
, yesod-core >= 0.7 && < 0.8
|
build-depends: base >= 4.3 && < 5
|
||||||
|
cpp-options: -DGHC7
|
||||||
|
else
|
||||||
|
build-depends: base >= 4 && < 4.3
|
||||||
|
, wai-handler-devel >= 0.2 && < 0.3
|
||||||
|
build-depends: yesod-core >= 0.7 && < 0.8
|
||||||
, yesod-auth >= 0.3 && < 0.4
|
, yesod-auth >= 0.3 && < 0.4
|
||||||
, yesod-json >= 0.0 && < 0.1
|
, yesod-json >= 0.0 && < 0.1
|
||||||
, yesod-persistent >= 0.0 && < 0.1
|
, yesod-persistent >= 0.0 && < 0.1
|
||||||
@ -36,12 +39,16 @@ library
|
|||||||
, warp >= 0.3 && < 0.4
|
, warp >= 0.3 && < 0.4
|
||||||
, mime-mail >= 0.1 && < 0.2
|
, mime-mail >= 0.1 && < 0.2
|
||||||
, hjsmin >= 0.0.12 && < 0.1
|
, hjsmin >= 0.0.12 && < 0.1
|
||||||
, wai-handler-devel >= 0.2 && < 0.3
|
|
||||||
, attoparsec-text >= 0.8 && < 0.9
|
, attoparsec-text >= 0.8 && < 0.9
|
||||||
exposed-modules: Yesod
|
exposed-modules: Yesod
|
||||||
ghc-options: -Wall
|
ghc-options: -Wall
|
||||||
|
|
||||||
executable yesod
|
executable yesod
|
||||||
|
if flag(ghc7)
|
||||||
|
build-depends: base >= 4.3 && < 5
|
||||||
|
cpp-options: -DGHC7
|
||||||
|
else
|
||||||
|
build-depends: base >= 4 && < 4.3
|
||||||
build-depends: parsec >= 2.1 && < 4
|
build-depends: parsec >= 2.1 && < 4
|
||||||
, text >= 0.11 && < 0.12
|
, text >= 0.11 && < 0.12
|
||||||
, bytestring >= 0.9 && < 0.10
|
, bytestring >= 0.9 && < 0.10
|
||||||
@ -52,6 +59,8 @@ executable yesod
|
|||||||
main-is: scaffold.hs
|
main-is: scaffold.hs
|
||||||
other-modules: CodeGen
|
other-modules: CodeGen
|
||||||
extensions: TemplateHaskell
|
extensions: TemplateHaskell
|
||||||
|
if flag(ghc7)
|
||||||
|
cpp-options: -DGHC7
|
||||||
|
|
||||||
source-repository head
|
source-repository head
|
||||||
type: git
|
type: git
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user