2023-04-12 12:48:02 +00:00
|
|
|
{ stdenv, fetchgit, lib, dtc }:
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "kvmtool";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "unstable-2023-04-06";
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git";
|
2023-04-12 12:48:02 +00:00
|
|
|
rev = "77b108c6a6f1c66fb7f60a80d17596bb80bda8ad";
|
|
|
|
sha256 = "sha256-wPhqjVpc6I9UOdb6lmzGh797sdvJ5q4dap2ssg8OY5E=";
|
2022-04-15 01:41:22 +00:00
|
|
|
};
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isAarch64 [ dtc ];
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
enableParallelBuilding = true;
|
2023-04-12 12:48:02 +00:00
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"prefix=${placeholder "out"}"
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isAarch64 ([
|
|
|
|
"LIBFDT_DIR=${dtc}/lib"
|
|
|
|
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
|
|
|
"CROSS_COMPILE=aarch64-unknown-linux-gnu-"
|
|
|
|
"ARCH=arm64"
|
|
|
|
]);
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A lightweight tool for hosting KVM guests";
|
|
|
|
homepage = "https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git/tree/README";
|
|
|
|
license = licenses.gpl2Only;
|
|
|
|
maintainers = with maintainers; [ astro ];
|
2023-04-12 12:48:02 +00:00
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
2022-04-15 01:41:22 +00:00
|
|
|
};
|
|
|
|
}
|