package rosa

import "hakurei.app/internal/pkg"

func (t Toolchain) newKmod() (pkg.Artifact, string) {
	const (
		version  = "34.2"
		checksum = "0K7POeTKxMhExsaTsnKAC6LUNsRSfe6sSZxWONPbOu-GI_pXOw3toU_BIoqfBhJV"
	)
	return t.NewPackage("kmod", version, newTar(
		"https://www.kernel.org/pub/linux/utils/kernel/"+
			"kmod/kmod-"+version+".tar.gz",
		checksum,
		pkg.TarGzip,
	), nil, &MesonHelper{
		Setup: []KV{
			{"Dmoduledir", "/system/lib/modules"},
			{"Dsysconfdir", "/system/etc"},
			{"Dbashcompletiondir", "no"},
			{"Dfishcompletiondir", "no"},
			{"Dxz", "disabled"},
			{"Dmanpages", "false"},
		},

		// makes assumptions about the running kernel
		SkipTest: true,
	},
		Zlib,
		Zstd,
		OpenSSL,
		KernelHeaders,
	), version
}
func init() {
	artifactsM[Kmod] = Metadata{
		f: Toolchain.newKmod,

		Name:        "kmod",
		Description: "a set of tools to handle common tasks with Linux kernel modules",
		Website:     "https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git",

		Dependencies: P{
			Zlib,
			Zstd,
			OpenSSL,
		},

		ID: 1517,
	}
}
