summaryrefslogtreecommitdiff
path: root/converters
diff options
context:
space:
mode:
authorpho <pho@pkgsrc.org>2022-09-06 18:36:43 +0000
committerpho <pho@pkgsrc.org>2022-09-06 18:36:43 +0000
commit64c6ffc5cd84d680084d59be360cb47ca5d67269 (patch)
tree0c54b917b74b40d0b4730f2d1bc4cbfe3bc96060 /converters
parent59f7e8a1f4e6c95b1a3e8b3f737c7725e4977bb2 (diff)
downloadpkgsrc-64c6ffc5cd84d680084d59be360cb47ca5d67269.tar.gz
Update to aeson-better-errors-0.9.1.1
Make compatible with aeson >2.0.0.0
Diffstat (limited to 'converters')
-rw-r--r--converters/hs-aeson-better-errors/Makefile11
-rw-r--r--converters/hs-aeson-better-errors/buildlink3.mk4
-rw-r--r--converters/hs-aeson-better-errors/distinfo9
-rw-r--r--converters/hs-aeson-better-errors/patches/patch-src_Data_Aeson_BetterErrors_Internal.hs91
4 files changed, 14 insertions, 101 deletions
diff --git a/converters/hs-aeson-better-errors/Makefile b/converters/hs-aeson-better-errors/Makefile
index 9e2caf74d62..e841b097cd5 100644
--- a/converters/hs-aeson-better-errors/Makefile
+++ b/converters/hs-aeson-better-errors/Makefile
@@ -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
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 --git a/converters/hs-aeson-better-errors/buildlink3.mk b/converters/hs-aeson-better-errors/buildlink3.mk
index c64f6ef4194..c0177cde13f 100644
--- a/converters/hs-aeson-better-errors/buildlink3.mk
+++ b/converters/hs-aeson-better-errors/buildlink3.mk
@@ -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 @@ BUILDLINK_TREE+= hs-aeson-better-errors
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 --git a/converters/hs-aeson-better-errors/distinfo b/converters/hs-aeson-better-errors/distinfo
index c3b326b9d24..31264f9098f 100644
--- a/converters/hs-aeson-better-errors/distinfo
+++ b/converters/hs-aeson-better-errors/distinfo
@@ -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 --git a/converters/hs-aeson-better-errors/patches/patch-src_Data_Aeson_BetterErrors_Internal.hs b/converters/hs-aeson-better-errors/patches/patch-src_Data_Aeson_BetterErrors_Internal.hs
deleted file mode 100644
index c61fb4ed44f..00000000000
--- a/converters/hs-aeson-better-errors/patches/patch-src_Data_Aeson_BetterErrors_Internal.hs
+++ /dev/null
@@ -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
-