diff --git a/internal/rosa/package/perl.az b/internal/rosa/package/perl.az new file mode 100644 index 00000000..3554fa84 --- /dev/null +++ b/internal/rosa/package/perl.az @@ -0,0 +1,47 @@ +package perl { + description = "The Perl Programming language"; + website = "https://www.perl.org"; + anitya = 13599; + // odd-even versioning + anityaFallback = true; + + version* = "5.42.2"; + source = remoteTar { + url = "https://www.cpan.org/src/5.0/perl-"+version+".tar.gz"; + checksum = "Me_xFfgkRnVyG0sE6a74TktK2OUq9Z1LVJNEu_9RdZG3S2fbjfzNiuk2SJqHAgbm"; + compress = gzip; + }; + + // uses source tree as scratch space + writable = true; + chmod = true; + early = ` +echo 'print STDOUT "1..0 # Skip broken test\n";' > ext/Pod-Html/t/htmldir3.t +chmod +w /system/bin && rm -f /system/bin/ps # perl does not like toybox ps +`; + + toyboxEarly = true; + exec = make { + omitDefaults = true; + inPlace = true; + + configureName = "./Configure"; + configure = { + "-des"; + "Dprefix": "/system"; + "Dcc": "clang"; + "Dcflags": "--std=gnu99"; + "Dldflags": `"${LDFLAGS:-''}"`; + "Doptimize": "'-O2 -fno-strict-aliasing'"; + "Duseithreads"; + "Duseshrplib"; + }; + + check = [ + "TEST_JOBS=" + jobsLE, + "test_harness", + ]; + + install = `LD_LIBRARY_PATH="$PWD" ./perl -Ilib -I. installperl --destdir=/work`; + }; +} diff --git a/internal/rosa/perl.go b/internal/rosa/perl.go index 204022aa..965aad06 100644 --- a/internal/rosa/perl.go +++ b/internal/rosa/perl.go @@ -7,61 +7,6 @@ import ( "hakurei.app/internal/pkg" ) -func (t Toolchain) newPerl() (pkg.Artifact, string) { - const ( - version = "5.42.2" - checksum = "Me_xFfgkRnVyG0sE6a74TktK2OUq9Z1LVJNEu_9RdZG3S2fbjfzNiuk2SJqHAgbm" - ) - return t.NewPackage("perl", version, newTar( - "https://www.cpan.org/src/5.0/perl-"+version+".tar.gz", - checksum, - pkg.TarGzip, - ), &PackageAttr{ - // uses source tree as scratch space - Writable: true, - Chmod: true, - - ScriptEarly: ` -echo 'print STDOUT "1..0 # Skip broken test\n";' > ext/Pod-Html/t/htmldir3.t -chmod +w /system/bin && rm -f /system/bin/ps # perl does not like toybox ps -`, - - Flag: TEarly, - }, &MakeHelper{ - OmitDefaults: true, - InPlace: true, - - ConfigureName: "./Configure", - Configure: []KV{ - {"-des"}, - {"Dprefix", "/system"}, - {"Dcc", "clang"}, - {"Dcflags", "--std=gnu99"}, - {"Dldflags", `"${LDFLAGS:-''}"`}, - {"Doptimize", "'-O2 -fno-strict-aliasing'"}, - {"Duseithreads"}, - {"Duseshrplib"}, - }, - Check: []string{ - "TEST_JOBS=" + jobsLE, - "test_harness", - }, - Install: `LD_LIBRARY_PATH="$PWD" ./perl -Ilib -I. installperl --destdir=/work`, - }), version -} -func init() { - native.mustRegister(Toolchain.newPerl, &Metadata{ - Name: "perl", - Description: "The Perl Programming language", - Website: "https://www.perl.org/", - - ID: 13599, - - // odd-even versioning - latest: (*Versions).getStable, - }) -} - // newViaPerlModuleBuild installs a perl module via Build.PL. func (t Toolchain) newViaPerlModuleBuild( name, version string, diff --git a/internal/rosa/state.go b/internal/rosa/state.go index 6a0f4553..f52f99cb 100644 --- a/internal/rosa/state.go +++ b/internal/rosa/state.go @@ -678,6 +678,8 @@ func (ctx *evalContext) pf( helper Helper inputs, runtimes azalea.Array + + anityaFallback bool ) if err = args.Apply(map[unique.Handle[azalea.Ident]]any{ k("description"): &meta.Description, @@ -698,6 +700,8 @@ func (ctx *evalContext) pf( k("exec"): &helper, k("inputs"): &inputs, k("runtime"): &runtimes, + + k("anityaFallback"): &anityaFallback, }); err != nil { return } @@ -727,6 +731,9 @@ func (ctx *evalContext) pf( } meta.ID = int(anitya) + if anityaFallback { + meta.latest = (*Versions).getStable + } var source pkg.Artifact switch p := sourceA.(type) { case pkg.Artifact: