diff options
author | Mark Wright <gienah@gentoo.org> | 2015-04-04 05:34:22 +0000 |
---|---|---|
committer | Mark Wright <gienah@gentoo.org> | 2015-04-04 05:34:22 +0000 |
commit | 8ba891b60c86b5dc575055b6182d4b628f3b8457 (patch) | |
tree | dac738dfa8b63d5bdefdf1a98d861e330d56e82f /dev-haskell/happstack-server | |
parent | add missing Xinerama dep (bug #545422) (diff) | |
download | gentoo-2-8ba891b60c86b5dc575055b6182d4b628f3b8457.tar.gz gentoo-2-8ba891b60c86b5dc575055b6182d4b628f3b8457.tar.bz2 gentoo-2-8ba891b60c86b5dc575055b6182d4b628f3b8457.zip |
Bump happstack-server to 7.4.2, patch for ghc 7.10.1
(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 618E971F)
Diffstat (limited to 'dev-haskell/happstack-server')
4 files changed, 354 insertions, 2 deletions
diff --git a/dev-haskell/happstack-server/ChangeLog b/dev-haskell/happstack-server/ChangeLog index 9635fbcd873f..0fca2b3e374d 100644 --- a/dev-haskell/happstack-server/ChangeLog +++ b/dev-haskell/happstack-server/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for dev-haskell/happstack-server -# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-haskell/happstack-server/ChangeLog,v 1.5 2014/12/14 09:22:06 gienah Exp $ +# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-haskell/happstack-server/ChangeLog,v 1.6 2015/04/04 05:34:22 gienah Exp $ + +*happstack-server-7.4.2 (04 Apr 2015) + + 04 Apr 2015; Mark Wright <gienah@gentoo.org> + +files/happstack-server-7.4.2-ghc-7.10.patch, + +files/happstack-server-7.4.2-time-1.5.patch, +happstack-server-7.4.2.ebuild: + Bump happstack-server to 7.4.2, patch for ghc 7.10.1 *happstack-server-7.3.9 (14 Dec 2014) diff --git a/dev-haskell/happstack-server/files/happstack-server-7.4.2-ghc-7.10.patch b/dev-haskell/happstack-server/files/happstack-server-7.4.2-ghc-7.10.patch new file mode 100644 index 000000000000..42d95ff25072 --- /dev/null +++ b/dev-haskell/happstack-server/files/happstack-server-7.4.2-ghc-7.10.patch @@ -0,0 +1,58 @@ +--- happstack-server-7.4.2-orig/src/Happstack/Server/Internal/Monads.hs 2015-03-24 03:34:11.000000000 +1100 ++++ happstack-server-7.4.2/src/Happstack/Server/Internal/Monads.hs 2015-04-04 15:20:58.273008986 +1100 +@@ -173,7 +173,7 @@ + instance MonadTrans (ServerPartT) where + lift m = withRequest (\_ -> lift m) + +-instance (Monad m) => Monoid (ServerPartT m a) where ++instance (Monad m, MonadPlus m) => Monoid (ServerPartT m a) where + mempty = mzero + mappend = mplus + +@@ -486,7 +486,7 @@ + instance MonadTrans WebT where + lift = WebT . lift . lift . lift + +-instance (Monad m) => MonadPlus (WebT m) where ++instance (Monad m, MonadPlus m) => MonadPlus (WebT m) where + -- | Aborts a computation. + -- + -- This is primarily useful because 'msum' will take an array of +@@ -505,7 +505,7 @@ + lft (Left r, _) = Left r + lft (Right a, f) = Right (a, f) + +-instance (Monad m) => Monoid (WebT m a) where ++instance (Monad m, MonadPlus m) => Monoid (WebT m a) where + mempty = mzero + mappend = mplus + +@@ -561,7 +561,7 @@ + liftWebT (Just (Right x,f)) = pass (return x)>>= (\a -> return $ Just (Right a,f)) + + -- | Deprecated: use 'msum'. +-multi :: Monad m => [ServerPartT m a] -> ServerPartT m a ++multi :: (Monad m, MonadPlus m) => [ServerPartT m a] -> ServerPartT m a + multi = msum + {-# DEPRECATED multi "Use msum instead" #-} + +--- happstack-server-7.4.2-orig/src/Happstack/Server/RqData.hs 2015-03-24 03:34:11.000000000 +1100 ++++ happstack-server-7.4.2/src/Happstack/Server/RqData.hs 2015-04-04 15:25:15.454830906 +1100 +@@ -92,7 +92,7 @@ + newtype ReaderError r e a = ReaderError { unReaderError :: ReaderT r (Either e) a } + deriving (Functor, Monad, MonadPlus) + +-instance (Error e) => MonadReader r (ReaderError r e) where ++instance (Error e, Monoid e) => MonadReader r (ReaderError r e) where + ask = ReaderError ask + local f m = ReaderError $ local f (unReaderError m) + +@@ -157,7 +157,7 @@ + rqDataError e = mapRqData ((Left e) `apEither`) (return ()) + + -- instance (MonadPlus m, MonadIO m, ServerMonad m) => (HasRqData m) where +-instance (MonadIO m) => HasRqData (ServerPartT m) where ++instance (MonadIO m, MonadPlus m) => HasRqData (ServerPartT m) where + askRqEnv = + do rq <- askRq + mbi <- liftIO $ if ((rqMethod rq == POST) || (rqMethod rq == PUT)) && (isDecodable (ctype rq)) diff --git a/dev-haskell/happstack-server/files/happstack-server-7.4.2-time-1.5.patch b/dev-haskell/happstack-server/files/happstack-server-7.4.2-time-1.5.patch new file mode 100644 index 000000000000..a536ba0b2f92 --- /dev/null +++ b/dev-haskell/happstack-server/files/happstack-server-7.4.2-time-1.5.patch @@ -0,0 +1,225 @@ +commit 65b7c1c907cc7a60b088ff8de43edd1e1f1d5165 +Author: Tenor Biel <tenorbiel@gmail.com> +Date: Mon Mar 30 02:46:58 2015 -0500 + + add version handlers for time-1.5.* and time-1.4.* + +diff --git a/src/Happstack/Server/FileServe/BuildingBlocks.hs b/src/Happstack/Server/FileServe/BuildingBlocks.hs +index eda3727..9650305 100644 +--- a/src/Happstack/Server/FileServe/BuildingBlocks.hs ++++ b/src/Happstack/Server/FileServe/BuildingBlocks.hs +@@ -65,7 +65,6 @@ import Data.List (sort) + import Data.Maybe (fromMaybe) + import Data.Map (Map) + import qualified Data.Map as Map +-import Data.Time (UTCTime, formatTime) + import Data.Time.Compat (toUTCTime) + import Filesystem.Path.CurrentOS (commonPrefix, encodeString, decodeString, collapse, append) + import Happstack.Server.Monads (ServerMonad(askRq), FilterMonad, WebMonad) +@@ -74,12 +73,18 @@ import Happstack.Server.Types (Length(ContentLength), Request(rqPaths, rqU + import System.Directory (doesDirectoryExist, doesFileExist, getDirectoryContents, getModificationTime) + import System.FilePath ((</>), addTrailingPathSeparator, hasDrive, isPathSeparator, joinPath, takeExtension, isValid) + import System.IO (IOMode(ReadMode), hFileSize, hClose, openBinaryFile, withBinaryFile) +-import System.Locale (defaultTimeLocale) + import System.Log.Logger (Priority(DEBUG), logM) + import Text.Blaze.Html ((!)) + import qualified Text.Blaze.Html5 as H + import qualified Text.Blaze.Html5.Attributes as A + ++#if MIN_VERSION_time(1,5,0) ++import Data.Time (UTCTime, formatTime, defaultTimeLocale) ++#else ++import System.Locale (defaultTimeLocale) ++import Data.Time (UTCTime, formatTime) ++#endif ++ + -- * Mime-Type / Content-Type + + -- |a 'Map' from file extensions to content-types +diff --git a/src/Happstack/Server/Internal/Clock.hs b/src/Happstack/Server/Internal/Clock.hs +index 6a16b9b..7d58877 100644 +--- a/src/Happstack/Server/Internal/Clock.hs ++++ b/src/Happstack/Server/Internal/Clock.hs +@@ -12,9 +12,14 @@ import Control.Monad + import Data.IORef + import Data.Time.Clock (UTCTime) + import Data.Time.Clock.POSIX (POSIXTime, getPOSIXTime, posixSecondsToUTCTime) +-import Data.Time.Format (formatTime) + import System.IO.Unsafe +-import System.Locale ++ ++#if MIN_VERSION_time(1,5,0) ++import Data.Time.Format (formatTime, defaultTimeLocale) ++#else ++import Data.Time.Format (formatTime) ++import System.Locale (defaultTimeLocale) ++#endif + + import qualified Data.ByteString.Char8 as B + +@@ -57,4 +62,4 @@ getApproximatePOSIXTime :: IO POSIXTime + getApproximatePOSIXTime = readIORef (cachedPOSIXTime clock) + + getApproximateUTCTime :: IO UTCTime +-getApproximateUTCTime = posixSecondsToUTCTime <$> getApproximatePOSIXTime +\ No newline at end of file ++getApproximateUTCTime = posixSecondsToUTCTime <$> getApproximatePOSIXTime +diff --git a/src/Happstack/Server/Internal/Cookie.hs b/src/Happstack/Server/Internal/Cookie.hs +index b65edbd..ea76345 100644 +--- a/src/Happstack/Server/Internal/Cookie.hs ++++ b/src/Happstack/Server/Internal/Cookie.hs +@@ -23,10 +23,15 @@ import Data.Data (Data, Typeable) + import Data.List ((\\), intersperse) + import Data.Time.Clock (UTCTime, addUTCTime, diffUTCTime) + import Data.Time.Clock.POSIX (posixSecondsToUTCTime) +-import Data.Time.Format (formatTime) + import Happstack.Server.Internal.Clock (getApproximateUTCTime) + import Text.ParserCombinators.Parsec hiding (token) +-import System.Locale (defaultTimeLocale) ++ ++#if MIN_VERSION_time(1,5,0) ++import Data.Time.Format (formatTime, defaultTimeLocale) ++#else ++import Data.Time.Format (formatTime) ++import System.Locale (defaultTimeLocale) ++#endif + + -- | a type for HTTP cookies. Usually created using 'mkCookie'. + data Cookie = Cookie +diff --git a/src/Happstack/Server/Internal/LogFormat.hs b/src/Happstack/Server/Internal/LogFormat.hs +index 5561940..c85ff81 100644 +--- a/src/Happstack/Server/Internal/LogFormat.hs ++++ b/src/Happstack/Server/Internal/LogFormat.hs +@@ -3,8 +3,12 @@ module Happstack.Server.Internal.LogFormat + , formatRequestCombined + ) where + +-import System.Locale (defaultTimeLocale) ++#if MIN_VERSION_time(1,5,0) ++import Data.Time.Format (FormatTime(..), formatTime, defaultTimeLocale) ++#else + import Data.Time.Format (FormatTime(..), formatTime) ++import System.Locale (defaultTimeLocale) ++#endif + + -- | Format the time as describe in the Apache combined log format. + -- http://httpd.apache.org/docs/2.2/logs.html#combined +diff --git a/src/Happstack/Server/Response.hs b/src/Happstack/Server/Response.hs +index 7ae52b3..23f61b0 100644 +--- a/src/Happstack/Server/Response.hs ++++ b/src/Happstack/Server/Response.hs +@@ -1,6 +1,6 @@ + {-# LANGUAGE FlexibleContexts, FlexibleInstances, TypeSynonymInstances, ScopedTypeVariables #-} + -- | Functions and classes related to generating a 'Response' and setting the response code. For detailed instruction see the Happstack Crash Course: <http://happstack.com/docs/crashcourse/HelloWorld.html#response_code> +-module Happstack.Server.Response ++module Happstack.Server.Response + ( -- * Converting values to a 'Response' + ToMessage(..) + , flatten +@@ -34,24 +34,29 @@ import qualified Data.Text as T + import qualified Data.Text.Encoding as T + import qualified Data.Text.Lazy as LT + import qualified Data.Text.Lazy.Encoding as LT +-import Data.Time (UTCTime, formatTime) + import Happstack.Server.Internal.Monads (FilterMonad(composeFilter)) + import Happstack.Server.Types (Response(..), Request(..), nullRsFlags, getHeader, noContentLength, redirect, result, setHeader, setHeaderBS) + import Happstack.Server.SURI (ToSURI) +-import System.Locale (defaultTimeLocale) + import qualified Text.Blaze.Html as Blaze + import qualified Text.Blaze.Html.Renderer.Utf8 as Blaze + import Text.Html (Html, renderHtml) + import qualified Text.XHtml as XHtml (Html, renderHtml) + ++#if MIN_VERSION_time(1,5,0) ++import Data.Time (UTCTime, formatTime, defaultTimeLocale) ++#else ++import Data.Time (UTCTime, formatTime) ++import System.Locale (defaultTimeLocale) ++#endif ++ + -- | A low-level function to build a 'Response' from a content-type + -- and a 'ByteString'. + -- + -- Creates a 'Response' in a manner similar to the 'ToMessage' class, + -- but without requiring an instance declaration. +--- ++-- + -- example: +--- ++-- + -- > import Data.ByteString.Char8 as C + -- > import Data.ByteString.Lazy.Char8 as L + -- > import Happstack.Server +@@ -85,7 +90,7 @@ toResponseBS contentType message = + -- + -- > main = serve Nothing $ toResponse "hello, world!" + -- +--- Minimal definition: 'toMessage' (and usually 'toContentType'). ++-- Minimal definition: 'toMessage' (and usually 'toContentType'). + class ToMessage a where + toContentType :: a -> B.ByteString + toContentType _ = B.pack "text/plain" +@@ -194,31 +199,31 @@ modifyResponse = composeFilter + -- + -- A filter for setting the response code. Generally you will use a + -- helper function like 'ok' or 'seeOther'. +--- ++-- + -- > main = simpleHTTP nullConf $ do setResponseCode 200 + -- > return "Everything is OK" +--- ++-- + -- see also: 'resp' +-setResponseCode :: FilterMonad Response m => ++setResponseCode :: FilterMonad Response m => + Int -- ^ response code + -> m () + setResponseCode code + = composeFilter $ \r -> r{rsCode = code} + + -- | Same as @'setResponseCode' status >> return val@. +--- ++-- + -- Use this if you want to set a response code that does not already +--- have a helper function. +--- ++-- have a helper function. ++-- + -- > main = simpleHTTP nullConf $ resp 200 "Everything is OK" +-resp :: (FilterMonad Response m) => ++resp :: (FilterMonad Response m) => + Int -- ^ response code + -> b -- ^ value to return + -> m b + resp status val = setResponseCode status >> return val + + -- | Respond with @200 OK@. +--- ++-- + -- > main = simpleHTTP nullConf $ ok "Everything is OK" + ok :: (FilterMonad Response m) => a -> m a + ok = resp 200 +@@ -239,7 +244,7 @@ movedPermanently uri res = do modifyResponse $ redirect 301 uri + return res + + -- | Respond with @302 Found@. +--- ++-- + -- You probably want 'seeOther'. This method is not in popular use anymore, and is generally treated like 303 by most user-agents anyway. + found :: (FilterMonad Response m, ToSURI uri) => uri -> res -> m res + found uri res = do modifyResponse $ redirect 302 uri +@@ -284,7 +289,7 @@ forbidden :: (FilterMonad Response m) => a -> m a + forbidden = resp 403 + + -- | Respond with @404 Not Found@. +--- ++-- + -- > main = simpleHTTP nullConf $ notFound "What you are looking for has not been found." + notFound :: (FilterMonad Response m) => a -> m a + notFound = resp 404 +@@ -324,4 +329,4 @@ prettyResponse res@SendFile{} = + showString "\nrsValidator = " . shows (rsValidator res). + showString "\nsfFilePath = " . shows (sfFilePath res) . + showString "\nsfOffset = " . shows (sfOffset res) . +- showString "\nsfCount = " $ show (sfCount res) ++ showString "\nsfCount = " $ show (sfCount res) diff --git a/dev-haskell/happstack-server/happstack-server-7.4.2.ebuild b/dev-haskell/happstack-server/happstack-server-7.4.2.ebuild new file mode 100644 index 000000000000..745cf880ea5a --- /dev/null +++ b/dev-haskell/happstack-server/happstack-server-7.4.2.ebuild @@ -0,0 +1,62 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-haskell/happstack-server/happstack-server-7.4.2.ebuild,v 1.1 2015/04/04 05:34:22 gienah Exp $ + +EAPI=5 + +# ebuild generated by hackport 0.4.4.9999 +#hackport: flags: +network_2_2_3 + +CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite" +inherit base haskell-cabal + +DESCRIPTION="Web related tools and services" +HOMEPAGE="http://happstack.com" +SRC_URI="mirror://hackage/packages/archive/${PN}/${PV}/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0/${PV}" +KEYWORDS="~amd64 ~x86" +IUSE="+network-uri +template_haskell" + +RDEPEND=">=dev-haskell/base64-bytestring-1.0:=[profile?] <dev-haskell/base64-bytestring-1.1:=[profile?] + >=dev-haskell/blaze-html-0.5:=[profile?] <dev-haskell/blaze-html-0.9:=[profile?] + dev-haskell/exceptions:=[profile?] + dev-haskell/extensible-exceptions:=[profile?] + >=dev-haskell/hslogger-1.0.2:=[profile?] + dev-haskell/html:=[profile?] + >=dev-haskell/monad-control-0.3:=[profile?] <dev-haskell/monad-control-1.1:=[profile?] + >=dev-haskell/mtl-2:=[profile?] <dev-haskell/mtl-2.3:=[profile?] + dev-haskell/old-locale:=[profile?] + <dev-haskell/parsec-4:=[profile?] + >=dev-haskell/sendfile-0.7.1:=[profile?] <dev-haskell/sendfile-0.8:=[profile?] + dev-haskell/syb:=[profile?] + >=dev-haskell/system-filepath-0.3.1:=[profile?] + >=dev-haskell/text-0.10:=[profile?] <dev-haskell/text-1.3:=[profile?] + >=dev-haskell/threads-0.5:=[profile?] + dev-haskell/time-compat:=[profile?] + >=dev-haskell/transformers-0.1.3:=[profile?] <dev-haskell/transformers-0.5:=[profile?] + >=dev-haskell/transformers-base-0.4:=[profile?] <dev-haskell/transformers-base-0.5:=[profile?] + >=dev-haskell/transformers-compat-0.3:=[profile?] <dev-haskell/transformers-compat-0.5:=[profile?] + >=dev-haskell/utf8-string-0.3.4:=[profile?] <dev-haskell/utf8-string-1.1:=[profile?] + dev-haskell/xhtml:=[profile?] + dev-haskell/zlib:=[profile?] + >=dev-lang/ghc-7.4.1:= + network-uri? ( >dev-haskell/network-2.6:=[profile?] <dev-haskell/network-2.7:=[profile?] + >=dev-haskell/network-uri-2.6:=[profile?] <dev-haskell/network-uri-2.7:=[profile?] ) + !network-uri? ( <dev-haskell/network-2.6:=[profile?] ) +" +DEPEND="${RDEPEND} + >=dev-haskell/cabal-1.8 + test? ( dev-haskell/hunit ) +" + +PATCHES=("${FILESDIR}/${PN}-7.4.2-time-1.5.patch" + "${FILESDIR}/${PN}-7.4.2-ghc-7.10.patch") + +src_configure() { + haskell-cabal_src_configure \ + $(cabal_flag network-uri network-uri) \ + --flag=network_2_2_3 \ + $(cabal_flag template_haskell template_haskell) +} |