scope_guard: new perl module recipe

This commit is contained in:
Joachim Mairböck
2024-10-27 21:32:19 +01:00
parent bd0077ccf7
commit cc52c1d81f

View File

@@ -0,0 +1,52 @@
SUMMARY="Lexically-scoped resource management"
DESCRIPTION="This module provides a convenient way to perform cleanup or other forms of resource \
management at the end of a scope. It is particularly useful when dealing with exceptions: the \
Scope::Guard constructor takes a reference to a subroutine that is guaranteed to be called even \
if the thread of execution is aborted prematurely. This effectively allows lexically-scoped \
\"promises\" to be made that are automatically honoured by perl's garbage collector."
HOMEPAGE="https://metacpan.org/pod/Scope::Guard"
COPYRIGHT="2005-2015, chocolateboy"
LICENSE="Artistic"
REVISION="1"
SOURCE_URI="https://cpan.metacpan.org/authors/id/C/CH/CHOCOLATE/Scope-Guard-$portVersion.tar.gz"
CHECKSUM_SHA256="8c9b1bea5c56448e2c3fadc65d05be9e4690a3823a80f39d2f10fdd8f777d278"
SOURCE_DIR="Scope-Guard-$portVersion"
ARCHITECTURES="any"
PROVIDES="
scope_guard = $portVersion
"
REQUIRES="
haiku
vendor_perl
"
BUILD_REQUIRES="
haiku_devel
"
BUILD_PREREQUIRES="
cmd:make
cmd:perl
"
BUILD()
{
perl Makefile.PL PREFIX=$prefix
make
}
INSTALL()
{
make pure_install
# remove architecture-specific files
cd $prefix
rm -r $(perl -V:vendorarch | cut -d\' -f2 | cut -d/ -f5-)
# cut extracts the quoted string and strips the prefix (which is perl's and not ours)
}
TEST()
{
make test
}