package rosa

import (
	"strings"

	"hakurei.app/internal/pkg"
)

func (t Toolchain) newLibpng() (pkg.Artifact, string) {
	const (
		version  = "1.6.58"
		checksum = "m_a5lROJH7vmF3cMjqwTUqURuQLhV1JQx2ySPzcN3VPdgDB9pG3UINsIx_mtkr-t"
	)
	return t.NewPackage("libpng", version, newTar(
		"https://downloads.sourceforge.net/project/libpng/libpng"+
			strings.Join(strings.SplitN(version, ".", 3)[:2], "")+
			"/"+version+"/libpng-"+version+".tar.gz",
		checksum,
		pkg.TarGzip,
	), nil, (*MakeHelper)(nil),
		Zlib,
	), version
}
func init() {
	artifactsM[Libpng] = Metadata{
		f: Toolchain.newLibpng,

		Name:        "libpng",
		Description: "the official PNG reference library",
		Website:     "https://www.libpng.org/pub/png/libpng.html",

		Dependencies: P{
			Zlib,
		},

		ID: 1705,
	}
}
