diff --git a/Yesod.hs b/Yesod.hs index 6230a186..ef68df43 100644 --- a/Yesod.hs +++ b/Yesod.hs @@ -1,4 +1,5 @@ {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE CPP #-} -- | This module simply re-exports from other modules for your convenience. module Yesod ( -- * Re-exports from yesod-core @@ -59,7 +60,9 @@ import Yesod.Json import Yesod.Persist import Network.Wai (Application) import Network.Wai.Middleware.Debug +#if !GHC7 import Network.Wai.Handler.DevelServer (runQuit) +#endif import Control.Monad.Trans.Class (lift) import Control.Monad.IO.Class (liftIO) import Control.Monad.IO.Peel (MonadPeelIO) @@ -100,6 +103,9 @@ develServer :: Int -- ^ port number -> String -- ^ module name holding the code -> String -- ^ name of function providing a with-application -> 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 mapM_ putStrLn [ "Starting your server process. Code changes will be automatically" @@ -108,6 +114,7 @@ develServer port modu func = do , "" ] runQuit port modu func determineHamletDeps +#endif data TempType = Hamlet | Cassius | Julius | Widget deriving Show diff --git a/scaffold/Model_hs.cg b/scaffold/Model_hs.cg index d97260a5..4c31eee7 100644 --- a/scaffold/Model_hs.cg +++ b/scaffold/Model_hs.cg @@ -1,4 +1,4 @@ -{-# LANGUAGE QuasiQuotes, TypeFamilies, GeneralizedNewtypeDeriving #-} +{-# LANGUAGE QuasiQuotes, TypeFamilies, GeneralizedNewtypeDeriving, TemplateHaskell #-} module Model where import Yesod diff --git a/scaffold/cabal.cg b/scaffold/cabal.cg index e168a1a9..179849aa 100644 --- a/scaffold/cabal.cg +++ b/scaffold/cabal.cg @@ -51,8 +51,6 @@ executable ~project~-production executable ~project~-devel if flag(production) Buildable: False - else - build-depends: wai-handler-devel >= 0.2 && < 0.3 main-is: devel-server.hs ghc-options: -Wall -O2 -threaded diff --git a/yesod.cabal b/yesod.cabal index 20c8c2d5..2cf68f7a 100644 --- a/yesod.cabal +++ b/yesod.cabal @@ -16,13 +16,16 @@ build-type: Simple homepage: http://docs.yesodweb.com/ extra-source-files: scaffold/*.cg -flag test - description: Build the executable to run unit tests - default: False +flag ghc7 library - build-depends: base >= 4 && < 5 - , yesod-core >= 0.7 && < 0.8 + if flag(ghc7) + 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-json >= 0.0 && < 0.1 , yesod-persistent >= 0.0 && < 0.1 @@ -36,12 +39,16 @@ library , warp >= 0.3 && < 0.4 , mime-mail >= 0.1 && < 0.2 , hjsmin >= 0.0.12 && < 0.1 - , wai-handler-devel >= 0.2 && < 0.3 , attoparsec-text >= 0.8 && < 0.9 exposed-modules: Yesod ghc-options: -Wall 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 , text >= 0.11 && < 0.12 , bytestring >= 0.9 && < 0.10 @@ -52,6 +59,8 @@ executable yesod main-is: scaffold.hs other-modules: CodeGen extensions: TemplateHaskell + if flag(ghc7) + cpp-options: -DGHC7 source-repository head type: git