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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user