apkbuild-cpan.in: perl and perl-dev as depends and makedepends

fix issue with how perl-dev was added as a makedepends
perl probably should be a dependency of all per modules
This commit is contained in:
Timothy Legge 2020-03-03 23:03:42 +00:00
parent bcbb8979c7
commit 6670e9479d

View File

@ -36,7 +36,7 @@ pkgdesc="Perl module for [% pkgreal %]"
url="https://metacpan.org/release/[% pkgreal %]/"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends=""
depends="perl"
makedepends="perl-dev"
checkdepends=""
subpackages="$pkgname-doc"
@ -272,6 +272,11 @@ sub do_depends {
say "License: $license";
my $deps = parse_deps $meta->effective_prereqs->requirements_for('runtime', 'requires');
if ($deps eq '') {
$deps = "perl";
} else {
$deps = "perl " . $deps;
}
say "CPAN deps: $deps";
say "Recommend: " . parse_deps $meta->effective_prereqs->requirements_for('runtime', 'recommends');
@ -281,6 +286,11 @@ sub do_depends {
$meta->effective_prereqs->requirements_for('build', 'requires'),
$meta->effective_prereqs->requirements_for('build', 'recommends')
);
if ($makedeps eq '') {
$makedeps = "perl-dev";
} else {
$makedeps = "perl-dev " . $makedeps;
}
say "CPAN build deps: $makedeps";
say "CPAN requires: " . parse_deps($meta->effective_prereqs->requirements_for('configure', 'requires'), $meta->effective_prereqs->requirements_for('build', 'requires'));
say "CPAN recommends: " . parse_deps($meta->effective_prereqs->requirements_for('configure', 'recommends'), $meta->effective_prereqs->requirements_for('build', 'recommends'));
@ -305,7 +315,7 @@ sub do_depends {
$text =~ s/(license=.*\n)/$1depends=\"$deps\"\n/gm or
die "Can't insert depends line in APKBUILD";
$text =~ s/^makedepends=\"([^\"]*)\"$/makedepends=\"perl-dev $makedeps\"/mg or
$text =~ s/^makedepends=\"([^\"]*)\"$/makedepends=\"$makedeps\"/mg or
$text =~ s/(depends=.*\n)/$1makedepends=\"$makedeps\"\n/gm or
die "Can't insert makedepends line in APKBUILD";