package mksh {
	description = "MirBSD Korn Shell";
	website = "https://www.mirbsd.org/mksh";
	anitya = 5590;

	version# = "59c";
	source = remoteTar {
		url = "https://mbsd.evolvis.org/MirOS/dist/mir/mksh/mksh-R"+version+".tgz";
		checksum = "0Zj-k4nXEu3IuJY4lvwD2OrC2t27GdZj8SPy4DoaeuBRH1padWb7oREpYgwY8JNq";
		compress = gzip;
	};

	env = [
		"LDSTATIC=-static",
		"CPPFLAGS=-DMKSH_DEFAULT_PROFILEDIR=\\\"/system/etc\\\"",
	];

	exec = generic {
		build = `sh /usr/src/mksh/Build.sh -r
CPPFLAGS="${CPPFLAGS} -DMKSH_BINSHPOSIX -DMKSH_BINSHREDUCED" \
sh /usr/src/mksh/Build.sh -r -L
`;
		check = "./test.sh -C regress:no-ctty\n";
		install = `
mkdir -p /work/system/bin/
cp -v mksh /work/system/bin/
cp -v lksh /work/system/bin/sh

mkdir -p /work/bin/
ln -vs ../system/bin/sh /work/bin/
`;
	};

	inputs = [
		perl,
		coreutils,
	];
}
