@@ -889,6 +889,7 @@ dist_patch_DATA = \
%D%/packages/patches/ghc-monad-par-fix-tests.patch \
%D%/packages/patches/ghc-pandoc-fix-html-tests.patch \
%D%/packages/patches/ghc-pandoc-fix-latex-test.patch \
+ %D%/packages/patches/ghc-wai-cors-skip-phantomjs-tests.patch \
%D%/packages/patches/ghostscript-no-header-id.patch \
%D%/packages/patches/ghostscript-no-header-uuid.patch \
%D%/packages/patches/ghostscript-no-header-creationdate.patch \
@@ -1599,3 +1599,45 @@ requirements of downstream users (e.g. Debian).")
(description
"Provide a bridge between WAI and the websockets package.")
(license license:expat)))
+
+(define-public ghc-wai-cors
+ (package
+ (name "ghc-wai-cors")
+ (version "0.2.6")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://hackage.haskell.org/package/wai-cors/wai-cors-"
+ version
+ ".tar.gz"))
+ (sha256
+ (base32
+ "11m9d8hn9pb9brprz0kglldmcqj83kjkjdwdpxdbl12430ii1ina"))
+ (patches (search-patches "ghc-wai-cors-skip-phantomjs-tests.patch"))))
+ (build-system haskell-build-system)
+ (arguments
+ ;; required for unclear reasons; those flags should default to false
+ `(#:configure-flags '("--flags=-wai-2" "--flags=-wai-1")))
+ (inputs
+ `(("ghc-attoparsec" ,ghc-attoparsec)
+ ("ghc-base-unicode-symbols"
+ ,ghc-base-unicode-symbols)
+ ("ghc-case-insensitive" ,ghc-case-insensitive)
+ ("ghc-http-types" ,ghc-http-types)
+ ("ghc-wai" ,ghc-wai)))
+ (native-inputs
+ `(("ghc-tasty" ,ghc-tasty)
+ ("ghc-tasty-hunit" ,ghc-tasty-hunit)
+ ("ghc-transformers-compat" ,ghc-transformers-compat)
+ ("ghc-wai-extra" ,ghc-wai-extra)
+ ("ghc-wai-websockets" ,ghc-wai-websockets)
+ ("ghc-warp" ,ghc-warp)
+ ("ghc-websockets" ,ghc-websockets)))
+ (home-page
+ "https://github.com/larskuhtz/wai-cors")
+ (synopsis "CORS for WAI")
+ (description
+ "This package provides an implemenation of Cross-Origin resource sharing
+(CORS) for Wai that aims to be compliant with http://www.w3.org/TR/cors.")
+ (license license:expat)))
new file mode 100644
@@ -0,0 +1,13 @@
+Skip phantomjs tests.
+
+--- a/wai-cors.cabal 2017-12-02 19:58:59.000000000 +0100
++++ b/wai-cors.cabal 2019-06-03 22:02:32.792000000 +0200
+@@ -102,6 +102,8 @@
+ ghc-options: -Wall
+
+ Test-Suite phantomjs
++ buildable: False
++
+ type: exitcode-stdio-1.0
+ default-language: Haskell2010
+ main-is: PhantomJS.hs