[arch-commits] Commit in haskell-aeson/repos (3 files)

Felix Yan felixonmars at gemini.archlinux.org
Tue Jan 18 13:07:00 UTC 2022


    Date: Tuesday, January 18, 2022 @ 13:07:00
  Author: felixonmars
Revision: 1108781

archrelease: copy trunk to community-staging-x86_64

Added:
  haskell-aeson/repos/community-staging-x86_64/
  haskell-aeson/repos/community-staging-x86_64/PKGBUILD
    (from rev 1108780, haskell-aeson/trunk/PKGBUILD)
  haskell-aeson/repos/community-staging-x86_64/ghc9.patch
    (from rev 1108780, haskell-aeson/trunk/ghc9.patch)

------------+
 PKGBUILD   |   57 +++++++++++++++
 ghc9.patch |  222 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 279 insertions(+)

Copied: haskell-aeson/repos/community-staging-x86_64/PKGBUILD (from rev 1108780, haskell-aeson/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2022-01-18 13:07:00 UTC (rev 1108781)
@@ -0,0 +1,57 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Daniel Nagy <danielnagy at gmx de>
+# Contributor: Daniel Micay <danielmicay at gmail.com>
+
+pkgname=haskell-aeson
+_hkgname=aeson
+pkgver=1.5.6.0
+pkgrel=73
+pkgdesc="A JSON parsing and encoding library optimized for ease of use and high performance."
+url="https://github.com/haskell/aeson"
+license=("GPL")
+arch=('x86_64')
+depends=('ghc-libs' 'haskell-attoparsec' 'haskell-base-compat-batteries' 'haskell-data-fix'
+         'haskell-dlist' 'haskell-hashable' 'haskell-primitive' 'haskell-scientific'
+         'haskell-strict' 'haskell-tagged' 'haskell-th-abstraction' 'haskell-these'
+         'haskell-time-compat' 'haskell-unordered-containers' 'haskell-uuid-types' 'haskell-vector')
+makedepends=('ghc' 'uusi' 'haskell-quickcheck' 'haskell-integer-logarithms'
+             'haskell-base-orphans' 'haskell-base16-bytestring' 'haskell-diff'
+             '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"
+        ghc9.patch)
+sha512sums=('31e0339945aec6d84aec230c09001fe6e7926f008d3444d12264bb323d0a050515303fdc8eeb6563733594209d930cdd2f82eb4dfe4dd4d5c573748aaa71813d'
+            'b6f9d49f1427543a907a2b432889f2fef64c50dbaae36133dbb328d6ff7f314959d35ef154f085a42f72af384eaa107b6f7f2b67a2d318f972e2cce04b65d35e')
+
+prepare() {
+  uusi -u attoparsec -u hashable-time $_hkgname-$pkgver/$_hkgname.cabal
+  patch -d $_hkgname-$pkgver -p1 < ghc9.patch
+}
+
+build() {
+  cd $_hkgname-$pkgver
+  runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
+        --prefix=/usr --docdir=/usr/share/doc/$pkgname --enable-tests \
+        --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm \
+            -f-developer -f-fast -f-cffi
+  runhaskell Setup build $MAKEFLAGS
+  runhaskell Setup register --gen-script
+  runhaskell Setup unregister --gen-script
+  sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
+  sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
+}
+
+check() {
+  cd $_hkgname-$pkgver
+  runhaskell Setup test --show-details=direct
+}
+
+package() {
+  cd $_hkgname-$pkgver
+
+  install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh
+  install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh
+  runhaskell Setup copy --destdir="$pkgdir"
+  rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE
+}

Copied: haskell-aeson/repos/community-staging-x86_64/ghc9.patch (from rev 1108780, haskell-aeson/trunk/ghc9.patch)
===================================================================
--- community-staging-x86_64/ghc9.patch	                        (rev 0)
+++ community-staging-x86_64/ghc9.patch	2022-01-18 13:07:00 UTC (rev 1108781)
@@ -0,0 +1,222 @@
+From 083691aa10e802a1b9b57922f3d0a234cafdb90d Mon Sep 17 00:00:00 2001
+From: Oleg Grenrus <oleg.grenrus at 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.
+---
+ .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 } |]
++    ]
++  ]



More information about the arch-commits mailing list