diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-12-01 20:59:16 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-12-01 21:00:05 +0900 |
| commit | ec52a96f2b479be8b880349ddfb0819382666962 (patch) | |
| tree | 551168ec43b125ab17c2868b7e240d50441e5b44 /internal/rosa/rosa.go | |
| parent | 1d73ffe341b4ec3e3dc636b8a14227ce28a4c410 (diff) | |
internal/rosa: net helper
This is mostly useful for fetching dependencies before a build.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/rosa.go')
| -rw-r--r-- | internal/rosa/rosa.go | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go index ac6648ab..83bf316b 100644 --- a/internal/rosa/rosa.go +++ b/internal/rosa/rosa.go @@ -60,6 +60,8 @@ var ( AbsSource = fhs.AbsRoot.Append("source") // AbsExtra holds extra files provided to a packaging container. AbsExtra = fhs.AbsRoot.Append("extra") + // AbsNet holds the output of [PackageAttr.Net]. + AbsNet = fhs.AbsRoot.Append("net") ) // TargetError is an unsupported target architecture name. @@ -375,6 +377,11 @@ type PackageAttr struct { // Whether to create [pkg.KindExecNet] instead of [pkg.KindExec]. HostNet bool + // Runs in a [pkg.KindExecNet] artifact if non-empty. + Net string + // Outcome of Net. + NetChecksum pkg.Checksum + // Whether cross-compilation is broken. RejectCross bool // Whether the [Helper] behaves identically across all architectures. @@ -719,6 +726,35 @@ export \ srn += "-cross-" + _arch } + if attr.Net != "" { + paths = append(paths, pkg.Path(AbsNet, true, t.New( + name+"-net", version, source, &PackageAttr{ + KnownChecksum: &attr.NetChecksum, + Writable: true, + Chmod: true, + EnterSource: true, + Env: attr.Env, + Patches: attr.Patches, + Bin: attr.Bin, + NoToolchain: attr.NoToolchain, + HostNet: true, + NoArch: true, + Extra: attr.Extra, + + Paths: slices.Concat(attr.Paths, []pkg.ExecPath{ + resolvconf(), + }), + Tools: slices.Concat(attr.Tools, P{ + _nssCACert, + }), + }, &GenericHelper{ + InPlace: true, + Install: "chmod +w /etc && ln -s .." + Prefix + "/etc/ssl /etc\n" + + attr.Net, + }, + ))) + } + return pkg.NewExec( srn, arch, attr.KnownChecksum, pkg.ExecTimeoutMax, attr.HostNet, |
