aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/unzip.go
blob: 84e6120c6b40a85893e6344b8733895e883fa481 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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 }