package rosa

import (
	"strings"

	"hakurei.app/internal/pkg"
)

func (t Toolchain) newLibtirpc() (pkg.Artifact, string) {
	const (
		version  = "1.3.7"
		checksum = "nzFfu7LNvnSNiNAryD1vtnNWnU-Xqee8KqfXUKoBf5yjb5-dkeRkYuRijdCoYLof"
	)
	return t.NewPackage("libtirpc", version, t.newTagRemote(
		"git://linux-nfs.org/~steved/libtirpc",
		"libtirpc-"+
			strings.Join(strings.SplitN(version, ".", 3), "-"),
		checksum,
	), nil, &MakeHelper{
		Generate: "sh -e ./bootstrap",
		Configure: []KV{
			{"CFLAGS", `"$(pkg-config --cflags libbsd-overlay) ${CFLAGS:-}"`},
			{"disable-gssapi"},
		},
	},
		Automake,
		Libtool,
		PkgConfig,

		Libbsd,
		KernelHeaders,
	), version
}
func init() {
	artifactsM[Libtirpc] = Metadata{
		f: Toolchain.newLibtirpc,

		Name:        "libtirpc",
		Description: "a port of Suns Transport-Independent RPC library to Linux",
		Website:     "https://sourceforge.net/projects/libtirpc/",

		ID: 1740,
	}
}
