internal/rosa/python: url pip wheel helper
All checks were successful
Test / Create distribution (push) Successful in 1m36s
Test / Sandbox (push) Successful in 3m34s
Test / Hakurei (push) Successful in 4m54s
Test / ShareFS (push) Successful in 4m55s
Test / Sandbox (race detector) (push) Successful in 6m9s
Test / Hakurei (race detector) (push) Successful in 4m44s
Test / Flake checks (push) Successful in 3m0s
All checks were successful
Test / Create distribution (push) Successful in 1m36s
Test / Sandbox (push) Successful in 3m34s
Test / Hakurei (push) Successful in 4m54s
Test / ShareFS (push) Successful in 4m55s
Test / Sandbox (race detector) (push) Successful in 6m9s
Test / Hakurei (race detector) (push) Successful in 4m44s
Test / Flake checks (push) Successful in 3m0s
This enables a cleaner higher-level helper. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -83,16 +83,30 @@ func init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func (t Toolchain) newBuildCATrust() (pkg.Artifact, string) {
|
||||||
const version = "0.4.0"
|
const (
|
||||||
artifactsM[buildcatrust] = newViaPip(
|
version = "0.4.0"
|
||||||
"buildcatrust",
|
checksum = "k_FGzkRCLjbTWBkuBLzQJ1S8FPAz19neJZlMHm0t10F2Y0hElmvVwdSBRc03Rjo1"
|
||||||
"transform certificate stores between formats",
|
|
||||||
version, "py3", "none", "any",
|
|
||||||
"k_FGzkRCLjbTWBkuBLzQJ1S8FPAz19neJZlMHm0t10F2Y0hElmvVwdSBRc03Rjo1",
|
|
||||||
"https://github.com/nix-community/buildcatrust/"+
|
|
||||||
"releases/download/v"+version+"/",
|
|
||||||
)
|
)
|
||||||
|
return t.newViaPip("buildcatrust", version,
|
||||||
|
"https://github.com/nix-community/buildcatrust/releases/"+
|
||||||
|
"download/v"+version+"/buildcatrust-"+version+"-py3-none-any.whl",
|
||||||
|
checksum), version
|
||||||
|
}
|
||||||
|
func init() {
|
||||||
|
artifactsM[buildcatrust] = Metadata{
|
||||||
|
f: Toolchain.newBuildCATrust,
|
||||||
|
|
||||||
|
Name: "buildcatrust",
|
||||||
|
Description: "transform certificate stores between formats",
|
||||||
|
Website: "https://github.com/nix-community/buildcatrust",
|
||||||
|
|
||||||
|
Dependencies: P{
|
||||||
|
Python,
|
||||||
|
},
|
||||||
|
|
||||||
|
ID: 233988,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t Toolchain) newNSSCACert() (pkg.Artifact, string) {
|
func (t Toolchain) newNSSCACert() (pkg.Artifact, string) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package rosa
|
package rosa
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"path"
|
||||||
"slices"
|
"slices"
|
||||||
"strings"
|
"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.
|
// newViaPip is a helper for installing python dependencies via pip.
|
||||||
func newViaPip(
|
func newViaPip(
|
||||||
name, description, version, interpreter, abi, platform, checksum, prefix string,
|
name, description, version, interpreter, abi, platform, checksum, prefix string,
|
||||||
|
|||||||
Reference in New Issue
Block a user