diff options
author | matoro <matoro@users.noreply.github.com> | 2022-07-12 16:37:36 -0400 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-07-22 22:15:21 +0000 |
commit | a2b398c0416b0105ff17dee213ee61663448f790 (patch) | |
tree | 33b5b0e557435171d2d9c5124d64546324558136 /dev-haskell | |
parent | dev-haskell/http-date: keyword 0.0.8 for ~ppc64 (diff) | |
download | gentoo-a2b398c0416b0105ff17dee213ee61663448f790.tar.gz gentoo-a2b398c0416b0105ff17dee213ee61663448f790.tar.bz2 gentoo-a2b398c0416b0105ff17dee213ee61663448f790.zip |
dev-haskell/http-media: new package, add 0.8.0.0
Signed-off-by: matoro <matoro@users.noreply.github.com>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-haskell')
-rw-r--r-- | dev-haskell/http-media/Manifest | 1 | ||||
-rw-r--r-- | dev-haskell/http-media/http-media-0.8.0.0.ebuild | 39 | ||||
-rw-r--r-- | dev-haskell/http-media/metadata.xml | 35 |
3 files changed, 75 insertions, 0 deletions
diff --git a/dev-haskell/http-media/Manifest b/dev-haskell/http-media/Manifest new file mode 100644 index 000000000000..23a0d95e094d --- /dev/null +++ b/dev-haskell/http-media/Manifest @@ -0,0 +1 @@ +DIST http-media-0.8.0.0.tar.gz 18895 BLAKE2B 3a6db500f6433c6f0bc23f6b51aa5f35b3340a4258b4b5d637bdeafd5161c28af8c2630a013f06a8204a2d37242d5bc880d5c75d32adbf92fb664417872806a2 SHA512 549fa1892c81224e79bad4268993e0cfa324d9d0c9daa0d800ac7cc4eee307405155989672c49adb0e124ca29c2d83cc565ba3c935fd3be4ab4ef0594b012bb5 diff --git a/dev-haskell/http-media/http-media-0.8.0.0.ebuild b/dev-haskell/http-media/http-media-0.8.0.0.ebuild new file mode 100644 index 000000000000..48eb79e3f8fa --- /dev/null +++ b/dev-haskell/http-media/http-media-0.8.0.0.ebuild @@ -0,0 +1,39 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +# ebuild generated by hackport 0.6.9999 + +CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite" +inherit haskell-cabal + +DESCRIPTION="Processing HTTP Content-Type and Accept headers" +HOMEPAGE="https://github.com/zmthy/http-media" +SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz" + +LICENSE="MIT" +SLOT="0/${PV}" +KEYWORDS="~amd64 ~ppc64 ~x86" +IUSE="" + +RDEPEND=">=dev-haskell/case-insensitive-1.0:=[profile?] <dev-haskell/case-insensitive-1.3:=[profile?] + >=dev-haskell/utf8-string-0.3:=[profile?] <dev-haskell/utf8-string-1.1:=[profile?] + >=dev-lang/ghc-7.10.1:= +" +DEPEND="${RDEPEND} + >=dev-haskell/cabal-1.22.2.0 + test? ( >=dev-haskell/quickcheck-2.8 + >=dev-haskell/test-framework-0.8 <dev-haskell/test-framework-0.9 + >=dev-haskell/test-framework-quickcheck2-0.3 <dev-haskell/test-framework-quickcheck2-0.4 ) +" + +# https://hackage.haskell.org/package/http-media-0.8.0.0/revisions/ +src_prepare() { + default + + cabal_chdeps \ + 'base >= 4.7 && < 4.13' 'base >= 4.8' \ + 'base >= 4.7 && < 4.13' 'base >= 4.7' \ + 'QuickCheck >= 2.8 && < 2.14' 'QuickCheck >= 2.8' +} diff --git a/dev-haskell/http-media/metadata.xml b/dev-haskell/http-media/metadata.xml new file mode 100644 index 000000000000..8281b91cfa5b --- /dev/null +++ b/dev-haskell/http-media/metadata.xml @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>haskell@gentoo.org</email> + <name>Gentoo Haskell</name> + </maintainer> + <longdescription> + This library is intended to be a comprehensive solution to parsing and + selecting quality-indexed values in HTTP headers. It is capable of parsing + both media types and language parameters from the Accept and Content header + families, and can be extended to match against other accept headers as well. + Selecting the appropriate header value is achieved by comparing a list of + server options against the quality-indexed values supplied by the client. + + In the following example, the Accept header is parsed and then matched against + a list of server options to serve the appropriate media using + 'mapAcceptMedia': + + > getHeader >>= maybe send406Error sendResourceWith . mapAcceptMedia + > [ ("text/html", asHtml) + > , ("application/json", asJson) + > ] + + Similarly, the Content-Type header can be used to produce a parser for request + bodies based on the given content type with 'mapContentMedia': + + > getContentType >>= maybe send415Error readRequestBodyWith . mapContentMedia + > [ ("application/json", parseJson) + > , ("text/plain", parseText) + > ] + + The API is agnostic to your choice of server. + </longdescription> +</pkgmetadata> |