From 8802472344cfe5cebdbccb258be22f571c6b2045 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Mon, 23 Apr 2012 14:14:23 +0300 Subject: [PATCH] yesod-auth: use blaze-html 0.5 --- yesod-auth/Yesod/Auth/GoogleEmail.hs | 5 +++++ yesod-auth/Yesod/Auth/OpenId.hs | 5 +++++ yesod-auth/yesod-auth.cabal | 13 ++++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/yesod-auth/Yesod/Auth/GoogleEmail.hs b/yesod-auth/Yesod/Auth/GoogleEmail.hs index e06e584f..74ce9d66 100644 --- a/yesod-auth/Yesod/Auth/GoogleEmail.hs +++ b/yesod-auth/Yesod/Auth/GoogleEmail.hs @@ -1,5 +1,6 @@ {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE CPP #-} -- | Use an email address as an identifier via Google's OpenID login system. -- -- This backend will not use the OpenID identifier at all. It only uses OpenID @@ -20,7 +21,11 @@ import qualified Web.Authenticate.OpenId as OpenId import Yesod.Handler import Yesod.Widget (whamlet) import Yesod.Request +#if MIN_VERSION_blaze_html(0, 5, 0) +import Text.Blaze.Html (toHtml) +#else import Text.Blaze (toHtml) +#endif import Data.Text (Text) import qualified Yesod.Auth.Message as Msg import qualified Data.Text as T diff --git a/yesod-auth/Yesod/Auth/OpenId.hs b/yesod-auth/Yesod/Auth/OpenId.hs index a93840a8..13da0533 100644 --- a/yesod-auth/Yesod/Auth/OpenId.hs +++ b/yesod-auth/Yesod/Auth/OpenId.hs @@ -1,5 +1,6 @@ {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE CPP #-} module Yesod.Auth.OpenId ( authOpenId , authOpenIdExtended @@ -16,7 +17,11 @@ import Yesod.Handler import Yesod.Widget (toWidget, whamlet) import Yesod.Request import Text.Cassius (cassius) +#if MIN_VERSION_blaze_html(0, 5, 0) +import Text.Blaze.Html (toHtml) +#else import Text.Blaze (toHtml) +#endif import Data.Text (Text, isPrefixOf) import qualified Yesod.Auth.Message as Msg import Control.Exception.Lifted (SomeException, try) diff --git a/yesod-auth/yesod-auth.cabal b/yesod-auth/yesod-auth.cabal index 61c58844..d19bb5ca 100644 --- a/yesod-auth/yesod-auth.cabal +++ b/yesod-auth/yesod-auth.cabal @@ -14,6 +14,10 @@ description: Authentication for Yesod. flag ghc7 +flag blaze_html_0_5 + description: use blaze-html 0.5 and blaze-markup 0.5 + default: False + library build-depends: base >= 4 && < 5 , authenticate >= 1.2.1 && < 1.3 @@ -25,7 +29,6 @@ library , random >= 1.0.0.2 && < 1.1 , text >= 0.7 && < 0.12 , mime-mail >= 0.3 && < 0.5 - , blaze-html >= 0.4.1.3 && < 0.5 , yesod-persistent >= 1.0 && < 1.1 , hamlet >= 1.0 && < 1.1 , shakespeare-css >= 1.0 && < 1.1 @@ -42,6 +45,14 @@ library , pwstore-fast >= 2.2 && < 3 , lifted-base >= 0.1 && < 0.2 + if flag(blaze_html_0_5) + build-depends: + blaze-html >= 0.5 && < 0.6 + , blaze-markup >= 0.5.1 && < 0.6 + else + build-depends: + blaze-html >= 0.4 && < 0.5 + exposed-modules: Yesod.Auth Yesod.Auth.BrowserId Yesod.Auth.Dummy