Skip to content

Commit

Permalink
add generic perl recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
jmairboeck committed Oct 26, 2024
1 parent 7152e05 commit 4ffc7d2
Show file tree
Hide file tree
Showing 3 changed files with 195 additions and 0 deletions.
71 changes: 71 additions & 0 deletions generic/generic_perl-1.23.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
SUMMARY="Short description of ProjectX"
DESCRIPTION="Long ProjectX description.
Spanning several paragraphs, maybe
- containing
- bullet points etc.
You can also have really long lines that do not fit in 100 characters and use a backslash to \
wrap the line."
HOMEPAGE="https://metacpan.org/pod/Project::X"
COPYRIGHT="2014 Developer name
2016 Another developer's name"
LICENSE="MIT
GNU GPL v2"
REVISION="1"
SOURCE_URI="https://cpan.metacpan.org/authors/id/A/AU/AUTHOR/Project-X-$portVersion.tar.gz"
CHECKSUM_SHA256="000000000000000000000000000000000"
SOURCE_DIR="Project-X-$portVersion"
PATCHES="project_x-$portVersion.patchset"
ADDITIONAL_FILES="projectx.rdef"

ARCHITECTURES="any"

PROVIDES="
project_x = $portVersion
cmd:projectx = $portVersion # only some packages provide commands
"
REQUIRES="
haiku
vendor_perl
some_other_perl_package
"

BUILD_REQUIRES="
haiku_devel
# Guideline: Don't add requirements other than configure and build requirements here.
# Makefile.PL may print warnings about missing dependencies, but they aren't required at
# build time. Runtime requirements should be added to REQUIRES and TEST_REQUIRES instead.
"
BUILD_PREREQUIRES="
cmd:make
cmd:perl
"

TEST_REQUIRES="
some_other_perl_package
some_test_requirement
"

BUILD()
{
perl Makefile.PL PREFIX=$prefix
make
}

INSTALL()
{
make pure_install

# remove architecture-specific files
# Explanation: Otherwise, this wouldn't be a valid "any" package. Only .packlist and other
# unneeded files should be removed. If there is anything else in the vendorarch directory
# (i.e. lib/perl5/vendor_perl/$perlVersion/$perlArch), make the package architecture-dependent
# instead (see generic_perl_xs.recipe).
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
}
63 changes: 63 additions & 0 deletions generic/generic_perl_module_build-1.23.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
SUMMARY="Short description of ProjectX"
DESCRIPTION="Long ProjectX description.
Spanning several paragraphs, maybe
- containing
- bullet points etc.
You can also have really long lines that do not fit in 100 characters and use a backslash to \
wrap the line."
HOMEPAGE="https://metacpan.org/pod/Project::X"
COPYRIGHT="2014 Developer name
2016 Another developer's name"
LICENSE="MIT
GNU GPL v2"
REVISION="1"
SOURCE_URI="https://cpan.metacpan.org/authors/id/A/AU/AUTHOR/Project-X-$portVersion.tar.gz"
CHECKSUM_SHA256="000000000000000000000000000000000"
SOURCE_DIR="Project-X-$portVersion"
PATCHES="project_x-$portVersion.patchset"
ADDITIONAL_FILES="projectx.rdef"

ARCHITECTURES="any"

PROVIDES="
project_x = $portVersion
"
REQUIRES="
haiku
vendor_perl
some_other_perl_package
"

BUILD_REQUIRES="
haiku_devel
module_build
"
BUILD_PREREQUIRES="
cmd:perl
"

TEST_REQUIRES="
some_other_perl_package
some_test_requirement
"

BUILD()
{
perl Build.PL --installdirs vendor --prefix $prefix
./Build
}

INSTALL()
{
./Build 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()
{
./Build test
}
61 changes: 61 additions & 0 deletions generic/generic_perl_xs-1.23.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
SUMMARY="Short description of ProjectX"
DESCRIPTION="Long ProjectX description.
Spanning several paragraphs, maybe
- containing
- bullet points etc.
You can also have really long lines that do not fit in 100 characters and use a backslash to \
wrap the line."
HOMEPAGE="https://metacpan.org/pod/Project::X::XS"
COPYRIGHT="2014 Developer name
2016 Another developer's name"
LICENSE="MIT
GNU GPL v2"
REVISION="1"
SOURCE_URI="https://cpan.metacpan.org/authors/id/A/AU/AUTHOR/Project-X-XS-$portVersion.tar.gz"
CHECKSUM_SHA256="000000000000000000000000000000000"
SOURCE_DIR="Project-X-XS-$portVersion"
PATCHES="project_x_xs-$portVersion.patchset"
ADDITIONAL_FILES="projectx.rdef"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
project_x_xs$secondaryArchSuffix = $portVersion
"
if [ -n "$secondaryArchSuffix" ]; then
PROVIDES+="
project_x_xs = $portVersion
"
fi
REQUIRES="
haiku$secondaryArchSuffix
vendor_perl
lib:libfoo$secondaryArchSuffix
"

BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libfoo$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:make
cmd:perl
"

BUILD()
{
perl Makefile.PL PREFIX=$prefix
make
}

INSTALL()
{
make pure_install
}

TEST()
{
make test
}

0 comments on commit 4ffc7d2

Please sign in to comment.