aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/rosa.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-10-23 02:46:27 +0900
committerOphestra <cat@gensokyo.uk>2026-10-23 02:46:27 +0900
commita0689a1f656be32052cd067140d982b4b4e6aa8e (patch)
tree88c36dd5bcc334172af5911711e606433d761463 /internal/rosa/rosa.go
parent9a9f53daac112c841487a3c530318601c102895a (diff)
internal/rosa/meson: support cross-compilation
Meson does not want to play nice and accept arguments or environment variables for cross-compiling configuration, so a so-called mfile had to be generated and placed here. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/rosa.go')
-rw-r--r--internal/rosa/rosa.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/internal/rosa/rosa.go b/internal/rosa/rosa.go
index 27f31ecf..2448f203 100644
--- a/internal/rosa/rosa.go
+++ b/internal/rosa/rosa.go
@@ -214,6 +214,7 @@ var (
_toyboxEarly = H("toybox-early")
_llvm = H("llvm")
_patch = H("patch")
+ _qemu = H("qemu")
)
// HasStageEarly returns whether a stage0 distribution is available.
@@ -281,7 +282,7 @@ const helperInPlace = "\x00"
// Helper is a build system helper for [Toolchain.New].
type Helper interface {
// tools returns helper-specific tool handles.
- tools() P
+ tools(t Toolchain) P
// inputs returns helper-specific input handles.
inputs() P
@@ -301,6 +302,13 @@ type Helper interface {
script(t Toolchain, name string) string
}
+// pathsHelper is a [Helper] with additional paths added to the container.
+type pathsHelper interface {
+ Helper
+
+ paths(t Toolchain) []pkg.ExecPath
+}
+
// PackageAttr holds build-system-agnostic attributes.
type PackageAttr struct {
// Measure output if populated. Required by HostNet.
@@ -515,7 +523,7 @@ func (t Toolchain) New(
if cross {
spv = paGet()
}
- for _, p := range helper.tools() {
+ for _, p := range helper.tools(t) {
root = native.appendHandle(root, pv, p)
}
@@ -600,6 +608,9 @@ cd '/usr/src/` + name + `/'
)),
})
}
+ if ph, ok := helper.(pathsHelper); ok {
+ paths = append(paths, ph.paths(t)...)
+ }
bin := attr.Bin
if attr.PopulateUsrBin {
@@ -682,7 +693,7 @@ type GenericHelper struct {
var _ Helper = new(GenericHelper)
// tools is a noop.
-func (*GenericHelper) tools() P { return nil }
+func (*GenericHelper) tools(Toolchain) P { return nil }
// inputs is a noop.
func (*GenericHelper) inputs() P { return nil }