1
0
forked from rosa/hakurei

internal/rosa/python: url pip wheel helper

This enables a cleaner higher-level helper.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-04-13 01:59:28 +09:00
parent 081d6b463c
commit 46428ed85d
2 changed files with 43 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
package rosa
import (
"path"
"slices"
"strings"
@@ -80,6 +81,25 @@ func init() {
}
}
// newViaPip installs a pip wheel from a url.
func (t Toolchain) newViaPip(
name, version, url, checksum string,
extra ...PArtifact,
) pkg.Artifact {
return t.New(name+"-"+version, 0, t.AppendPresets(nil,
slices.Concat(P{Python}, extra)...,
), nil, nil, `
pip3 install \
--no-index \
--prefix=/system \
--root=/work \
'/usr/src/`+path.Base(url)+`'
`, pkg.Path(AbsUsrSrc.Append(path.Base(url)), false, pkg.NewHTTPGet(
nil, url,
mustDecode(checksum),
)))
}
// newViaPip is a helper for installing python dependencies via pip.
func newViaPip(
name, description, version, interpreter, abi, platform, checksum, prefix string,