internal/rosa: python pip helper
All checks were successful
Test / Create distribution (push) Successful in 49s
Test / Sandbox (push) Successful in 2m36s
Test / Hakurei (push) Successful in 3m46s
Test / ShareFS (push) Successful in 3m56s
Test / Hpkg (push) Successful in 4m32s
Test / Sandbox (race detector) (push) Successful in 4m58s
Test / Hakurei (race detector) (push) Successful in 5m53s
Test / Flake checks (push) Successful in 1m43s

Fuse requires pytest which depends on many packages. This helper eases the pain of packaging them.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-27 05:14:59 +09:00
parent d61faa09eb
commit 887aef8514

View File

@@ -1,6 +1,7 @@
package rosa
import (
"slices"
"strings"
"hakurei.app/internal/pkg"
@@ -64,6 +65,26 @@ make DESTDIR=/work install
}
func init() { artifactsF[Python] = Toolchain.newPython }
// newViaPip is a helper for installing python dependencies via pip.
func (t Toolchain) newViaPip(
name, version, abi, platform, checksum, prefix string,
extra ...pkg.Artifact,
) pkg.Artifact {
wname := name + "-" + version + "-py3-" + abi + "-" + platform + ".whl"
return t.New(name+"-"+version, false, slices.Concat([]pkg.Artifact{
t.Load(Python),
}, extra), nil, nil, `
pip3 install \
--no-index \
--prefix=/system \
--root=/work \
/usr/src/`+wname+`
`, pkg.Path(AbsUsrSrc.Append(wname), false, pkg.NewHTTPGet(
nil, prefix+wname,
mustDecode(checksum),
)))
}
func (t Toolchain) newSetuptools() pkg.Artifact {
const (
version = "80.10.1"