diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-05-17 13:07:12 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-05-17 15:56:53 +0900 |
| commit | 30eb0d6a613ad268f6805ccbcdcabf158e7f526f (patch) | |
| tree | 07e55baa52748fd139e183017eeb43f5f64cee59 /internal/rosa/perl.go | |
| parent | c2ff9c9fa55ea569a5e70ee90d2eb0b2ee2a0540 (diff) | |
internal/rosa: key metadata by string
For upcoming azalea integration. The API is quite ugly right now to ease migration.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/perl.go')
| -rw-r--r-- | internal/rosa/perl.go | 112 |
1 files changed, 57 insertions, 55 deletions
diff --git a/internal/rosa/perl.go b/internal/rosa/perl.go index 43c85114..0ebc4037 100644 --- a/internal/rosa/perl.go +++ b/internal/rosa/perl.go @@ -7,12 +7,12 @@ import ( "hakurei.app/internal/pkg" ) -func (t Toolchain) newPerl() (pkg.Artifact, string) { +func (t Toolchain) newPerl(s *S) (pkg.Artifact, string) { const ( version = "5.42.2" checksum = "Me_xFfgkRnVyG0sE6a74TktK2OUq9Z1LVJNEu_9RdZG3S2fbjfzNiuk2SJqHAgbm" ) - return t.NewPackage("perl", version, newTar( + return s.NewPackage(t, "perl", version, newTar( "https://www.cpan.org/src/5.0/perl-"+version+".tar.gz", checksum, pkg.TarGzip, @@ -50,7 +50,7 @@ chmod +w /system/bin && rm -f /system/bin/ps # perl does not like toybox ps }), version } func init() { - artifactsM[Perl] = Metadata{ + native.MustRegister(&Artifact{ f: Toolchain.newPerl, Name: "perl", @@ -61,20 +61,21 @@ func init() { // odd-even versioning latest: (*Versions).getStable, - } + }) } // newViaPerlModuleBuild installs a perl module via Build.PL. -func (t Toolchain) newViaPerlModuleBuild( +func (s *S) newViaPerlModuleBuild( + t Toolchain, name, version string, source pkg.Artifact, patches []KV, - extra ...PArtifact, + extra ...ArtifactH, ) pkg.Artifact { if name == "" || version == "" { panic("names must be non-empty") } - return t.New("perl-"+name, 0, t.AppendPresets(nil, + return s.New(t, "perl-"+name, 0, s.AppendPresets(t, nil, slices.Concat(P{Perl}, extra)..., ), nil, nil, ` cd /usr/src/`+name+` @@ -82,17 +83,17 @@ perl Build.PL --prefix=/system ./Build build ./Build test ./Build install --destdir=/work -`, pkg.Path(AbsUsrSrc.Append(name), true, t.NewPatchedSource( +`, pkg.Path(AbsUsrSrc.Append(name), true, s.NewPatchedSource(t, "perl-"+name, version, source, false, patches..., ))) } -func (t Toolchain) newPerlModuleBuild() (pkg.Artifact, string) { +func (t Toolchain) newPerlModuleBuild(s *S) (pkg.Artifact, string) { const ( version = "0.4234" checksum = "ZKxEFG4hE1rqZt52zBL2LRZBMkYzhjb5-cTBXcsyA52EbPeeYyVxU176yAea8-Di" ) - return t.newViaPerlModuleBuild("Module-Build", version, newTar( + return s.newViaPerlModuleBuild(t, "Module-Build", version, newTar( "https://cpan.metacpan.org/authors/id/L/LE/LEONT/"+ "Module-Build-"+version+".tar.gz", checksum, @@ -100,7 +101,7 @@ func (t Toolchain) newPerlModuleBuild() (pkg.Artifact, string) { ), nil), version } func init() { - artifactsM[PerlModuleBuild] = Metadata{ + native.MustRegister(&Artifact{ f: Toolchain.newPerlModuleBuild, Name: "perl-Module::Build", @@ -110,17 +111,18 @@ func init() { Dependencies: P{ Perl, }, - } + }) } // newViaPerlMakeMaker installs a perl module via Makefile.PL. -func (t Toolchain) newViaPerlMakeMaker( +func (s *S) newViaPerlMakeMaker( + t Toolchain, name, version string, source pkg.Artifact, patches []KV, - extra ...PArtifact, + extra ...ArtifactH, ) pkg.Artifact { - return t.NewPackage("perl-"+name, version, source, &PackageAttr{ + return s.NewPackage(t, "perl-"+name, version, source, &PackageAttr{ // uses source tree as scratch space Writable: true, Chmod: true, @@ -141,12 +143,12 @@ func (t Toolchain) newViaPerlMakeMaker( })...) } -func (t Toolchain) newPerlLocaleGettext() (pkg.Artifact, string) { +func (t Toolchain) newPerlLocaleGettext(s *S) (pkg.Artifact, string) { const ( version = "1.07" checksum = "cFq4BKFD1MWSoa7lsrPjpdo9kzPqd0jlRcBFUyL1L1isw8m3D_Sge_ff0MAu_9J3" ) - return t.newViaPerlMakeMaker("Locale::gettext", version, newFromCPAN( + return s.newViaPerlMakeMaker(t, "Locale::gettext", version, newFromCPAN( "PVANDRY", "Locale-gettext", version, @@ -154,7 +156,7 @@ func (t Toolchain) newPerlLocaleGettext() (pkg.Artifact, string) { ), nil), version } func init() { - artifactsM[PerlLocaleGettext] = Metadata{ + native.MustRegister(&Artifact{ f: Toolchain.newPerlLocaleGettext, Name: "perl-Locale::gettext", @@ -162,15 +164,15 @@ func init() { Website: "https://metacpan.org/release/Locale-gettext", ID: 7523, - } + }) } -func (t Toolchain) newPerlPodParser() (pkg.Artifact, string) { +func (t Toolchain) newPerlPodParser(s *S) (pkg.Artifact, string) { const ( version = "1.67" checksum = "RdURu9mOfExk_loCp6abxlcQV3FycSNbTqhRS9i6JUqnYfGGEgercK30g0gjYyqe" ) - return t.newViaPerlMakeMaker("Pod::Parser", version, newFromCPAN( + return s.newViaPerlMakeMaker(t, "Pod::Parser", version, newFromCPAN( "MAREKR", "Pod-Parser", version, @@ -178,7 +180,7 @@ func (t Toolchain) newPerlPodParser() (pkg.Artifact, string) { ), nil), version } func init() { - artifactsM[PerlPodParser] = Metadata{ + native.MustRegister(&Artifact{ f: Toolchain.newPerlPodParser, Name: "perl-Pod::Parser", @@ -186,15 +188,15 @@ func init() { Website: "https://metacpan.org/release/Pod-Parser", ID: 3244, - } + }) } -func (t Toolchain) newPerlSGMLS() (pkg.Artifact, string) { +func (t Toolchain) newPerlSGMLS(s *S) (pkg.Artifact, string) { const ( version = "1.1" checksum = "aZijn4MUqD-wfyZgdcCruCwl4SgDdu25cNmJ4_UvdAk9a7uz4gzMQdoeB6DQ6QOy" ) - return t.newViaPerlMakeMaker("SGMLS", version, newFromCPAN( + return s.newViaPerlMakeMaker(t, "SGMLS", version, newFromCPAN( "RAAB", "SGMLSpm", version, @@ -202,7 +204,7 @@ func (t Toolchain) newPerlSGMLS() (pkg.Artifact, string) { ), nil), version } func init() { - artifactsM[PerlSGMLS] = Metadata{ + native.MustRegister(&Artifact{ f: Toolchain.newPerlSGMLS, Name: "perl-SGMLS", @@ -224,15 +226,15 @@ func init() { } return v.Latest }, - } + }) } -func (t Toolchain) newPerlTermReadKey() (pkg.Artifact, string) { +func (t Toolchain) newPerlTermReadKey(s *S) (pkg.Artifact, string) { const ( version = "2.38" checksum = "qerL8Xo7kD0f42PZoiEbmE8Roc_S9pOa27LXelY4DN_0UNy_u5wLrGHI8utNlaiI" ) - return t.newViaPerlMakeMaker("Term::ReadKey", version, newFromCPAN( + return s.newViaPerlMakeMaker(t, "Term::ReadKey", version, newFromCPAN( "JSTOWE", "TermReadKey", version, @@ -240,7 +242,7 @@ func (t Toolchain) newPerlTermReadKey() (pkg.Artifact, string) { ), nil), version } func init() { - artifactsM[PerlTermReadKey] = Metadata{ + native.MustRegister(&Artifact{ f: Toolchain.newPerlTermReadKey, Name: "perl-Term::ReadKey", @@ -248,15 +250,15 @@ func init() { Website: "https://metacpan.org/release/TermReadKey", ID: 3372, - } + }) } -func (t Toolchain) newPerlTextCharWidth() (pkg.Artifact, string) { +func (t Toolchain) newPerlTextCharWidth(s *S) (pkg.Artifact, string) { const ( version = "0.04" checksum = "G2p5RHU4_HiZ23ZusBA_enTlVMxz0J4esUx4CGcOPhY6xYTbp-aXWRN6lYZpzBw2" ) - return t.newViaPerlMakeMaker("Text::CharWidth", version, newFromCPAN( + return s.newViaPerlMakeMaker(t, "Text::CharWidth", version, newFromCPAN( "KUBOTA", "Text-CharWidth", version, @@ -264,7 +266,7 @@ func (t Toolchain) newPerlTextCharWidth() (pkg.Artifact, string) { ), nil), version } func init() { - artifactsM[PerlTextCharWidth] = Metadata{ + native.MustRegister(&Artifact{ f: Toolchain.newPerlTextCharWidth, Name: "perl-Text::CharWidth", @@ -272,15 +274,15 @@ func init() { Website: "https://metacpan.org/release/Text-CharWidth", ID: 14380, - } + }) } -func (t Toolchain) newPerlTextWrapI18N() (pkg.Artifact, string) { +func (t Toolchain) newPerlTextWrapI18N(s *S) (pkg.Artifact, string) { const ( version = "0.06" checksum = "Vmo89qLgxUqyQ6QmWJVqu60aQAUjrNKRjFQSXGnvClxofzRjiCa6idzPgJ4VkixM" ) - return t.newViaPerlMakeMaker("Text::WrapI18N", version, newFromCPAN( + return s.newViaPerlMakeMaker(t, "Text::WrapI18N", version, newFromCPAN( "KUBOTA", "Text-WrapI18N", version, @@ -290,7 +292,7 @@ func (t Toolchain) newPerlTextWrapI18N() (pkg.Artifact, string) { ), version } func init() { - artifactsM[PerlTextWrapI18N] = Metadata{ + native.MustRegister(&Artifact{ f: Toolchain.newPerlTextWrapI18N, Name: "perl-Text::WrapI18N", @@ -302,15 +304,15 @@ func init() { }, ID: 14385, - } + }) } -func (t Toolchain) newPerlMIMECharset() (pkg.Artifact, string) { +func (t Toolchain) newPerlMIMECharset(s *S) (pkg.Artifact, string) { const ( version = "1.013.1" checksum = "Ou_ukcrOa1cgtE3mptinb-os3bdL1SXzbRDFZQF3prrJj-drc3rp_huay7iDLJol" ) - return t.newViaPerlMakeMaker("MIME::Charset", version, newFromCPAN( + return s.newViaPerlMakeMaker(t, "MIME::Charset", version, newFromCPAN( "NEZUMI", "MIME-Charset", version, @@ -318,7 +320,7 @@ func (t Toolchain) newPerlMIMECharset() (pkg.Artifact, string) { ), nil), version } func init() { - artifactsM[PerlMIMECharset] = Metadata{ + native.MustRegister(&Artifact{ f: Toolchain.newPerlMIMECharset, Name: "perl-MIME::Charset", @@ -326,15 +328,15 @@ func init() { Website: "https://metacpan.org/release/MIME-Charset", ID: 3070, - } + }) } -func (t Toolchain) newPerlUnicodeLineBreak() (pkg.Artifact, string) { +func (t Toolchain) newPerlUnicodeLineBreak(s *S) (pkg.Artifact, string) { const ( version = "2019.001" checksum = "ZHVkh7EDgAUHnTpvXsnPAuWpgNoBImtY_9_8TIbo2co_WgUwEb0MtXPhI8pAZ5OH" ) - return t.newViaPerlMakeMaker("Unicode::LineBreak", version, newFromCPAN( + return s.newViaPerlMakeMaker(t, "Unicode::LineBreak", version, newFromCPAN( "NEZUMI", "Unicode-LineBreak", version, @@ -344,7 +346,7 @@ func (t Toolchain) newPerlUnicodeLineBreak() (pkg.Artifact, string) { ), version } func init() { - artifactsM[PerlUnicodeLineBreak] = Metadata{ + native.MustRegister(&Artifact{ f: Toolchain.newPerlUnicodeLineBreak, Name: "perl-Unicode::LineBreak", @@ -356,15 +358,15 @@ func init() { }, ID: 6033, - } + }) } -func (t Toolchain) newPerlYAMLTiny() (pkg.Artifact, string) { +func (t Toolchain) newPerlYAMLTiny(s *S) (pkg.Artifact, string) { const ( version = "1.76" checksum = "V1MV4KPym1LxSw8CRXqPR3K-l1hGHbT5Ob4t-9xju6R9X_CWyw6hI8wsMaNdHdBY" ) - return t.newViaPerlMakeMaker("YAML::Tiny", version, newFromCPAN( + return s.newViaPerlMakeMaker(t, "YAML::Tiny", version, newFromCPAN( "ETHER", "YAML-Tiny", version, @@ -372,7 +374,7 @@ func (t Toolchain) newPerlYAMLTiny() (pkg.Artifact, string) { ), nil), version } func init() { - artifactsM[PerlYAMLTiny] = Metadata{ + native.MustRegister(&Artifact{ f: Toolchain.newPerlYAMLTiny, Name: "perl-YAML::Tiny", @@ -380,15 +382,15 @@ func init() { Website: "https://metacpan.org/release/YAML-Tiny", ID: 3549, - } + }) } -func (t Toolchain) newPerlTestCmd() (pkg.Artifact, string) { +func (t Toolchain) newPerlTestCmd(s *S) (pkg.Artifact, string) { const ( version = "1.09" checksum = "gpGUwyC9IozDiYSgW_kXARNfXsTPFa6cTowJmmCBbPqcs2-pONZca_SB06FGy-7H" ) - return t.newViaPerlMakeMaker("Test::Cmd", version, newFromCPAN( + return s.newViaPerlMakeMaker(t, "Test::Cmd", version, newFromCPAN( "NEILB", "Test-Cmd", version, @@ -396,7 +398,7 @@ func (t Toolchain) newPerlTestCmd() (pkg.Artifact, string) { ), nil), version } func init() { - artifactsM[PerlTestCmd] = Metadata{ + native.MustRegister(&Artifact{ f: Toolchain.newPerlTestCmd, Name: "perl-Test::Cmd", @@ -404,5 +406,5 @@ func init() { Website: "https://metacpan.org/release/Test-Cmd", ID: 6014, - } + }) } |
