diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-01-27 05:14:59 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-01-27 05:14:59 +0900 |
| commit | 887aef8514e6f7802f352ff1c2ea674645cecd33 (patch) | |
| tree | 0990487b1a6a2248f071b759af7d252ea68dbf67 /internal/rosa | |
| parent | d61faa09eb88b646430b09ef7b6e7f48bc0688eb (diff) | |
internal/rosa: python pip helper
Fuse requires pytest which depends on many packages. This helper eases the pain of packaging them.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa')
| -rw-r--r-- | internal/rosa/python.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/internal/rosa/python.go b/internal/rosa/python.go index 4be17f66..f5c61dbd 100644 --- a/internal/rosa/python.go +++ b/internal/rosa/python.go @@ -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" |
