From ce6b3ff53be779a871d66cb820aa13f566080d05 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 5 Feb 2026 19:10:32 +0900 Subject: [PATCH] internal/rosa: unzip artifact Because the zip format is too awful and cannot be streamed anyway, supporting it natively comes with no benefit. Signed-off-by: Ophestra --- internal/rosa/all.go | 2 ++ internal/rosa/unzip.go | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 internal/rosa/unzip.go diff --git a/internal/rosa/all.go b/internal/rosa/all.go index f82841e..f600f06 100644 --- a/internal/rosa/all.go +++ b/internal/rosa/all.go @@ -61,6 +61,7 @@ const ( Setuptools Toybox toyboxEarly + Unzip utilMacros Wayland WaylandProtocols @@ -147,6 +148,7 @@ func ResolveName(name string) (p PArtifact, ok bool) { "sed": Sed, "setuptools": Setuptools, "toybox": Toybox, + "unzip": Unzip, "wayland": Wayland, "wayland-protocols": WaylandProtocols, "xcb": XCB, diff --git a/internal/rosa/unzip.go b/internal/rosa/unzip.go new file mode 100644 index 0000000..84e6120 --- /dev/null +++ b/internal/rosa/unzip.go @@ -0,0 +1,34 @@ +package rosa + +import ( + "strings" + + "hakurei.app/internal/pkg" +) + +func (t Toolchain) newUnzip() pkg.Artifact { + const ( + version = "6.0" + checksum = "fcqjB1IOVRNJ16K5gTGEDt3zCJDVBc7EDSra9w3H93stqkNwH1vaPQs_QGOpQZu1" + ) + return t.New("unzip-"+version, 0, []pkg.Artifact{ + t.Load(Make), + t.Load(Coreutils), + }, nil, nil, ` +cd /usr/src/unzip/ +unix/configure +make -f unix/Makefile generic1 + +mkdir -p /work/system/bin/ +mv unzip /work/system/bin/ +`, pkg.Path(AbsUsrSrc.Append("unzip"), true, t.NewPatchedSource( + "unzip", version, pkg.NewHTTPGetTar( + nil, "https://downloads.sourceforge.net/project/infozip/"+ + "UnZip%206.x%20%28latest%29/UnZip%20"+version+"/"+ + "unzip"+strings.ReplaceAll(version, ".", "")+".tar.gz", + mustDecode(checksum), + pkg.TarGzip, + ), false, + ))) +} +func init() { artifactsF[Unzip] = Toolchain.newUnzip }