summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatoro <matoro@users.noreply.github.com>2022-07-11 21:51:03 -0400
committerSam James <sam@gentoo.org>2022-07-22 22:14:47 +0000
commit1176db27448c95504ef6efab030c9028bb4090f8 (patch)
treea1863ac6a0ea724c218f7bc2580805a89383afea /dev-haskell/aeson
parentdev-haskell/adjunctions: keyword 4.4 for ~ppc64 (diff)
downloadgentoo-1176db27448c95504ef6efab030c9028bb4090f8.tar.gz
gentoo-1176db27448c95504ef6efab030c9028bb4090f8.tar.bz2
gentoo-1176db27448c95504ef6efab030c9028bb4090f8.zip
dev-haskell/aeson: add 1.5.6.0
Signed-off-by: matoro <matoro@users.noreply.github.com> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-haskell/aeson')
-rw-r--r--dev-haskell/aeson/Manifest2
-rw-r--r--dev-haskell/aeson/aeson-1.5.6.0.ebuild85
-rw-r--r--dev-haskell/aeson/files/aeson-1.5.6.0-fix-tests-ghc_9.patch232
3 files changed, 319 insertions, 0 deletions
diff --git a/dev-haskell/aeson/Manifest b/dev-haskell/aeson/Manifest
index efb710cb2fb1..61768ab7b193 100644
--- a/dev-haskell/aeson/Manifest
+++ b/dev-haskell/aeson/Manifest
@@ -1 +1,3 @@
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
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 } |]
++ ]
++ ]