network-uri-flag (empty) → 0.1
raw patch · 4 files changed
+94/−0 lines, 4 filesdep +networkdep +network-urisetup-changed
Dependencies added: network, network-uri
Files
- ChangeLog.md +5/−0
- LICENSE +30/−0
- Setup.hs +2/−0
- network-uri-flag.cabal +57/−0
+ ChangeLog.md view
@@ -0,0 +1,5 @@+# Revision history for network-uri-flag++## 0.1 -- YYYY-mm-dd++* First version. Released on an unsuspecting world.
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright (c) 2016, Herbert Valerio Riedel++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * Neither the name of Herbert Valerio Riedel nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ network-uri-flag.cabal view
@@ -0,0 +1,57 @@+name: network-uri-flag+version: 0.1+synopsis: Pseudo-package encapsulating flag(network-uri) Cabal boilerplate+license: BSD3+license-file: LICENSE+author: Herbert Valerio Riedel+maintainer: hvr@gnu.org+category: Network+build-type: Simple+extra-source-files: ChangeLog.md+cabal-version: >=1.10+description:+ This empty package does not provide any modules; its sole purpose is to+ provide the @network-uri@ Cabal flag logic below so you don't have to include+ that boilerplate in your @.cabal@ file.+ .+ > flag network-uri+ > description: Get Network.URI from the network-uri package+ > default: True+ >+ > library+ > if flag(network-uri)+ > build-depends: network-uri >= 2.6, network >= 2.6+ > else+ > build-depends: network-uri < 2.6, network < 2.6+ .+ This avoids combining+ @network-uri >= 2.6@ with @network < 2.6@ which both export a+ name-clashing @Network.URI@ module, because+ in network-2.6 the @Network.URI@ module was split off from the+ network package into network-uri-2.6.+ .+ In other words, the logic above makes sure that the @Network.URI@ module+ is provided by either @network-uri@ or by @network@+ (in the <https://en.wikipedia.org/wiki/Exclusive_or XOR> sense).+ .+ In order to benefit from this module, simply include it in your+ @build-depends@ declaration alongside @network@ and @network-uri@.+ .+ > build-depends:+ > network >= 2.5 && < 2.7,+ > network-uri >= 2.7 && < 2.8,+ > network-uri-flag == 0.1.*+ .+ /NOTE: It's almost always an error to list this package if network and network-uri aren't both listed as well!/++flag network-uri+ description: Get Network.URI from the network-uri package+ default: True++library+ default-language: Haskell2010++ if flag(network-uri)+ build-depends: network-uri >= 2.6, network >= 2.6+ else+ build-depends: network-uri < 2.6, network < 2.6