git: d7205eef7e02 - main - devel/p5-FFI-Platypus-Type-PtrObject: Add p5-FFI-Platypus-Type-PtrObject 0.03
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 03 Oct 2022 02:24:26 UTC
The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=d7205eef7e029561250a5db8d4482fbfbb826a5a commit d7205eef7e029561250a5db8d4482fbfbb826a5a Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org> AuthorDate: 2022-10-03 02:10:14 +0000 Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org> CommitDate: 2022-10-03 02:10:14 +0000 devel/p5-FFI-Platypus-Type-PtrObject: Add p5-FFI-Platypus-Type-PtrObject 0.03 FFI::Platypus::Type::PtrObject is a helper type for FFI::Platypus that handles type checking for the common pattern where a Perl class is a simple wrapper around an opaque pointer. The class should be implemented as a hash reference, and the pointer itself is expected to be stored on the ptr key. If the caller of the interface (Perl) is responsible for cleaning up the memory, then it normally should be done in the DESTROY method (as above). If you do not pass in the correct type, it will be detected before the C code is called and an exception will be thrown. (otherwise you would probably get a segment violation SEGV). --- devel/Makefile | 1 + devel/p5-FFI-Platypus-Type-PtrObject/Makefile | 26 ++++++++++++++++++++++++++ devel/p5-FFI-Platypus-Type-PtrObject/distinfo | 3 +++ devel/p5-FFI-Platypus-Type-PtrObject/pkg-descr | 10 ++++++++++ devel/p5-FFI-Platypus-Type-PtrObject/pkg-plist | 2 ++ 5 files changed, 42 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index 0bf18de42412..177ec1acc79a 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -2379,6 +2379,7 @@ SUBDIR += p5-FFI-Platypus SUBDIR += p5-FFI-Platypus-Declare SUBDIR += p5-FFI-Platypus-Type-Enum + SUBDIR += p5-FFI-Platypus-Type-PtrObject SUBDIR += p5-FSA-Rules SUBDIR += p5-Feature-Compat-Try SUBDIR += p5-Fennec-Lite diff --git a/devel/p5-FFI-Platypus-Type-PtrObject/Makefile b/devel/p5-FFI-Platypus-Type-PtrObject/Makefile new file mode 100644 index 000000000000..f2fba86389f9 --- /dev/null +++ b/devel/p5-FFI-Platypus-Type-PtrObject/Makefile @@ -0,0 +1,26 @@ +PORTNAME= FFI-Platypus-Type-PtrObject +PORTVERSION= 0.03 +CATEGORIES= devel perl5 +MASTER_SITES= CPAN +PKGNAMEPREFIX= p5- + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Platypus custom type for an object wrapped around an opaque pointer +WWW= https://metacpan.org/dist/FFI-Platypus-Type-PtrObject + +LICENSE= ART10 GPLv1+ +LICENSE_COMB= dual +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${RUN_DEPENDS} +RUN_DEPENDS= p5-FFI-Platypus>=1.11:devel/p5-FFI-Platypus \ + p5-Ref-Util>=0:devel/p5-Ref-Util +TEST_DEPENDS= p5-Test2-Suite>=0.000060:devel/p5-Test2-Suite \ + p5-Test2-Tools-FFI>=0:devel/p5-Test2-Tools-FFI + +USES= perl5 +USE_PERL5= configure + +NO_ARCH= yes + +.include <bsd.port.mk> diff --git a/devel/p5-FFI-Platypus-Type-PtrObject/distinfo b/devel/p5-FFI-Platypus-Type-PtrObject/distinfo new file mode 100644 index 000000000000..95d351a65856 --- /dev/null +++ b/devel/p5-FFI-Platypus-Type-PtrObject/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1663672726 +SHA256 (FFI-Platypus-Type-PtrObject-0.03.tar.gz) = e1e94907ef90b40360a9a6c03d295a13047d4f6c9b56acaf1df2b54d17307f74 +SIZE (FFI-Platypus-Type-PtrObject-0.03.tar.gz) = 17374 diff --git a/devel/p5-FFI-Platypus-Type-PtrObject/pkg-descr b/devel/p5-FFI-Platypus-Type-PtrObject/pkg-descr new file mode 100644 index 000000000000..2eea837446c6 --- /dev/null +++ b/devel/p5-FFI-Platypus-Type-PtrObject/pkg-descr @@ -0,0 +1,10 @@ +FFI::Platypus::Type::PtrObject is a helper type for FFI::Platypus that handles +type checking for the common pattern where a Perl class is a simple wrapper +around an opaque pointer. The class should be implemented as a hash reference, +and the pointer itself is expected to be stored on the ptr key. If the caller of +the interface (Perl) is responsible for cleaning up the memory, then it normally +should be done in the DESTROY method (as above). + +If you do not pass in the correct type, it will be detected before the C code is +called and an exception will be thrown. (otherwise you would probably get a +segment violation SEGV). diff --git a/devel/p5-FFI-Platypus-Type-PtrObject/pkg-plist b/devel/p5-FFI-Platypus-Type-PtrObject/pkg-plist new file mode 100644 index 000000000000..c38e399395e9 --- /dev/null +++ b/devel/p5-FFI-Platypus-Type-PtrObject/pkg-plist @@ -0,0 +1,2 @@ +%%SITE_PERL%%/FFI/Platypus/Type/PtrObject.pm +%%PERL5_MAN3%%/FFI::Platypus::Type::PtrObject.3.gz