2023-06-15 12:25:58 +00:00
|
|
|
{ stdenv, fetchzip, lib, dtc }:
|
2022-04-07 00:50:06 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "kvmtool";
|
2023-09-16 13:54:21 +00:00
|
|
|
version = "unstable-2023-07-12";
|
2022-04-07 00:50:06 +00:00
|
|
|
|
2023-06-15 12:25:58 +00:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git/snapshot/kvmtool-106e2ea7756d980454d68631b87d5e25ba4e4881.tar.gz";
|
|
|
|
hash = "sha256-wpc5DfHnui0lBVH4uOq6a7pXVUZStjNLRvauu6QpRvE=";
|
2022-04-07 00:50:06 +00:00
|
|
|
};
|
|
|
|
|
2023-08-19 12:14:34 +00:00
|
|
|
patches = [ ./strlcpy-glibc-2.38-fix.patch ];
|
|
|
|
|
2023-04-09 15:45:14 +00:00
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.isAarch64 [ dtc ];
|
|
|
|
|
2022-04-07 00:50:06 +00:00
|
|
|
enableParallelBuilding = true;
|
2023-04-09 15:45:14 +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-07 00:50:06 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-07 07:46:46 +00:00
|
|
|
description = "Lightweight tool for hosting KVM guests";
|
2022-04-07 00:50:06 +00:00
|
|
|
homepage = "https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git/tree/README";
|
|
|
|
license = licenses.gpl2Only;
|
2023-09-16 13:55:59 +00:00
|
|
|
maintainers = with maintainers; [ astro mfrw ];
|
2023-04-09 15:45:14 +00:00
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
2023-09-16 13:59:33 +00:00
|
|
|
mainProgram = "lkvm";
|
2022-04-07 00:50:06 +00:00
|
|
|
};
|
|
|
|
}
|