Subject: [bug#44954] [PATCH 09/12] gnu: Add ghc-wai-cors.

From: Giacomo Leidi <[email-masked]>
Date: Sun, 29 Nov 2020 23:32:58 +0100

* gnu/packages/haskell-web.scm (ghc-wai-cors): New variable.
---
 gnu/packages/haskell-web.scm | 44 ++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/haskell-web.scm b/gnu/packages/haskell-web.scm
index ae923dc6f1..fc50f5d333 100644
--- a/gnu/packages/haskell-web.scm
+++ b/gnu/packages/haskell-web.scm
@@ -2244,3 +2244,47 @@ subsite for Yesod Web Framework.")
 Javascript code to ping the server.  When the server no longer
 receives pings, it shuts down.")
    (license license:expat)))
+
+(define-public ghc-wai-cors
+  (package
+   (name "ghc-wai-cors")
+   (version "0.2.7")
+   (source
+    (origin
+     (method url-fetch)
+     (uri (string-append
+           "https://hackage.haskell.org/package/wai-cors/wai-cors-"
+           version
+           ".tar.gz"))
+     (sha256
+      (base32
+       "10gv3jjlkcb13031frr818p56v2s0qf6dqjsfpwlhwdxdssvx5r5"))))
+   (build-system haskell-build-system)
+   (arguments
+    `(#:tests? #f))                     ;tests require PhantomJS
+   (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-network" ,ghc-network)
+      ("ghc-wai-websockets" ,ghc-wai-websockets)
+      ("ghc-warp" ,ghc-warp)
+      ("ghc-websockets" ,ghc-websockets)
+      ("ghc-tasty" ,ghc-tasty)
+      ("ghc-tasty-hunit" ,ghc-tasty-hunit)
+      ("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
+@url{http://www.w3.org/TR/cors}.")
+   (license license:expat)))
-- 
2.29.2