pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/converters/hs-aeson-better-errors Update to aeson-bett...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a7f907f07092
branches:  trunk
changeset: 384865:a7f907f07092
user:      pho <pho%pkgsrc.org@localhost>
date:      Tue Sep 06 18:36:43 2022 +0000

description:
Update to aeson-better-errors-0.9.1.1

Make compatible with aeson >2.0.0.0

diffstat:

 converters/hs-aeson-better-errors/Makefile                                              |  11 +-
 converters/hs-aeson-better-errors/buildlink3.mk                                         |   4 +-
 converters/hs-aeson-better-errors/distinfo                                              |   9 +-
 converters/hs-aeson-better-errors/patches/patch-src_Data_Aeson_BetterErrors_Internal.hs |  91 ----------
 4 files changed, 14 insertions(+), 101 deletions(-)

diffs (152 lines):

diff -r 41c2cfac61cb -r a7f907f07092 converters/hs-aeson-better-errors/Makefile
--- a/converters/hs-aeson-better-errors/Makefile        Tue Sep 06 15:58:58 2022 +0000
+++ b/converters/hs-aeson-better-errors/Makefile        Tue Sep 06 18:36:43 2022 +0000
@@ -1,13 +1,18 @@
-# $NetBSD: Makefile,v 1.3 2022/08/20 08:08:12 wiz Exp $
+# $NetBSD: Makefile,v 1.4 2022/09/06 18:36:43 pho Exp $
 
-DISTNAME=      aeson-better-errors-0.9.1.0
-PKGREVISION=   2
+DISTNAME=      aeson-better-errors-0.9.1.1
 CATEGORIES=    converters
 
 MAINTAINER=    pkgsrc-users%NetBSD.org@localhost
 COMMENT=       Better error messages when decoding JSON values
 LICENSE=       mit
 
+# Relax version constraints.
+SUBST_CLASSES+=                cabal
+SUBST_STAGE.cabal=     post-extract
+SUBST_FILES.cabal=     aeson-better-errors.cabal
+SUBST_SED.cabal=       -e 's/aeson >=0.7 && <1.6 || >=2.0 && <2.1/aeson/'
+
 .include "../../converters/hs-aeson/buildlink3.mk"
 .include "../../devel/hs-dlist/buildlink3.mk"
 .include "../../math/hs-scientific/buildlink3.mk"
diff -r 41c2cfac61cb -r a7f907f07092 converters/hs-aeson-better-errors/buildlink3.mk
--- a/converters/hs-aeson-better-errors/buildlink3.mk   Tue Sep 06 15:58:58 2022 +0000
+++ b/converters/hs-aeson-better-errors/buildlink3.mk   Tue Sep 06 18:36:43 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.3 2022/08/20 08:08:12 wiz Exp $
+# $NetBSD: buildlink3.mk,v 1.4 2022/09/06 18:36:43 pho Exp $
 
 BUILDLINK_TREE+=       hs-aeson-better-errors
 
@@ -6,7 +6,7 @@
 HS_AESON_BETTER_ERRORS_BUILDLINK3_MK:=
 
 BUILDLINK_API_DEPENDS.hs-aeson-better-errors+= hs-aeson-better-errors>=0.9.1
-BUILDLINK_ABI_DEPENDS.hs-aeson-better-errors+= hs-aeson-better-errors>=0.9.1.0nb2
+BUILDLINK_ABI_DEPENDS.hs-aeson-better-errors+= hs-aeson-better-errors>=0.9.1.1
 BUILDLINK_PKGSRCDIR.hs-aeson-better-errors?=   ../../converters/hs-aeson-better-errors
 
 .include "../../converters/hs-aeson/buildlink3.mk"
diff -r 41c2cfac61cb -r a7f907f07092 converters/hs-aeson-better-errors/distinfo
--- a/converters/hs-aeson-better-errors/distinfo        Tue Sep 06 15:58:58 2022 +0000
+++ b/converters/hs-aeson-better-errors/distinfo        Tue Sep 06 18:36:43 2022 +0000
@@ -1,6 +1,5 @@
-$NetBSD: distinfo,v 1.1 2022/02/23 16:08:53 pho Exp $
+$NetBSD: distinfo,v 1.2 2022/09/06 18:36:43 pho Exp $
 
