From 16966043c707d2b8d939089fc9bf6b2f1acfdd7e Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 17 Feb 2026 00:54:34 +0900 Subject: [PATCH] internal/rosa: dtc artifact Required by qemu. Signed-off-by: Ophestra --- internal/rosa/all.go | 2 ++ internal/rosa/dtc.go | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 internal/rosa/dtc.go diff --git a/internal/rosa/all.go b/internal/rosa/all.go index 4d8e3d7..94fba47 100644 --- a/internal/rosa/all.go +++ b/internal/rosa/all.go @@ -21,6 +21,7 @@ const ( CMake Coreutils Curl + DTC Diffutils Findutils Flex @@ -130,6 +131,7 @@ func ResolveName(name string) (p PArtifact, ok bool) { "cmake": CMake, "coreutils": Coreutils, "curl": Curl, + "dtc": DTC, "diffutils": Diffutils, "findutils": Findutils, "flex": Flex, diff --git a/internal/rosa/dtc.go b/internal/rosa/dtc.go new file mode 100644 index 0000000..7dff7d2 --- /dev/null +++ b/internal/rosa/dtc.go @@ -0,0 +1,34 @@ +package rosa + +import "hakurei.app/internal/pkg" + +func (t Toolchain) newDTC() pkg.Artifact { + const ( + version = "1.7.2" + checksum = "vUoiRynPyYRexTpS6USweT5p4SVHvvVJs8uqFkkVD-YnFjwf6v3elQ0-Etrh00Dt" + ) + return t.NewViaMeson("dtc", version, t.NewPatchedSource( + "dtc", version, pkg.NewHTTPGetTar( + nil, "https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/"+ + "dtc-v"+version+".tar.gz", + mustDecode(checksum), + pkg.TarGzip, + ), false, + ), &MesonAttr{ + // works around buggy test: + // fdtdump-runtest.sh /usr/src/dtc/tests/fdtdump.dts + Writable: true, + + Configure: [][2]string{ + {"Dyaml", "disabled"}, + {"Dstatic-build", "true"}, + }, + }, + t.Load(Flex), + t.Load(Bison), + t.Load(M4), + t.Load(Coreutils), + t.Load(Diffutils), + ) +} +func init() { artifactsF[DTC] = Toolchain.newDTC }