THRIFT-2677 haskell library and tutorial: build with network > 2.5
diff --git a/lib/hs/Thrift.cabal b/lib/hs/Thrift.cabal
index bd88299..7c9a295 100755
--- a/lib/hs/Thrift.cabal
+++ b/lib/hs/Thrift.cabal
@@ -32,11 +32,19 @@
Description:
Haskell bindings for the Apache Thrift RPC system. Requires the use of the thrift code generator.
+flag network-uri
+ description: Get Network.URI from the network-uri package
+ default: True
+
Library
Hs-Source-Dirs:
src
Build-Depends:
- base >= 4, base < 5, containers, network, ghc-prim, attoparsec, binary, bytestring >= 0.10, hashable, HTTP, text, unordered-containers, vector, QuickCheck, split
+ base >= 4, base < 5, containers, ghc-prim, attoparsec, binary, bytestring >= 0.10, hashable, HTTP, text, unordered-containers, vector, QuickCheck, split
+ if flag(network-uri)
+ build-depends: network-uri >= 2.6, network >= 2.6
+ else
+ build-depends: network < 2.6
Exposed-Modules:
Thrift,
Thrift.Arbitraries
diff --git a/tutorial/hs/ThriftTutorial.cabal b/tutorial/hs/ThriftTutorial.cabal
index b38fc5c..e6f0182 100755
--- a/tutorial/hs/ThriftTutorial.cabal
+++ b/tutorial/hs/ThriftTutorial.cabal
@@ -32,12 +32,16 @@
Description:
Haskell tutorial for the Apache Thrift RPC system. Requires the use of the thrift code generator.
+flag network-uri
+ description: Get Network.URI from the network-uri package
+ default: True
+
Executable HaskellServer
Main-is: HaskellServer.hs
Hs-Source-Dirs:
., gen-hs/
Build-Depends:
- base >= 4, base < 5, network, ghc-prim, containers, thrift, vector, unordered-containers, text, hashable, bytestring, QuickCheck
+ base >= 4, base < 5, ghc-prim, containers, thrift, vector, unordered-containers, text, hashable, bytestring, QuickCheck
Extensions:
DeriveDataTypeable,
ExistentialQuantification,
@@ -53,7 +57,11 @@
Hs-Source-Dirs:
., gen-hs/
Build-Depends:
- base >= 4, base < 5, network, ghc-prim, containers, thrift, vector, QuickCheck
+ base >= 4, base < 5, ghc-prim, containers, thrift, vector, QuickCheck
+ if flag(network-uri)
+ build-depends: network-uri >= 2.6, network >= 2.6
+ else
+ build-depends: network < 2.6
Extensions:
DeriveDataTypeable,
ExistentialQuantification,