diff --git a/internal/rosa/perl.go b/internal/rosa/perl.go index 93dc0de1..f321b20d 100644 --- a/internal/rosa/perl.go +++ b/internal/rosa/perl.go @@ -10,50 +10,38 @@ import ( // Perl is the perl interpreter used by [MakeMakerHelper]. var Perl = H("perl") -// newViaPerlModuleBuild installs a perl module via Build.PL. -func (t Toolchain) newViaPerlModuleBuild( - name, version string, - source pkg.Artifact, - patches []KV, - extra ...ArtifactH, -) pkg.Artifact { - if name == "" || version == "" { - panic("names must be non-empty") - } - return t.New("perl-"+name, 0, t.Append(nil, - slices.Concat(P{Perl}, extra)..., - ), nil, nil, ` -cd /usr/src/`+name+` -perl Build.PL --prefix=/system -./Build build -./Build test -./Build install --destdir=/work -`, pkg.Path(AbsUsrSrc.Append(name), true, t.NewPatchedSource( - "perl-"+name, version, source, false, patches..., - ))) -} - -func (t Toolchain) newPerlModuleBuild() (pkg.Artifact, string) { +func init() { const ( version = "0.4234" checksum = "ZKxEFG4hE1rqZt52zBL2LRZBMkYzhjb5-cTBXcsyA52EbPeeYyVxU176yAea8-Di" ) - return t.newViaPerlModuleBuild("Module-Build", version, newTar( - "https://cpan.metacpan.org/authors/id/L/LE/LEONT/"+ - "Module-Build-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), nil), version -} -func init() { - native.mustRegister(Toolchain.newPerlModuleBuild, &Metadata{ + meta := Metadata{ Name: "perl-Module::Build", Description: "build and install Perl modules", Website: "https://metacpan.org/release/Module-Build", + Version: version, Dependencies: P{ Perl, }, + } + native.MustRegister(meta.Name, func(t Toolchain) (*Metadata, pkg.Artifact) { + return &meta, t.New(meta.Name, 0, t.Append(nil, + Perl, + ), nil, nil, ` +cd /usr/src/Module-Build +perl Build.PL --prefix=/system +./Build build +./Build test +./Build install --destdir=/work +`, pkg.Path(AbsUsrSrc.Append("Module-Build"), true, t.NewPatchedSource( + meta.Name, version, newFromCPAN( + "LEONT", + "Module-Build", + version, + checksum, + ), false, + ))) }) }