git: e860bee50849 - main - devel/p5-failures: Add p5-failures 0.004

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Tue, 28 Jan 2025 17:06:02 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e860bee508490c45f0223eab775af8a9ef595638

commit e860bee508490c45f0223eab775af8a9ef595638
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2025-01-28 16:48:45 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2025-01-28 16:48:45 +0000

    devel/p5-failures: Add p5-failures 0.004
    
    This module lets you define an exception hierarchy quickly and simply.
    
    Here were my design goals:
    - minimalist interface
    - 80% of features in 20% of lines of code
    - depend only on core modules (nearly achieved)
    - support hierarchical error types
    - identify errors types by name (class) not by parsing strings
    - leave (possibly expensive) trace decisions to the thrower
    
    Currently, failures is implemented in under 70 lines of code.
    
    Failure objects are implemented with Class::Tiny to allow easy subclassing (see
    custom::failures), but Class::Tiny only requires core modules, so other than
    that exception, the 'core only' goal is achieved.
---
 devel/Makefile              |  1 +
 devel/p5-failures/Makefile  | 23 +++++++++++++++++++++++
 devel/p5-failures/distinfo  |  3 +++
 devel/p5-failures/pkg-descr | 15 +++++++++++++++
 devel/p5-failures/pkg-plist |  4 ++++
 5 files changed, 46 insertions(+)

diff --git a/devel/Makefile b/devel/Makefile
index 1f84ec4d1c7f..578c043a9fb2 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -3963,6 +3963,7 @@
     SUBDIR += p5-enum
     SUBDIR += p5-ex-lib
     SUBDIR += p5-experimental
+    SUBDIR += p5-failures
     SUBDIR += p5-forks
     SUBDIR += p5-github_creator
     SUBDIR += p5-goto-file
diff --git a/devel/p5-failures/Makefile b/devel/p5-failures/Makefile
new file mode 100644
index 000000000000..7dd8babb7df1
--- /dev/null
+++ b/devel/p5-failures/Makefile
@@ -0,0 +1,23 @@
+PORTNAME=	failures
+PORTVERSION=	0.004
+CATEGORIES=	devel perl5
+MASTER_SITES=	CPAN
+MASTER_SITE_SUBDIR=	CPAN:DAGOLDEN
+PKGNAMEPREFIX=	p5-
+
+MAINTAINER=	sunpoet@FreeBSD.org
+COMMENT=	Minimalist exception hierarchy generator
+WWW=		https://metacpan.org/dist/failures
+
+LICENSE=	APACHE20
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	${RUN_DEPENDS}
+RUN_DEPENDS=	p5-Class-Tiny>=0:devel/p5-Class-Tiny
+
+USES=		perl5
+USE_PERL5=	configure
+
+NO_ARCH=	yes
+
+.include <bsd.port.mk>
diff --git a/devel/p5-failures/distinfo b/devel/p5-failures/distinfo
new file mode 100644
index 000000000000..2c936dacf3b8
--- /dev/null
+++ b/devel/p5-failures/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1736671125
+SHA256 (failures-0.004.tar.gz) = fd2ca702402f22f5185b12942b5079bf95ad21cde3b97a7cf2e1919147463270
+SIZE (failures-0.004.tar.gz) = 19646
diff --git a/devel/p5-failures/pkg-descr b/devel/p5-failures/pkg-descr
new file mode 100644
index 000000000000..93f66711baea
--- /dev/null
+++ b/devel/p5-failures/pkg-descr
@@ -0,0 +1,15 @@
+This module lets you define an exception hierarchy quickly and simply.
+
+Here were my design goals:
+- minimalist interface
+- 80% of features in 20% of lines of code
+- depend only on core modules (nearly achieved)
+- support hierarchical error types
+- identify errors types by name (class) not by parsing strings
+- leave (possibly expensive) trace decisions to the thrower
+
+Currently, failures is implemented in under 70 lines of code.
+
+Failure objects are implemented with Class::Tiny to allow easy subclassing (see
+custom::failures), but Class::Tiny only requires core modules, so other than
+that exception, the 'core only' goal is achieved.
diff --git a/devel/p5-failures/pkg-plist b/devel/p5-failures/pkg-plist
new file mode 100644
index 000000000000..c041632fabd1
--- /dev/null
+++ b/devel/p5-failures/pkg-plist
@@ -0,0 +1,4 @@
+%%SITE_PERL%%/custom/failures.pm
+%%SITE_PERL%%/failures.pm
+%%PERL5_MAN3%%/custom::failures.3.gz
+%%PERL5_MAN3%%/failures.3.gz