namespace_autoclean: new perl module recipe

This commit is contained in:
Joachim Mairböck
2024-10-27 15:07:32 +01:00
parent 1805778b5d
commit 27d1559901

View File

@@ -0,0 +1,64 @@
SUMMARY="Keep imports out of your namespace"
DESCRIPTION="When you import a function into a Perl package, it will naturally also be available \
as a method.
The namespace::autoclean pragma will remove all imported symbols at the end of the current \
package's compile cycle. Functions called in the package itself will still be bound by their \
name, but they won't show up as methods on your class or instances.
This module is very similar to namespace::clean, except it will clean all imported functions, no \
matter if you imported them before or after you used the pragma. It will also not touch anything \
that looks like a method."
HOMEPAGE="https://metacpan.org/pod/namespace::autoclean"
COPYRIGHT="2009 by Florian Ragwitz"
LICENSE="Artistic"
REVISION="1"
SOURCE_URI="https://cpan.metacpan.org/authors/id/E/ET/ETHER/namespace-autoclean-$portVersion.tar.gz"
CHECKSUM_SHA256="d3b32c82e1d2caa9d58b8c8075965240e6cab66ab9350bd6f6bea4ca07e938d6"
SOURCE_DIR="namespace-autoclean-$portVersion"
ARCHITECTURES="any"
PROVIDES="
namespace_autoclean = $portVersion
"
REQUIRES="
haiku
b_hooks_endofscope
namespace_clean
vendor_perl
"
BUILD_REQUIRES="
haiku_devel
"
BUILD_PREREQUIRES="
cmd:make
cmd:perl
"
TEST_REQUIRES="
b_hooks_endofscope
namespace_clean
test_fatal
test_needs
"
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
}