diff options
Diffstat (limited to 'dev-haskell/aeson')
-rw-r--r-- | dev-haskell/aeson/Manifest | 4 | ||||
-rw-r--r-- | dev-haskell/aeson/aeson-1.5.6.0.ebuild | 85 | ||||
-rw-r--r-- | dev-haskell/aeson/files/aeson-1.5.6.0-fix-tests-ghc_9.patch | 232 |
3 files changed, 321 insertions, 0 deletions
diff --git a/dev-haskell/aeson/Manifest b/dev-haskell/aeson/Manifest index 62b4a48d5927..24d13284c30a 100644 --- a/dev-haskell/aeson/Manifest +++ b/dev-haskell/aeson/Manifest @@ -1,3 +1,7 @@ +AUX aeson-1.5.6.0-fix-tests-ghc_9.patch 9678 BLAKE2B 40512bbb1bbd0d8a80baad69ce70454132bb81aecedcf0011c7466c1eea81871e205af54da9f4aa51abd34ad4a64289f9ae28bdb90433dd07f03111795c54ff2 SHA512 e81925089a7bd43f9aaebaf20633afeb66b59fe5eb3c9e2b2123d5b4e790e5143a9470b0726698cfb6588132fc68296f5b60f0ccbf12bcb23fff3fe20ddbf915 DIST aeson-1.4.7.1.tar.gz 277911 BLAKE2B bffac6e82e7220f270fce44055859b27a97740b6f012f4e51d0970acd38a7bcd40d9bc3c4f1ba1df0df4d3d38dac0b8731dfdfe1f902b07a38efeaea842587d2 SHA512 236ed1b2cc4b39d49277cea5b787b6107c7efbe1c0d73de2005d400746bacf44c6b8ef5d26619395e24844f8948115685963ec7d03a998d0b728ab992e32e705 +DIST aeson-1.5.6.0.cabal 6788 BLAKE2B b7ad53a5ef4c0a06ad39bcc6bb19c7f3635c629edafdd03acf8e45163170506d00b7843a17bc4bd062bcfb922da949e9ec562ca62f0929b74bc094ee213aadf9 SHA512 6da627332e2d7b4af33ff53718e84b4b9fa11bc8b8ba82dffc9c5ea9f290b7628aa8015e9b2c8798ad402e184ce70253b0fdf49b4f60e7e22e2346f2f319fcc0 +DIST aeson-1.5.6.0.tar.gz 286364 BLAKE2B cc9524f025144b74dc70aca13576de935b24f1ae2befa027f6ae7d93b20bae8e5f399ed0147e351f1e46579d628923ef019be934572376cbe0a3b2ea497fcb01 SHA512 31e0339945aec6d84aec230c09001fe6e7926f008d3444d12264bb323d0a050515303fdc8eeb6563733594209d930cdd2f82eb4dfe4dd4d5c573748aaa71813d EBUILD aeson-1.4.7.1.ebuild 3016 BLAKE2B cca901c7d0e1e3892d8f6feeec1f6466fb4b3383b29e47b4f7c39cc7a139b5dede445f2de99190ba4666be57bceb58b640a6c0da9f422b4d1b2380bd97091447 SHA512 65c1366c1d7548654a1ff11d6975cc7536ef2ef3a62fc70e63e451140d6f8ca8f2511d27d8e2eb5cef3b31e37284c0c1fd20e856c4272dacab18111f7dc957ec +EBUILD aeson-1.5.6.0.ebuild 3408 BLAKE2B 1228d2c9eaff3dc05d4765369d939874d6256ea5bcfb1bbe87f77da4713ce45634bac116e02c73ec17b83d948cb42f3996234a4064dba93faebc9618ee4a6fc2 SHA512 02be07f319fae91c0860dff6a43b90ff838a43fe03cc68d650d098280ab3ad423caf4e8869d694132c2ad9a000a05548a23061356ac856b1072a00560b1b5d77 MISC metadata.xml 2437 BLAKE2B 2856043d84fb9355a0a86b43b9e2e8ad83442e5b75ea13c0a7be9abfb0088711b4454da4a2775e0af406b760a3ffc1f8c07e572c6d8d62d3953b10909c375b1b SHA512 400fc3cce9f3acd57d498027425608155dfa40dfa466ec98512d37f61684fbc5ff975c22d3bd3f453dbf1df206023855bf6e6d678d5a9b1acbba281b773a8098 diff --git a/dev-haskell/aeson/aeson-1.5.6.0.ebuild b/dev-haskell/aeson/aeson-1.5.6.0.ebuild new file mode 100644 index 000000000000..e2b77cc5ad62 --- /dev/null +++ b/dev-haskell/aeson/aeson-1.5.6.0.ebuild @@ -0,0 +1,85 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# ebuild generated by hackport 0.6.7.9999 +#hackport: flags: -developer,-bytestring-builder,-fast + +CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite" +CABAL_HACKAGE_REVISION="5" +inherit haskell-cabal + +DESCRIPTION="Fast JSON parsing and encoding" +HOMEPAGE="https://github.com/haskell/aeson" +SRC_URI="https://hackage.haskell.org/package/${P}/${P}.tar.gz + https://hackage.haskell.org/package/${P}/revision/${CABAL_HACKAGE_REVISION}.cabal -> ${PF}.cabal" + +LICENSE="BSD" +SLOT="0/${PV}" +KEYWORDS="~amd64 ~ppc64 ~x86" +IUSE="cffi" + +#RESTRICT=test # fails on newer ghc + +PATCHES=( "${FILESDIR}/${PN}-1.5.6.0-fix-tests-ghc_9.patch" ) + +RDEPEND=">=dev-haskell/attoparsec-0.13.2.2:=[profile?] <dev-haskell/attoparsec-0.15:=[profile?] + >=dev-haskell/base-compat-batteries-0.10.0:=[profile?] <dev-haskell/base-compat-batteries-0.13:=[profile?] + >=dev-haskell/contravariant-1.4.1:=[profile?] <dev-haskell/contravariant-1.6:=[profile?] + >=dev-haskell/data-fix-0.3:=[profile?] <dev-haskell/data-fix-0.4:=[profile?] + >=dev-haskell/dlist-0.8.0.4:=[profile?] <dev-haskell/dlist-1.1:=[profile?] + >=dev-haskell/hashable-1.2.7.0:=[profile?] + >=dev-haskell/primitive-0.7.0.1:=[profile?] <dev-haskell/primitive-0.8:=[profile?] + >=dev-haskell/scientific-0.3.6.2:=[profile?] <dev-haskell/scientific-0.4:=[profile?] + >=dev-haskell/strict-0.4:=[profile?] <dev-haskell/strict-0.5:=[profile?] + >=dev-haskell/tagged-0.8.6:=[profile?] <dev-haskell/tagged-0.9:=[profile?] + >=dev-haskell/text-1.2.3.0:=[profile?] <dev-haskell/text-1.3:=[profile?] + >=dev-haskell/th-abstraction-0.2.8.0:=[profile?] <dev-haskell/th-abstraction-0.5:=[profile?] + >=dev-haskell/these-1.1:=[profile?] <dev-haskell/these-1.2:=[profile?] + >=dev-haskell/time-compat-1.9.4:=[profile?] <dev-haskell/time-compat-1.10:=[profile?] + >=dev-haskell/unordered-containers-0.2.10.0:=[profile?] <dev-haskell/unordered-containers-0.3:=[profile?] + >=dev-haskell/uuid-types-1.0.3:=[profile?] <dev-haskell/uuid-types-1.1:=[profile?] + >=dev-haskell/vector-0.12.0.1:=[profile?] <dev-haskell/vector-0.13:=[profile?] + >=dev-lang/ghc-8.4.3:= +" +DEPEND="${RDEPEND} + >=dev-haskell/cabal-2.2.0.1 + test? ( dev-haskell/base-compat + >=dev-haskell/base-orphans-0.5.3 <dev-haskell/base-orphans-0.9 + dev-haskell/base16-bytestring + >=dev-haskell/diff-0.4 <dev-haskell/diff-0.5 + >=dev-haskell/generic-deriving-1.10 <dev-haskell/generic-deriving-1.15 + >=dev-haskell/hashable-time-0.2.1 + >=dev-haskell/integer-logarithms-1 <dev-haskell/integer-logarithms-1.1 + >=dev-haskell/quickcheck-2.14.2 <dev-haskell/quickcheck-2.15 + >=dev-haskell/quickcheck-instances-0.3.25.2 <dev-haskell/quickcheck-instances-0.4 + dev-haskell/tasty + dev-haskell/tasty-golden + dev-haskell/tasty-hunit + dev-haskell/tasty-quickcheck ) +" +BDEPEND="app-text/dos2unix" + +src_prepare() { + # pull revised cabal from upstream + cp "${DISTDIR}/${PF}.cabal" "${S}/${PN}.cabal" || die + + # Convert to unix line endings + dos2unix "${S}/${PN}.cabal" || die + + # Apply patches *after* pulling the revised cabal + default + + cabal_chdeps \ + 'hashable-time >= 0.2.1 && <0.3' 'hashable-time >= 0.2.1' \ + 'hashable >= 1.2.7.0 && < 1.4' 'hashable >=1.2.7.0' +} + +src_configure() { + haskell-cabal_src_configure \ + --flag=-bytestring-builder \ + $(cabal_flag cffi cffi) \ + --flag=-developer \ + --flag=-fast +} diff --git a/dev-haskell/aeson/files/aeson-1.5.6.0-fix-tests-ghc_9.patch b/dev-haskell/aeson/files/aeson-1.5.6.0-fix-tests-ghc_9.patch new file mode 100644 index 000000000000..bf6f2eb92c1e --- /dev/null +++ b/dev-haskell/aeson/files/aeson-1.5.6.0-fix-tests-ghc_9.patch @@ -0,0 +1,232 @@ +From 083691aa10e802a1b9b57922f3d0a234cafdb90d Mon Sep 17 00:00:00 2001 +From: Oleg Grenrus <oleg.grenrus@iki.fi> +Date: Sat, 20 Feb 2021 23:15:41 +0200 +Subject: [PATCH] Add GHC-9.0.1 CI job + +Not for benchmarks yet though, cassava etc need bounds relaxed first + +We need to reorder stuff in UnitTests, GHC-9.0 is stricter about +which instances are visible. +--- + aeson.cabal | 2 +- + tests/UnitTests.hs | 144 ++++++++++---------- + +diff --git a/aeson.cabal b/aeson.cabal +index 91eacd7d..6152e509 100644 +--- a/aeson.cabal ++++ b/aeson.cabal +@@ -8,7 +8,7 @@ copyright: (c) 2011-2016 Bryan O'Sullivan + author: Bryan O'Sullivan <bos@serpentine.com> + maintainer: Adam Bergmark <adam@bergmark.nl> + stability: experimental +-tested-with: GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.3, GHC == 8.10.1 ++tested-with: GHC == 7.8.4, GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.3, GHC == 8.10.4, GHC == 9.0.1 + synopsis: Fast JSON parsing and encoding + cabal-version: >= 1.10 + homepage: https://github.com/haskell/aeson + +diff --git a/tests/UnitTests.hs b/tests/UnitTests.hs +index a0651dda..e5c73f46 100644 +--- a/tests/UnitTests.hs ++++ b/tests/UnitTests.hs +@@ -76,59 +76,7 @@ import qualified SerializationFormatSpec + import Data.Aeson.Parser.UnescapeFFI () + import Data.Aeson.Parser.UnescapePure () + +-tests :: TestTree +-tests = testGroup "unit" [ +- testGroup "SerializationFormatSpec" SerializationFormatSpec.tests +- , testGroup "ErrorMessages" ErrorMessages.tests +- , testGroup "camelCase" [ +- testCase "camelTo" $ roundTripCamel "aName" +- , testCase "camelTo" $ roundTripCamel "another" +- , testCase "camelTo" $ roundTripCamel "someOtherName" +- , testCase "camelTo" $ +- assertEqual "" "camel_apicase" (camelTo '_' "CamelAPICase") +- , testCase "camelTo2" $ roundTripCamel2 "aName" +- , testCase "camelTo2" $ roundTripCamel2 "another" +- , testCase "camelTo2" $ roundTripCamel2 "someOtherName" +- , testCase "camelTo2" $ +- assertEqual "" "camel_api_case" (camelTo2 '_' "CamelAPICase") +- ] +- , testGroup "encoding" [ +- testCase "goodProducer" goodProducer +- ] +- , testGroup "utctime" [ +- testCase "good" utcTimeGood +- , testCase "bad" utcTimeBad +- ] +- , testGroup "formatError" [ +- testCase "example 1" formatErrorExample +- ] +- , testGroup ".:, .:?, .:!" $ fmap (testCase "-") dotColonMark +- , testGroup "Hashable laws" $ fmap (testCase "-") hashableLaws +- , testGroup "Object construction" $ fmap (testCase "-") objectConstruction +- , testGroup "Issue #351" $ fmap (testCase "-") issue351 +- , testGroup "Nullary constructors" $ fmap (testCase "-") nullaryConstructors +- , testGroup "FromJSONKey" $ fmap (testCase "-") fromJSONKeyAssertions +- , testCase "PR #455" pr455 +- , testCase "Unescape string (PR #477)" unescapeString +- , testCase "Show Options" showOptions +- , testGroup "SingleMaybeField" singleMaybeField +- , testCase "withEmbeddedJSON" withEmbeddedJSONTest +- , testCase "SingleFieldCon" singleFieldCon +- , testGroup "UnknownFields" unknownFields +- , testGroup "Ordering of object keys" keyOrdering +- , testCase "Ratio with denominator 0" ratioDenominator0 +- , testCase "Rational parses number" rationalNumber +- , testCase "Big rational" bigRationalDecoding +- , testCase "Small rational" smallRationalDecoding +- , testCase "Big scientific exponent" bigScientificExponent +- , testCase "Big integer decoding" bigIntegerDecoding +- , testCase "Big natural decading" bigNaturalDecoding +- , testCase "Big integer key decoding" bigIntegerKeyDecoding +- , testGroup "QQ.Simple" +- [ testCase "example" $ +- assertEqual "" (object ["foo" .= True]) [aesonQQ| {"foo": true } |] +- ] +- ] ++ + + roundTripCamel :: String -> Assertion + roundTripCamel name = assertEqual "" name (camelFrom '_' $ camelTo '_' name) +@@ -389,11 +337,7 @@ issue351 = [ + -- Comparison between bytestring and text encoders + ------------------------------------------------------------------------------ + +-ioTests :: IO [TestTree] +-ioTests = do +- enc <- encoderComparisonTests +- js <- jsonTestSuite +- return [enc, js] ++ + + encoderComparisonTests :: IO TestTree + encoderComparisonTests = do +@@ -427,6 +371,7 @@ encoderComparisonTests = do + + -- A regression test for: https://github.com/bos/aeson/issues/293 + data MyRecord = MyRecord {_field1 :: Maybe Int, _field2 :: Maybe Bool} ++deriveJSON defaultOptions{omitNothingFields=True} ''MyRecord + + data MyRecord2 = MyRecord2 {_field3 :: Maybe Int, _field4 :: Maybe Bool} + deriving Generic +@@ -522,6 +467,8 @@ _blacklist = HashSet.fromList [ + + -- A regression test for: https://github.com/bos/aeson/pull/455 + data Foo a = FooNil | FooCons (Foo Int) ++deriveToJSON defaultOptions ''Foo ++deriveToJSON1 defaultOptions ''Foo + + pr455 :: Assertion + pr455 = assertEqual "FooCons FooNil" +@@ -548,6 +495,7 @@ showOptions = + + newtype SingleMaybeField = SingleMaybeField { smf :: Maybe Int } + deriving (Eq, Show, Generic) ++deriveJSON defaultOptions{omitNothingFields=True,unwrapUnaryRecords=True} ''SingleMaybeField + + singleMaybeField :: [TestTree] + singleMaybeField = do +@@ -589,14 +537,21 @@ singleFieldCon = + + newtype UnknownFields = UnknownFields { knownField :: Int } + deriving (Eq, Show, Generic) ++deriveJSON defaultOptions{rejectUnknownFields=True} ''UnknownFields ++ + newtype UnknownFieldsTag = UnknownFieldsTag { tag :: Int } + deriving (Eq, Show, Generic) ++deriveJSON defaultOptions{rejectUnknownFields=True} ''UnknownFieldsTag ++ + newtype UnknownFieldsUnaryTagged = UnknownFieldsUnaryTagged { knownFieldUnaryTagged :: Int } + deriving (Eq, Show, Generic) ++deriveJSON defaultOptions{tagSingleConstructors=True,rejectUnknownFields=True} ''UnknownFieldsUnaryTagged ++ + data UnknownFieldsSum + = UnknownFields1 { knownField1 :: Int } + | UnknownFields2 { knownField2 :: Int } + deriving (Eq, Show, Generic) ++deriveJSON defaultOptions{rejectUnknownFields=True} ''UnknownFieldsSum + + unknownFields :: [TestTree] + unknownFields = concat +@@ -753,17 +708,68 @@ bigNaturalKeyDecoding = + type family Fam757 :: * -> * + type instance Fam757 = Maybe + newtype Newtype757 a = MkNewtype757 (Fam757 a) ++deriveToJSON1 defaultOptions ''Newtype757 + +-deriveJSON defaultOptions{omitNothingFields=True} ''MyRecord +- +-deriveToJSON defaultOptions ''Foo +-deriveToJSON1 defaultOptions ''Foo +- +-deriveJSON defaultOptions{omitNothingFields=True,unwrapUnaryRecords=True} ''SingleMaybeField ++------------------------------------------------------------------------------- ++-- Tests trees ++------------------------------------------------------------------------------- + +-deriveJSON defaultOptions{rejectUnknownFields=True} ''UnknownFields +-deriveJSON defaultOptions{rejectUnknownFields=True} ''UnknownFieldsTag +-deriveJSON defaultOptions{tagSingleConstructors=True,rejectUnknownFields=True} ''UnknownFieldsUnaryTagged +-deriveJSON defaultOptions{rejectUnknownFields=True} ''UnknownFieldsSum ++ioTests :: IO [TestTree] ++ioTests = do ++ enc <- encoderComparisonTests ++ js <- jsonTestSuite ++ return [enc, js] + +-deriveToJSON1 defaultOptions ''Newtype757 ++tests :: TestTree ++tests = testGroup "unit" [ ++ testGroup "SerializationFormatSpec" SerializationFormatSpec.tests ++ , testGroup "ErrorMessages" ErrorMessages.tests ++ , testGroup "camelCase" [ ++ testCase "camelTo" $ roundTripCamel "aName" ++ , testCase "camelTo" $ roundTripCamel "another" ++ , testCase "camelTo" $ roundTripCamel "someOtherName" ++ , testCase "camelTo" $ ++ assertEqual "" "camel_apicase" (camelTo '_' "CamelAPICase") ++ , testCase "camelTo2" $ roundTripCamel2 "aName" ++ , testCase "camelTo2" $ roundTripCamel2 "another" ++ , testCase "camelTo2" $ roundTripCamel2 "someOtherName" ++ , testCase "camelTo2" $ ++ assertEqual "" "camel_api_case" (camelTo2 '_' "CamelAPICase") ++ ] ++ , testGroup "encoding" [ ++ testCase "goodProducer" goodProducer ++ ] ++ , testGroup "utctime" [ ++ testCase "good" utcTimeGood ++ , testCase "bad" utcTimeBad ++ ] ++ , testGroup "formatError" [ ++ testCase "example 1" formatErrorExample ++ ] ++ , testGroup ".:, .:?, .:!" $ fmap (testCase "-") dotColonMark ++ , testGroup "Hashable laws" $ fmap (testCase "-") hashableLaws ++ , testGroup "Object construction" $ fmap (testCase "-") objectConstruction ++ , testGroup "Issue #351" $ fmap (testCase "-") issue351 ++ , testGroup "Nullary constructors" $ fmap (testCase "-") nullaryConstructors ++ , testGroup "FromJSONKey" $ fmap (testCase "-") fromJSONKeyAssertions ++ , testCase "PR #455" pr455 ++ , testCase "Unescape string (PR #477)" unescapeString ++ , testCase "Show Options" showOptions ++ , testGroup "SingleMaybeField" singleMaybeField ++ , testCase "withEmbeddedJSON" withEmbeddedJSONTest ++ , testCase "SingleFieldCon" singleFieldCon ++ , testGroup "UnknownFields" unknownFields ++ , testGroup "Ordering of object keys" keyOrdering ++ , testCase "Ratio with denominator 0" ratioDenominator0 ++ , testCase "Rational parses number" rationalNumber ++ , testCase "Big rational" bigRationalDecoding ++ , testCase "Small rational" smallRationalDecoding ++ , testCase "Big scientific exponent" bigScientificExponent ++ , testCase "Big integer decoding" bigIntegerDecoding ++ , testCase "Big natural decading" bigNaturalDecoding ++ , testCase "Big integer key decoding" bigIntegerKeyDecoding ++ , testGroup "QQ.Simple" ++ [ testCase "example" $ ++ assertEqual "" (object ["foo" .= True]) [aesonQQ| {"foo": true } |] ++ ] ++ ] |