[Git][haskell-team/DHG_packages][master] gitit: Patch for newer dependencies
Ilias Tsitsimpis (@iliastsi)
gitlab at salsa.debian.org
Tue Aug 23 13:41:47 BST 2022
Ilias Tsitsimpis pushed to branch master at Debian Haskell Group / DHG_packages
Commits:
3cf10902 by Ilias Tsitsimpis at 2022-08-23T15:35:18+03:00
gitit: Patch for newer dependencies
- - - - -
7 changed files:
- p/gitit/debian/changelog
- p/gitit/debian/control
- p/gitit/debian/patches/clean-cabal-file.patch
- p/gitit/debian/patches/jquery.patch
- + p/gitit/debian/patches/newer-hoauth2
- + p/gitit/debian/patches/newer-pandoc
- p/gitit/debian/patches/series
Changes:
=====================================
p/gitit/debian/changelog
=====================================
@@ -1,8 +1,9 @@
-gitit (0.15.1.0+dfsg-2) UNRELEASED; urgency=medium
+gitit (0.15.1.0+dfsg-2) unstable; urgency=medium
* Declare compliance with Debian policy 4.6.1
+ * Patch for newer dependencies
- -- Ilias Tsitsimpis <iliastsi at debian.org> Tue, 28 Jun 2022 15:31:59 +0300
+ -- Ilias Tsitsimpis <iliastsi at debian.org> Fri, 12 Aug 2022 17:03:10 +0300
gitit (0.15.1.0+dfsg-1) unstable; urgency=medium
=====================================
p/gitit/debian/control
=====================================
@@ -45,8 +45,8 @@ Build-Depends: debhelper (>= 10),
libghc-happstack-server-dev (>= 7.5),
libghc-happstack-server-dev (<< 7.8),
libghc-happstack-server-prof,
- libghc-hoauth2-dev (>= 1.3.0),
- libghc-hoauth2-dev (<< 1.17),
+ libghc-hoauth2-dev (>= 2.3.0),
+ libghc-hoauth2-dev (<< 2.4),
libghc-hoauth2-prof,
libghc-hslogger-dev (>= 1),
libghc-hslogger-prof,
@@ -72,7 +72,7 @@ Build-Depends: debhelper (>= 10),
libghc-old-time-dev,
libghc-old-time-prof,
libghc-pandoc-dev (>= 2.9),
- libghc-pandoc-dev (<< 2.17),
+ libghc-pandoc-dev (<< 2.18),
libghc-pandoc-prof,
libghc-pandoc-types-dev (>= 1.20),
libghc-pandoc-types-dev (<< 1.23),
=====================================
p/gitit/debian/patches/clean-cabal-file.patch
=====================================
@@ -6,7 +6,7 @@ Index: b/gitit.cabal
===================================================================
--- a/gitit.cabal
+++ b/gitit.cabal
-@@ -39,21 +39,14 @@ author: John MacFarlane
+@@ -37,21 +37,14 @@ author: John MacFarlane
maintainer: jgm at berkeley.edu
bug-reports: http://github.com/jgm/gitit/issues
stability: experimental
=====================================
p/gitit/debian/patches/jquery.patch
=====================================
@@ -17,7 +17,7 @@ Index: b/src/Network/Gitit/Layout.hs
===================================================================
--- a/src/Network/Gitit/Layout.hs
+++ b/src/Network/Gitit/Layout.hs
-@@ -78,7 +78,7 @@ filledPageTemplate base' cfg layout html
+@@ -77,7 +77,7 @@ filledPageTemplate base' cfg layout html
'h':'t':'t':'p':_ -> x
_ -> base' ++ "/js/" ++ x
=====================================
p/gitit/debian/patches/newer-hoauth2
=====================================
@@ -0,0 +1,151 @@
+From fd534c0155eef1790500c834e612ab22cf9b67b6 Mon Sep 17 00:00:00 2001
+From: sternenseemann <sternenseemann at systemli.org>
+Date: Sat, 12 Mar 2022 14:26:44 +0100
+Subject: [PATCH] Adjust for hoauth2 >= 2.3.0
+
+hoauth2 is used by Stackage Nightly 2.3.0 and will thus be included in
+Stackage LTS 19 when it comes out. Another motivation for this being
+able to build with aeson 2.0 which is possible since hoauth2 2.1.
+
+I've elected not to try to support a wider range (say >= 2.0 && < 2.4 or
+even >= 1.3.0 && < 2.4) because *every version* released between 2.0 and
+2.3 contains a breaking change that affects gitit, the CPP would turn
+out to be quite the mess. Since there haven't been any functional
+changes since the last release on master, people that can't upgrade yet
+can safely skip a (hypothetical) immediate release.
+
+If wanted, support for hoauth2 >= 2.1 && < 2.4 could possibly be
+interesting, only supporting aeson >= 2.0 is probably a safe bet for
+future releases.
+---
+ gitit.cabal | 2 +-
+ src/Network/Gitit/Authentication/Github.hs | 22 +++++++++++-----------
+ src/Network/Gitit/Config.hs | 16 ++++++----------
+ 3 files changed, 18 insertions(+), 22 deletions(-)
+
+Index: b/gitit.cabal
+===================================================================
+--- a/gitit.cabal
++++ b/gitit.cabal
+@@ -155,7 +155,7 @@ Library
+ json >= 0.4 && < 0.11,
+ uri-bytestring >= 0.2.3.3,
+ split,
+- hoauth2 >= 1.3.0 && < 1.17,
++ hoauth2 >= 2.3.0 && < 2.4,
+ xml-conduit >= 1.5 && < 1.10,
+ http-conduit >= 2.1.6 && < 2.4,
+ http-client-tls >= 0.2.2 && < 0.4,
+Index: b/src/Network/Gitit/Authentication/Github.hs
+===================================================================
+--- a/src/Network/Gitit/Authentication/Github.hs
++++ b/src/Network/Gitit/Authentication/Github.hs
+@@ -27,6 +27,7 @@ import Control.Monad.Trans (liftIO)
+ import Data.UUID (toString)
+ import Data.UUID.V4 (nextRandom)
+ import qualified Control.Exception as E
++import Control.Monad.Except
+ import Prelude
+
+ loginGithubUser :: OAuth2 -> Params -> Handler
+@@ -54,16 +55,14 @@ getGithubUser ghConfig githubCallbackPar
+ newManager tlsManagerSettings >>= getUserInternal
+ where
+ getUserInternal mgr =
+- liftIO $ do
++ liftIO $ runExceptT $ do
+ let (Just state) = rState githubCallbackPars
+ if state == githubState
+ then do
+ let (Just code) = rCode githubCallbackPars
+- ifSuccess
+- "No access token found yet"
+- (fetchAccessToken mgr (oAuth2 ghConfig) (ExchangeToken $ pack code))
+- (\at -> ifSuccess
+- "User Authentication failed"
++ at <- withExceptT (oauthToGithubError "No access token found yet")
++ $ fetchAccessToken mgr (oAuth2 ghConfig) (ExchangeToken $ pack code)
++ liftIO >=> liftEither $ ifSuccess "User Authentication failed"
+ (userInfo mgr (accessToken at))
+ (\githubUser -> ifSuccess
+ ("No email for user " ++ unpack (gLogin githubUser) ++ " returned by Github")
+@@ -79,9 +78,9 @@ getGithubUser ghConfig githubCallbackPar
+ Just githuborg -> ifSuccess
+ ("Membership check failed: the user " ++ unpack gitLogin ++ " is required to be a member of the organization " ++ unpack githuborg ++ ".")
+ (orgInfo gitLogin githuborg mgr (accessToken at))
+- (\_ -> return $ Right user))))
++ (\_ -> return $ Right user)))
+ else
+- return $ Left $
++ throwError $
+ GithubLoginError ("The state sent to github is not the same as the state received: " ++ state ++ ", but expected sent state: " ++ githubState)
+ Nothing
+ ifSuccess errMsg failableAction successAction = E.catch
+@@ -90,6 +89,7 @@ getGithubUser ghConfig githubCallbackPar
+ (\exception -> liftIO $ return $ Left $
+ GithubLoginError errMsg
+ (Just $ show (exception :: E.SomeException)))
++ oauthToGithubError errMsg e = GithubLoginError errMsg (Just $ show e)
+
+ data GithubCallbackPars = GithubCallbackPars { rCode :: Maybe String
+ , rState :: Maybe String }
+@@ -106,14 +106,14 @@ userInfo :: Manager -> AccessToken -> IO
+ #else
+ userInfo :: Manager -> AccessToken -> IO (OAuth2Result OA.Errors GithubUser)
+ #endif
+-userInfo mgr token = authGetJSON mgr token $ githubUri "/user"
++userInfo mgr token = runExceptT $ authGetJSON mgr token $ githubUri "/user"
+
+ #if MIN_VERSION_hoauth2(1, 9, 0)
+ mailInfo :: Manager -> AccessToken -> IO (Either BSL.ByteString [GithubUserMail])
+ #else
+ mailInfo :: Manager -> AccessToken -> IO (OAuth2Result OA.Errors [GithubUserMail])
+ #endif
+-mailInfo mgr token = authGetJSON mgr token $ githubUri "/user/emails"
++mailInfo mgr token = runExceptT $ authGetJSON mgr token $ githubUri "/user/emails"
+
+ #if MIN_VERSION_hoauth2(1, 9, 0)
+ orgInfo :: Text -> Text -> Manager -> AccessToken -> IO (Either BSL.ByteString BSL.ByteString)
+@@ -122,7 +122,7 @@ orgInfo :: Text -> Text -> Manager -> A
+ #endif
+ orgInfo gitLogin githubOrg mgr token = do
+ let url = githubUri $ "/orgs/" `BS.append` encodeUtf8 githubOrg `BS.append` "/members/" `BS.append` encodeUtf8 gitLogin
+- authGetBS mgr token url
++ runExceptT $ authGetBS mgr token url
+
+ type UriPath = BS.ByteString
+
+Index: b/src/Network/Gitit/Config.hs
+===================================================================
+--- a/src/Network/Gitit/Config.hs
++++ b/src/Network/Gitit/Config.hs
+@@ -40,7 +40,7 @@ import Paths_gitit (getDataFileName)
+ import System.FilePath ((</>))
+ import Text.Pandoc hiding (ERROR, WARNING, MathJax, MathML, WebTeX, getDataFileName)
+ import qualified Control.Exception as E
+-import Network.OAuth.OAuth2 (OAuth2(..), oauthCallback, oauthOAuthorizeEndpoint, oauthClientId, oauthClientSecret)
++import Network.OAuth.OAuth2 (OAuth2(..))
+ import URI.ByteString (parseURI, laxURIParserOptions)
+ import qualified Data.ByteString.Char8 as BS
+ import Network.Gitit.Compat.Except
+@@ -254,15 +254,11 @@ extractGithubConfig cp = do
+ cfOrg <- if hasGithubProp "github-org"
+ then fmap Just (getGithubProp "github-org")
+ else return Nothing
+- let cfgOAuth2 = OAuth2 { oauthClientId = T.pack cfOauthClientId
+-#if MIN_VERSION_hoauth2(1, 11, 0)
+- , oauthClientSecret = Just $ T.pack cfOauthClientSecret
+-#else
+- , oauthClientSecret = T.pack cfOauthClientSecret
+-#endif
+- , oauthCallback = Just cfOauthCallback
+- , oauthOAuthorizeEndpoint = cfOauthOAuthorizeEndpoint
+- , oauthAccessTokenEndpoint = cfOauthAccessTokenEndpoint
++ let cfgOAuth2 = OAuth2 { oauth2ClientId = T.pack cfOauthClientId
++ , oauth2ClientSecret = T.pack cfOauthClientSecret
++ , oauth2RedirectUri = cfOauthCallback
++ , oauth2AuthorizeEndpoint = cfOauthOAuthorizeEndpoint
++ , oauth2TokenEndpoint = cfOauthAccessTokenEndpoint
+ }
+ return $ githubConfig cfgOAuth2 $ fmap T.pack cfOrg
+ where getGithubProp = get cp "Github"
=====================================
p/gitit/debian/patches/newer-pandoc
=====================================
@@ -0,0 +1,22 @@
+From 9eddd1d3bde46bccb23c6d21e15b289f2a9ebe66 Mon Sep 17 00:00:00 2001
+From: sternenseemann <sternenseemann at systemli.org>
+Date: Sat, 12 Mar 2022 14:23:48 +0100
+Subject: [PATCH] Allow building with pandoc 2.17
+
+---
+ gitit.cabal | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: b/gitit.cabal
+===================================================================
+--- a/gitit.cabal
++++ b/gitit.cabal
+@@ -126,7 +126,7 @@ Library
+ mtl,
+ old-time,
+ temporary,
+- pandoc >= 2.9 && < 2.17,
++ pandoc >= 2.9 && < 2.18,
+ pandoc-types >= 1.20 && < 1.23,
+ skylighting >= 0.8.2.3 && < 0.13,
+ bytestring,
=====================================
p/gitit/debian/patches/series
=====================================
@@ -1,2 +1,4 @@
clean-cabal-file.patch
jquery.patch
+newer-hoauth2
+newer-pandoc
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/commit/3cf109021525a25b02dddf0ce9beae56940228d5
--
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/commit/3cf109021525a25b02dddf0ce9beae56940228d5
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20220823/f5126c96/attachment-0001.htm>
More information about the Pkg-haskell-commits
mailing list