package rosa

import "hakurei.app/internal/pkg"

func (t Toolchain) newCurl() (pkg.Artifact, string) {
	const (
		version  = "8.20.0"
		checksum = "xyHXwrngIRGMasuzhn-I5MSCOhktwINbsWt1f_LuR-5jRVvyx_g6U1EQfDLEbr9r"
	)
	return t.NewPackage("curl", version, newTar(
		"https://curl.se/download/curl-"+version+".tar.bz2",
		checksum,
		pkg.TarBzip2,
	), &PackageAttr{
		// remove broken test
		Writable: true,
		ScriptEarly: `
chmod +w tests/data && rm -f tests/data/test459
`,
	}, &MakeHelper{
		Configure: []KV{
			{"with-openssl"},
			{"with-ca-bundle", "/system/etc/ssl/certs/ca-bundle.crt"},

			{"disable-smb"},
		},
		Check: []string{
			"TFLAGS=" + jobsLFlagE,
			"test-nonflaky",
		},
	},
		Perl,
		Python,
		PkgConfig,
		Diffutils,

		Libpsl,
		OpenSSL,
	), version
}
func init() {
	artifactsM[Curl] = Metadata{
		f: Toolchain.newCurl,

		Name:        "curl",
		Description: "command line tool and library for transferring data with URLs",
		Website:     "https://curl.se/",

		Dependencies: P{
			Libpsl,
			OpenSSL,
		},

		ID: 381,
	}
}
