git.iko.soy/typeable/pandoc
on master help sign in
Removed dependency on conduit.

* http-conduit flag is now https. * Instead of http-conduit, we depend on http-client and http-client-tls.

commitee8c8da8ccfc7e3eb33679fd8a3a465766f9d5f7 authorJohn MacFarlane <jgm@berkeley.edu> dateSun 18 May 2014, 22:04 (12 years ago) parent0915967
3 files changed+16−14
INSTALL+2−3 pandoc.cabal+6−5 src/Text/Pandoc/Shared.hs+8−6
INSTALL+2−3
@@ -116,9 +116,8 @@ assume that the pandoc source directory is your working directory.
116116
117117 cabal install hsb2hs
118118
119− - `http-conduit`: use the `http-conduit` library to fetch external
120− resources (default yes -- without this, pandoc cannot make SSL
121− connections)
119+ - `https`: enable support for downloading resources over https
120+ (using the `http-client` and `http-client-tls` libraries).
122121
1231223. Build:
124123
pandoc.cabal+6−5
@@ -196,8 +196,8 @@ Flag embed_data_files
196196 Description: Embed data files in binary for relocatable executable.
197197 Default: False
198198
199−Flag http-conduit
200− Description: Enable downloading of resources over https.
199+Flag https
200+ Description: Enable support for downloading of resources over https.
201201 Default: True
202202
203203Library
@@ -239,10 +239,11 @@ Library
239239 hslua >= 0.3 && < 0.4,
240240 binary >= 0.5 && < 0.8
241241 Build-Tools: alex, happy
242− if flag(http-conduit)
243− Build-Depends: http-conduit >= 1.9 && < 2.2,
242+ if flag(https)
243+ Build-Depends: http-client >= 0.3.2 && < 0.4,
244+ http-client-tls >= 0.2 && < 0.3,
244245 http-types >= 0.8 && < 0.9
245− cpp-options: -DHTTP_CONDUIT
246+ cpp-options: -DHTTP_CLIENT
246247 if flag(embed_data_files)
247248 cpp-options: -DEMBED_DATA_FILES
248249 -- Build-Tools: hsb2hs -- not yet recognized by cabal
src/Text/Pandoc/Shared.hs+8−6
@@ -118,11 +118,13 @@ import System.FilePath ( joinPath, splitDirectories )
118118#else
119119import Paths_pandoc (getDataFileName)
120120#endif
121−#ifdef HTTP_CONDUIT
121+#ifdef HTTP_CLIENT
122122import Data.ByteString.Lazy (toChunks)
123−import Network.HTTP.Conduit (httpLbs, parseUrl, withManager,
124− responseBody, responseHeaders, addProxy,
125− Request(port,host))
123+import Network.HTTP.Client (httpLbs, parseUrl, withManager,
124+ responseBody, responseHeaders,
125+ Request(port,host))
126+import Network.HTTP.Client.Internal (addProxy)
127+import Network.HTTP.Client.TLS (tlsManagerSettings)
126128import System.Environment (getEnv)
127129import Network.HTTP.Types.Header ( hContentType)
128130import Network (withSocketsDo)
@@ -665,7 +667,7 @@ openURL u
665667 let mime = takeWhile (/=',') $ drop 5 u
666668 contents = B8.pack $ unEscapeString $ drop 1 $ dropWhile (/=',') u
667669 in return $ Right (decodeLenient contents, Just mime)
668−#ifdef HTTP_CONDUIT
670+#ifdef HTTP_CLIENT
669671 | otherwise = withSocketsDo $ E.try $ do
670672 req <- parseUrl u
671673 (proxy :: Either E.SomeException String) <- E.try $ getEnv "http_proxy"
@@ -674,7 +676,7 @@ openURL u
674676 Right pr -> case parseUrl pr of
675677 Just r -> addProxy (host r) (port r) req
676678 Nothing -> req
677− resp <- withManager $ httpLbs req'
679+ resp <- withManager tlsManagerSettings $ httpLbs req'
678680 return (BS.concat $ toChunks $ responseBody resp,
679681 UTF8.toString `fmap` lookup hContentType (responseHeaders resp))
680682#else