-BLAKE2s (aeson-better-errors-0.9.1.0.tar.gz) = 624b0cd5a9158b53c8f584b744b1a6f8b879d08048579f639971ec2d1db66001
-SHA512 (aeson-better-errors-0.9.1.0.tar.gz) = 3ff1a0f85f39df01f8cfa0fe4682a97f69a324c8b344f7bb005a84e4adb4c0dabe463e3a029a74012b101413532d3f5d3a4be92671d14b5387fb61ca8e1540c6
-Size (aeson-better-errors-0.9.1.0.tar.gz) = 8401 bytes
-SHA1 (patch-src_Data_Aeson_BetterErrors_Internal.hs) = 544645a1da856bae7c5a62e2b8323ba13b814df9
+BLAKE2s (aeson-better-errors-0.9.1.1.tar.gz) = 0a1a2eab10d726175e96c3c0b4784ebad7c2a8c05181421f7c7a890fa853a124
+SHA512 (aeson-better-errors-0.9.1.1.tar.gz) = 9da060f700d1f62a43a2cde336e7440f684dff7e3859d9f4e4e6a318484373531add4da0b0fe63000450e606c37a95819eb5aed25c57fe31e35c9a20aee3f53a
+Size (aeson-better-errors-0.9.1.1.tar.gz) = 8585 bytes
diff -r 41c2cfac61cb -r a7f907f07092 converters/hs-aeson-better-errors/patches/patch-src_Data_Aeson_BetterErrors_Internal.hs
--- a/converters/hs-aeson-better-errors/patches/patch-src_Data_Aeson_BetterErrors_Internal.hs   Tue Sep 06 15:58:58 2022 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-$NetBSD: patch-src_Data_Aeson_BetterErrors_Internal.hs,v 1.1 2022/02/23 16:08:53 pho Exp $
-
-Fix build with aeson-2.0
-
---- src/Data/Aeson/BetterErrors/Internal.hs.orig       2022-02-20 12:31:25.835056290 +0000
-+++ src/Data/Aeson/BetterErrors/Internal.hs
-@@ -33,7 +33,8 @@ import Data.Vector ((!?))
- import qualified Data.Vector as V
- import Data.Scientific (Scientific)
- import qualified Data.Scientific as S
--import qualified Data.HashMap.Strict as HashMap
-+import Data.Aeson.Key (Key)
-+import qualified Data.Aeson.KeyMap as KeyMap
- 
- import Data.Aeson.BetterErrors.Utils
- 
-@@ -178,7 +179,7 @@ setValue v r = r { rdrValue = v }
- -- Internally, a list of these is maintained as the parser traverses the JSON
- -- data. This list is included in the error if one occurs.
- data PathPiece
--  = ObjectKey Text
-+  = ObjectKey Key
-   | ArrayIndex Int
-   deriving (Show, Eq, Ord)
- 
-@@ -201,7 +202,7 @@ type ParseError' = ParseError Void
- -- but a value of the required type could not be constructed from it, for some
- -- reason.
- data ErrorSpecifics err
--  = KeyMissing Text
-+  = KeyMissing Key
-   | OutOfBounds Int
-   | WrongType JSONType A.Value -- ^ Expected type, actual value
-   | ExpectedIntegral Double
-@@ -369,25 +370,25 @@ perhaps p = do
-     _      -> Just <$> p
- 
- -- | Take the value corresponding to a given key in the current object.
--key :: (Functor m, Monad m) => Text -> ParseT err m a -> ParseT err m a
-+key :: (Functor m, Monad m) => Key -> ParseT err m a -> ParseT err m a
- key k p = key' (badSchema (KeyMissing k)) k p
- 
- -- | Take the value corresponding to a given key in the current object, or
- -- if no property exists with that key, use the supplied default.
--keyOrDefault :: (Functor m, Monad m) => Text -> a -> ParseT err m a -> ParseT err m a
-+keyOrDefault :: (Functor m, Monad m) => Key -> a -> ParseT err m a -> ParseT err m a
- keyOrDefault k def p = key' (pure def) k p
- 
- -- | Take the value corresponding to a given key in the current object, or
- -- if no property exists with that key, return Nothing .
--keyMay :: (Functor m, Monad m) => Text -> ParseT err m a -> ParseT err m (Maybe a)
-+keyMay :: (Functor m, Monad m) => Key -> ParseT err m a -> ParseT err m (Maybe a)
- keyMay k p = keyOrDefault k Nothing (Just <$> p)
- 
--key' :: (Functor m, Monad m) => ParseT err m a -> Text -> ParseT err m a -> ParseT err m a
-+key' :: (Functor m, Monad m) => ParseT err m a -> Key -> ParseT err m a -> ParseT err m a
- key' onMissing k p = do
-   v <- asks rdrValue
-   case v of
-     A.Object obj ->
--      case HashMap.lookup k obj of
-+      case KeyMap.lookup k obj of
-         Just v' ->
-           local (appendPath (ObjectKey k) . setValue v') p
-         Nothing ->
-@@ -433,21 +434,21 @@ eachInArray p = do
- 
- -- | Parse each property in an object with the given parser, given the key as
- -- an argument, and collect the results.
--forEachInObject :: (Functor m, Monad m) => (Text -> ParseT err m a) -> ParseT err m [a]
-+forEachInObject :: (Functor m, Monad m) => (Key -> ParseT err m a) -> ParseT err m [a]
- forEachInObject p = do
--  xs <- HashMap.toList <$> asObject
-+  xs <- KeyMap.toList <$> asObject
-   forM xs $ \(k, x) ->
-     local (appendPath (ObjectKey k) . setValue x) (p k)
- 
- -- | Attempt to parse each property value in the object with the given parser,
- -- and collect the results.
--eachInObject :: (Functor m, Monad m) => ParseT err m a -> ParseT err m [(Text, a)]
-+eachInObject :: (Functor m, Monad m) => ParseT err m a -> ParseT err m [(Key, a)]
- eachInObject = eachInObjectWithKey Right
- 
- -- | Attempt to parse each property in the object: parse the key with the
- -- given validation function, parse the value with the given parser, and
- -- collect the results.
--eachInObjectWithKey :: (Functor m, Monad m) => (Text -> Either err k) -> ParseT err m a -> ParseT err m [(k, a)]
-+eachInObjectWithKey :: (Functor m, Monad m) => (Key -> Either err k) -> ParseT err m a -> ParseT err m [(k, a)]
- eachInObjectWithKey parseKey parseVal = forEachInObject $ \k ->
-   (,) <$> liftEither (parseKey k) <*> parseVal
- 



Home | Main Index | Thread Index | Old Index