From b29031ca06181f6624687817d26599890f582879 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 23 May 2026 13:55:17 +0900 Subject: [PATCH] internal/rosa: remove unused helpers These are no longer needed after migration. Signed-off-by: Ophestra --- internal/rosa/busybox.go | 2 +- internal/rosa/cmake.go | 4 ++-- internal/rosa/make.go | 2 +- internal/rosa/meson.go | 2 +- internal/rosa/perl.go | 22 +--------------------- internal/rosa/python.go | 32 +------------------------------- 6 files changed, 7 insertions(+), 57 deletions(-) diff --git a/internal/rosa/busybox.go b/internal/rosa/busybox.go index 32d903a6..923f25ef 100644 --- a/internal/rosa/busybox.go +++ b/internal/rosa/busybox.go @@ -26,7 +26,7 @@ func (a busyboxBin) Params(*pkg.IContext) {} // IsExclusive returns false: Cure performs a trivial filesystem write. func (busyboxBin) IsExclusive() bool { return false } -// Dependencies returns the underlying busybox [pkg.File]. +// Dependencies returns the underlying busybox [pkg.FileArtifact]. func (a busyboxBin) Dependencies() []pkg.Artifact { return []pkg.Artifact{a.bin} } diff --git a/internal/rosa/cmake.go b/internal/rosa/cmake.go index 127423d1..83acad60 100644 --- a/internal/rosa/cmake.go +++ b/internal/rosa/cmake.go @@ -11,7 +11,7 @@ var ( _ninja = H("ninja") ) -// CMakeHelper is the [CMake] build system helper. +// CMakeHelper builds and tests a CMake project with specified CACHE entries. type CMakeHelper struct { // Path elements joined with source. Append []string @@ -34,7 +34,7 @@ type CMakeHelper struct { var _ Helper = new(CMakeHelper) -// extra returns a hardcoded slice of [CMake] and [Ninja]. +// extra returns the cmake handle alongside either ninja or make. func (attr *CMakeHelper) extra(int) P { if attr != nil && attr.Make { return P{_cmake, _make} diff --git a/internal/rosa/make.go b/internal/rosa/make.go index a3e3d8e3..d6f1f0b9 100644 --- a/internal/rosa/make.go +++ b/internal/rosa/make.go @@ -7,7 +7,7 @@ import ( var _make = H("make") -// MakeHelper is the [Make] build system helper. +// MakeHelper wraps the make program and its surrounding build system. type MakeHelper struct { // Do not include default extras. OmitDefaults bool diff --git a/internal/rosa/meson.go b/internal/rosa/meson.go index 4ee126e4..003b32cd 100644 --- a/internal/rosa/meson.go +++ b/internal/rosa/meson.go @@ -7,7 +7,7 @@ import ( var _meson = H("meson") -// MesonHelper is the [Meson] build system helper. +// MesonHelper builds and tests a meson project. type MesonHelper struct { // Runs after setup. ScriptCompileEarly string diff --git a/internal/rosa/perl.go b/internal/rosa/perl.go index aa0c817b..3a9f56ac 100644 --- a/internal/rosa/perl.go +++ b/internal/rosa/perl.go @@ -1,14 +1,8 @@ package rosa -import ( - "slices" - - "hakurei.app/internal/pkg" -) - var _perl = H("perl") -// MakeMakerHelper is the [Perl] MakeMaker helper. +// MakeMakerHelper builds projects using the included MakeMaker script. type MakeMakerHelper struct { // Whether to skip the check target. SkipCheck bool @@ -49,17 +43,3 @@ make \ script += "make DESTDIR=/work install\n" return script } - -// newViaPerlMakeMaker installs a perl module via Makefile.PL. -func (t Toolchain) newViaPerlMakeMaker( - name, version string, - source pkg.Artifact, - patches []KV, - extra ...ArtifactH, -) pkg.Artifact { - return t.NewPackage("perl-"+name, version, source, &PackageAttr{ - Patches: patches, - }, (*MakeMakerHelper)(nil), slices.Concat(extra, P{ - _perl, - })...) -} diff --git a/internal/rosa/python.go b/internal/rosa/python.go index d868efe3..3ebc1e08 100644 --- a/internal/rosa/python.go +++ b/internal/rosa/python.go @@ -1,17 +1,11 @@ package rosa -import ( - "slices" - - "hakurei.app/internal/pkg" -) - var ( _python = H("python") _pythonPyTest = H("python-pytest") ) -// PipHelper is the [Python] pip packaging helper. +// PipHelper installs python packages from source using pip. type PipHelper struct { // Path elements joined with source. Append []string @@ -94,27 +88,3 @@ pip3 install \ '` + sourcePath.String() + `' ` + script } - -// newPythonPackage registers a new [Python] package. -func (s *S) newPythonPackage( - name string, id int, description, website, version string, - source pkg.Artifact, attrP *PackageAttr, attr *PipHelper, - build P, extra ...ArtifactH, -) { - name = "python-" + name - s.MustRegister(name, func(t Toolchain) (*Metadata, pkg.Artifact) { - return &Metadata{ - Name: name, - Description: description, - Website: website, - Version: version, - - Dependencies: slices.Concat(P{_python}, extra), - - ID: id, - }, t.NewPackage(name, version, source, attrP, attr, slices.Concat( - extra, - build, - )...) - }) -}