diff options
author | pho <pho@pkgsrc.org> | 2022-02-23 16:09:43 +0000 |
---|---|---|
committer | pho <pho@pkgsrc.org> | 2022-02-23 16:09:43 +0000 |
commit | c047c17b9f07222a0709b20a87299def8a99e17e (patch) | |
tree | a4c48f02099979680f828cb230e90dc0b7d67d87 /www | |
parent | 5026a3d249364569b8663ded1f24b10dc5eb40e8 (diff) | |
download | pkgsrc-c047c17b9f07222a0709b20a87299def8a99e17e.tar.gz |
www/hs-bower-json: import hs-bower-json-1.0.0.1
Bower is a package manager for the web (see http://bower.io). This package
provides a data type and ToJSON/FromJSON instances for Bower's package
manifest file, bower.json.
Diffstat (limited to 'www')
-rw-r--r-- | www/hs-bower-json/DESCR | 3 | ||||
-rw-r--r-- | www/hs-bower-json/Makefile | 16 | ||||
-rw-r--r-- | www/hs-bower-json/PLIST | 22 | ||||
-rw-r--r-- | www/hs-bower-json/buildlink3.mk | 19 | ||||
-rw-r--r-- | www/hs-bower-json/distinfo | 6 | ||||
-rw-r--r-- | www/hs-bower-json/patches/patch-src_Web_Bower_PackageMeta_Internal.hs | 52 |
6 files changed, 118 insertions, 0 deletions
diff --git a/www/hs-bower-json/DESCR b/www/hs-bower-json/DESCR new file mode 100644 index 00000000000..063253187a1 --- /dev/null +++ b/www/hs-bower-json/DESCR @@ -0,0 +1,3 @@ +Bower is a package manager for the web (see http://bower.io). This package +provides a data type and ToJSON/FromJSON instances for Bower's package +manifest file, bower.json. diff --git a/www/hs-bower-json/Makefile b/www/hs-bower-json/Makefile new file mode 100644 index 00000000000..a09eb68a079 --- /dev/null +++ b/www/hs-bower-json/Makefile @@ -0,0 +1,16 @@ +# $NetBSD: Makefile,v 1.1 2022/02/23 16:09:43 pho Exp $ + +DISTNAME= bower-json-1.0.0.1 +CATEGORIES= www + +MAINTAINER= pkgsrc-users@NetBSD.org +COMMENT= Components of paths +LICENSE= modified-bsd + +.include "../../converters/hs-aeson/buildlink3.mk" +.include "../../converters/hs-aeson-better-errors/buildlink3.mk" +.include "../../math/hs-scientific/buildlink3.mk" +.include "../../devel/hs-unordered-containers/buildlink3.mk" +.include "../../devel/hs-vector/buildlink3.mk" +.include "../../mk/haskell.mk" +.include "../../mk/bsd.pkg.mk" diff --git a/www/hs-bower-json/PLIST b/www/hs-bower-json/PLIST new file mode 100644 index 00000000000..a40b5a470f9 --- /dev/null +++ b/www/hs-bower-json/PLIST @@ -0,0 +1,22 @@ +@comment $NetBSD: PLIST,v 1.1 2022/02/23 16:09:43 pho Exp $ +lib/bower-json-${PKGVERSION}/${HS_VERSION}/package-description +lib/bower-json-${PKGVERSION}/${HS_VERSION}/package-id +lib/${HS_PLATFORM}/${HS_PKGID}/Web/Bower/PackageMeta.dyn_hi +lib/${HS_PLATFORM}/${HS_PKGID}/Web/Bower/PackageMeta.hi +lib/${HS_PLATFORM}/${HS_PKGID}/Web/Bower/PackageMeta.p_hi +lib/${HS_PLATFORM}/${HS_PKGID}/Web/Bower/PackageMeta/Internal.dyn_hi +lib/${HS_PLATFORM}/${HS_PKGID}/Web/Bower/PackageMeta/Internal.hi +lib/${HS_PLATFORM}/${HS_PKGID}/Web/Bower/PackageMeta/Internal.p_hi +lib/${HS_PLATFORM}/${HS_PKGID}/libHS${HS_PKGID}.a +lib/${HS_PLATFORM}/${HS_PKGID}/libHS${HS_PKGID}_p.a +lib/${HS_PLATFORM}/libHS${HS_PKGID}-${HS_VER}.so +share/doc/${HS_PLATFORM}/bower-json-${PKGVERSION}/LICENSE +share/doc/${HS_PLATFORM}/bower-json-${PKGVERSION}/html/Web-Bower-PackageMeta.html +share/doc/${HS_PLATFORM}/bower-json-${PKGVERSION}/html/bower-json.haddock +share/doc/${HS_PLATFORM}/bower-json-${PKGVERSION}/html/doc-index.html +share/doc/${HS_PLATFORM}/bower-json-${PKGVERSION}/html/haddock-bundle.min.js +share/doc/${HS_PLATFORM}/bower-json-${PKGVERSION}/html/index.html +share/doc/${HS_PLATFORM}/bower-json-${PKGVERSION}/html/linuwial.css +share/doc/${HS_PLATFORM}/bower-json-${PKGVERSION}/html/meta.json +share/doc/${HS_PLATFORM}/bower-json-${PKGVERSION}/html/quick-jump.css +share/doc/${HS_PLATFORM}/bower-json-${PKGVERSION}/html/synopsis.png diff --git a/www/hs-bower-json/buildlink3.mk b/www/hs-bower-json/buildlink3.mk new file mode 100644 index 00000000000..1db88b3ee55 --- /dev/null +++ b/www/hs-bower-json/buildlink3.mk @@ -0,0 +1,19 @@ +# $NetBSD: buildlink3.mk,v 1.1 2022/02/23 16:09:43 pho Exp $ + +BUILDLINK_TREE+= hs-bower-json + +.if !defined(HS_BOWER_JSON_BUILDLINK3_MK) +HS_BOWER_JSON_BUILDLINK3_MK:= + +BUILDLINK_API_DEPENDS.hs-bower-json+= hs-bower-json>=1.0.0 +BUILDLINK_ABI_DEPENDS.hs-bower-json+= hs-bower-json>=1.0.0.1 +BUILDLINK_PKGSRCDIR.hs-bower-json?= ../../www/hs-bower-json + +.include "../../converters/hs-aeson/buildlink3.mk" +.include "../../converters/hs-aeson-better-errors/buildlink3.mk" +.include "../../math/hs-scientific/buildlink3.mk" +.include "../../devel/hs-unordered-containers/buildlink3.mk" +.include "../../devel/hs-vector/buildlink3.mk" +.endif # HS_BOWER_JSON_BUILDLINK3_MK + +BUILDLINK_TREE+= -hs-bower-json diff --git a/www/hs-bower-json/distinfo b/www/hs-bower-json/distinfo new file mode 100644 index 00000000000..c826cd782be --- /dev/null +++ b/www/hs-bower-json/distinfo @@ -0,0 +1,6 @@ +$NetBSD: distinfo,v 1.1 2022/02/23 16:09:43 pho Exp $ + +BLAKE2s (bower-json-1.0.0.1.tar.gz) = bd8a3e94a160cbfcd959c1b3c026b660472af241a40790d466d8f718f0733e99 +SHA512 (bower-json-1.0.0.1.tar.gz) = 809a3b7b2653dc23e9704ab38ae446663a23edf071a72134de0da24dfeeaa8e714e565ba6429949bb4507e49e24cbeaaba1547a517b8fff6f35be619fb121928 +Size (bower-json-1.0.0.1.tar.gz) = 6721 bytes +SHA1 (patch-src_Web_Bower_PackageMeta_Internal.hs) = 7f1eb26db7c12649556e8183b5ed734d01c77096 diff --git a/www/hs-bower-json/patches/patch-src_Web_Bower_PackageMeta_Internal.hs b/www/hs-bower-json/patches/patch-src_Web_Bower_PackageMeta_Internal.hs new file mode 100644 index 00000000000..879c26eef46 --- /dev/null +++ b/www/hs-bower-json/patches/patch-src_Web_Bower_PackageMeta_Internal.hs @@ -0,0 +1,52 @@ +$NetBSD: patch-src_Web_Bower_PackageMeta_Internal.hs,v 1.1 2022/02/23 16:09:43 pho Exp $ + +Fix build with aeson-2.0 + +--- src/Web/Bower/PackageMeta/Internal.hs.orig 2016-12-25 00:06:09.000000000 +0000 ++++ src/Web/Bower/PackageMeta/Internal.hs +@@ -29,6 +29,7 @@ import qualified Data.ByteString.Lazy as + import Data.Aeson ((.=)) + import qualified Data.Aeson as A + import qualified Data.Aeson.Types as Aeson ++import qualified Data.Aeson.Key as Key + import Data.Aeson.BetterErrors (Parse, ParseError, asText, asString, asBool, eachInArray, eachInObjectWithKey, withText, key, keyMay, keyOrDefault, toAesonParser', toAesonParser, displayError, parse) + + --------------------- +@@ -222,7 +223,7 @@ asPackageMeta = + + asAssocListOf :: (Text -> a) -> Parse BowerError [(PackageName, a)] + asAssocListOf g = +- eachInObjectWithKey parsePackageName (g <$> asText) ++ eachInObjectWithKey (parsePackageName . Key.toText) (g <$> asText) + + parseModuleType :: Text -> Either BowerError ModuleType + parseModuleType str = +@@ -301,8 +302,8 @@ instance A.ToJSON PackageMeta where + ] + + where +- assoc :: A.ToJSON a => Text -> [(PackageName, a)] -> [Aeson.Pair] +- assoc = maybeArrayAssocPair runPackageName ++ assoc :: A.ToJSON a => Aeson.Key -> [(PackageName, a)] -> [Aeson.Pair] ++ assoc = maybeArrayAssocPair (Key.fromText . runPackageName) + + instance A.ToJSON PackageName where + toJSON = A.toJSON . runPackageName +@@ -329,14 +330,14 @@ instance A.ToJSON Version where + instance A.ToJSON VersionRange where + toJSON = A.toJSON . runVersionRange + +-maybePair :: A.ToJSON a => Text -> Maybe a -> [Aeson.Pair] ++maybePair :: A.ToJSON a => Aeson.Key -> Maybe a -> [Aeson.Pair] + maybePair k = maybe [] (\val -> [k .= val]) + +-maybeArrayPair :: A.ToJSON a => Text -> [a] -> [Aeson.Pair] ++maybeArrayPair :: A.ToJSON a => Aeson.Key -> [a] -> [Aeson.Pair] + maybeArrayPair _ [] = [] + maybeArrayPair k xs = [k .= xs] + +-maybeArrayAssocPair :: A.ToJSON b => (a -> Text) -> Text -> [(a,b)] -> [Aeson.Pair] ++maybeArrayAssocPair :: A.ToJSON b => (a -> Aeson.Key) -> Aeson.Key -> [(a,b)] -> [Aeson.Pair] + maybeArrayAssocPair _ _ [] = [] + maybeArrayAssocPair f k xs = [k .= A.object (map (\(k', v) -> f k' .= v) xs)] + |