aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo-Chuan Hsieh <sunpoet@FreeBSD.org>2024-09-05 05:13:45 +0000
committerPo-Chuan Hsieh <sunpoet@FreeBSD.org>2024-09-05 06:11:16 +0000
commitf09e409e1912e56098612f0891c1098d4ab82ea6 (patch)
tree3e083280cfa24ba10920ebec54bd189fae1f00c5
parent52d5769c206a9638451e127b2602c9aae6b2406e (diff)
devel/p5-Data-Sah-Resolve: Add p5-Data-Sah-Resolve 0.011
Data::Sah::Resolve provides resolve_schema. Sah schemas can be defined in terms of other schemas as base. The resolving process follows the (outermost) base schema until it finds a builtin type as the (innermost) base. It then returns a hash result (a DefHash with v=2) containing the type as well other information like the collected clause sets and others. This routine performs the following steps: 1. Normalize the schema Unless schema_is_normalized option is true, in which case schema is assumed to be normalized already. 2. Check if the schema's type is a builtin type Currently this is done by checking if the module of the name Data::Sah::Type::<type> is loadable. If it is a builtin type then we are done. 3. Check if the schema's type is the name of another schema This is done by checking if Sah::Schema::<name> module exists and is loadable. If this is the case then we retrieve the base schema from the $schema variable in the Sah::Schema::<name> package and repeat the process while accumulating and/or merging the clause sets. 4. If schema's type is neither, we die.
-rw-r--r--devel/Makefile1
-rw-r--r--devel/p5-Data-Sah-Resolve/Makefile28
-rw-r--r--devel/p5-Data-Sah-Resolve/distinfo3
-rw-r--r--devel/p5-Data-Sah-Resolve/pkg-descr20
-rw-r--r--devel/p5-Data-Sah-Resolve/pkg-plist2
5 files changed, 54 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index eb79957e9953..e0db5a09b286 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -2301,6 +2301,7 @@
SUBDIR += p5-Data-Sah-DefaultValue
SUBDIR += p5-Data-Sah-Filter
SUBDIR += p5-Data-Sah-Normalize
+ SUBDIR += p5-Data-Sah-Resolve
SUBDIR += p5-Data-Section
SUBDIR += p5-Data-Section-Simple
SUBDIR += p5-Data-Serializable
diff --git a/devel/p5-Data-Sah-Resolve/Makefile b/devel/p5-Data-Sah-Resolve/Makefile
new file mode 100644
index 000000000000..6a66e72dc007
--- /dev/null
+++ b/devel/p5-Data-Sah-Resolve/Makefile
@@ -0,0 +1,28 @@
+PORTNAME= Data-Sah-Resolve
+PORTVERSION= 0.011
+CATEGORIES= devel perl5
+MASTER_SITES= CPAN
+PKGNAMEPREFIX= p5-
+
+MAINTAINER= sunpoet@FreeBSD.org
+COMMENT= Resolve Sah schema
+WWW= https://metacpan.org/dist/Data-Sah-Resolve
+
+LICENSE= ART10 GPLv1+
+LICENSE_COMB= dual
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+BUILD_DEPENDS= ${RUN_DEPENDS}
+RUN_DEPENDS= p5-Data-ModeMerge>=0:devel/p5-Data-ModeMerge \
+ p5-Data-Sah-Normalize>=0.051:devel/p5-Data-Sah-Normalize
+TEST_DEPENDS= p5-Data-Dmp>=0.241:devel/p5-Data-Dmp \
+ p5-Test-Deep>=0:devel/p5-Test-Deep \
+ p5-Test-Exception>=0:devel/p5-Test-Exception \
+ p5-Test-Needs>=0:devel/p5-Test-Needs
+
+USES= perl5
+USE_PERL5= configure
+
+NO_ARCH= yes
+
+.include <bsd.port.mk>
diff --git a/devel/p5-Data-Sah-Resolve/distinfo b/devel/p5-Data-Sah-Resolve/distinfo
new file mode 100644
index 000000000000..603e81ed8128
--- /dev/null
+++ b/devel/p5-Data-Sah-Resolve/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1724084456
+SHA256 (Data-Sah-Resolve-0.011.tar.gz) = 37e94da1b2178dc85fa7248e0267282cfdbc77c53db308beb4cba90ecc3d5384
+SIZE (Data-Sah-Resolve-0.011.tar.gz) = 20307
diff --git a/devel/p5-Data-Sah-Resolve/pkg-descr b/devel/p5-Data-Sah-Resolve/pkg-descr
new file mode 100644
index 000000000000..009d729207e7
--- /dev/null
+++ b/devel/p5-Data-Sah-Resolve/pkg-descr
@@ -0,0 +1,20 @@
+Data::Sah::Resolve provides resolve_schema. Sah schemas can be defined in terms
+of other schemas as base. The resolving process follows the (outermost) base
+schema until it finds a builtin type as the (innermost) base. It then returns a
+hash result (a DefHash with v=2) containing the type as well other information
+like the collected clause sets and others.
+
+This routine performs the following steps:
+1. Normalize the schema
+ Unless schema_is_normalized option is true, in which case schema is assumed
+ to be normalized already.
+2. Check if the schema's type is a builtin type
+ Currently this is done by checking if the module of the name
+ Data::Sah::Type::<type> is loadable. If it is a builtin type then we are
+ done.
+3. Check if the schema's type is the name of another schema
+ This is done by checking if Sah::Schema::<name> module exists and is
+ loadable. If this is the case then we retrieve the base schema from the
+ $schema variable in the Sah::Schema::<name> package and repeat the process
+ while accumulating and/or merging the clause sets.
+4. If schema's type is neither, we die.
diff --git a/devel/p5-Data-Sah-Resolve/pkg-plist b/devel/p5-Data-Sah-Resolve/pkg-plist
new file mode 100644
index 000000000000..c2fc99d5c41c
--- /dev/null
+++ b/devel/p5-Data-Sah-Resolve/pkg-plist
@@ -0,0 +1,2 @@
+%%SITE_PERL%%/Data/Sah/Resolve.pm
+%%PERL5_MAN3%%/Data::Sah::Resolve.3.gz