Date: Monday, June 21, 2021 @ 15:29:09 Author: felixonmars Revision: 966469
upgpkg: haskell-aeson 1.5.6.0-33: rebuild with ghc 9.0.1 Added: haskell-aeson/trunk/ghc9.patch Modified: haskell-aeson/trunk/PKGBUILD ------------+ PKGBUILD | 9 +- ghc9.patch | 222 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 228 insertions(+), 3 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2021-06-21 12:34:23 UTC (rev 966468) +++ PKGBUILD 2021-06-21 15:29:09 UTC (rev 966469) @@ -5,7 +5,7 @@ pkgname=haskell-aeson _hkgname=aeson pkgver=1.5.6.0 -pkgrel=32 +pkgrel=33 pkgdesc="A JSON parsing and encoding library optimized for ease of use and high performance." url="https://github.com/haskell/aeson" license=("GPL") @@ -19,11 +19,14 @@ 'haskell-generic-deriving' 'haskell-hashable-time' 'haskell-tasty' 'haskell-tasty-golden' 'haskell-tasty-hunit' 'haskell-tasty-quickcheck' 'haskell-quickcheck-instances') -source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-${pkgver}.tar.gz") -sha512sums=('31e0339945aec6d84aec230c09001fe6e7926f008d3444d12264bb323d0a050515303fdc8eeb6563733594209d930cdd2f82eb4dfe4dd4d5c573748aaa71813d') +source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-${pkgver}.tar.gz" + ghc9.patch) +sha512sums=('31e0339945aec6d84aec230c09001fe6e7926f008d3444d12264bb323d0a050515303fdc8eeb6563733594209d930cdd2f82eb4dfe4dd4d5c573748aaa71813d' + 'b6f9d49f1427543a907a2b432889f2fef64c50dbaae36133dbb328d6ff7f314959d35ef154f085a42f72af384eaa107b6f7f2b67a2d318f972e2cce04b65d35e') prepare() { uusi -u attoparsec -u hashable-time $_hkgname-$pkgver/$_hkgname.cabal + patch -d $_hkgname-$pkgver -p1 < ghc9.patch } build() { Added: ghc9.patch =================================================================== --- ghc9.patch (rev 0) +++ ghc9.patch 2021-06-21 15:29:09 UTC (rev 966469) @@ -0,0 +1,222 @@ +From 083691aa10e802a1b9b57922f3d0a234cafdb90d Mon Sep 17 00:00:00 2001 +From: Oleg Grenrus <[email protected]> +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. +--- + .github/workflows/haskell-ci.yml | 12 +- + aeson.cabal | 2 +- + attoparsec-iso8601/attoparsec-iso8601.cabal | 2 +- + examples/aeson-examples.cabal | 3 +- + tests/UnitTests.hs | 144 ++++++++++---------- + 5 files changed, 86 insertions(+), 77 deletions(-) + +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 } |] ++ ] ++ ]
