nixpkgs/pkgs/by-name/cl/cloud-hypervisor/package.nix

73 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
pkg-config,
dtc,
openssl,
versionCheckHook,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "cloud-hypervisor";
version = "52.0";
src = fetchFromGitHub {
owner = "cloud-hypervisor";
repo = "cloud-hypervisor";
rev = "v${finalAttrs.version}";
hash = "sha256-OGyvmedSaWPsyH6mdHhgXN7MvTnK1HzdfTKUhJRlq8I=";
};
cargoHash = "sha256-ZNj1H3Iq+IUSe0McHJjrwPOoR+YRB+rsSmZHMhXsHy0=";
separateDebugInfo = true;
nativeBuildInputs = [ pkg-config ];
buildInputs = lib.optional stdenv.hostPlatform.isAarch64 dtc;
checkInputs = [ openssl ];
env.OPENSSL_NO_VENDOR = true;
cargoTestFlags = [
"--workspace"
"--exclude"
"hypervisor" # /dev/kvm
"--exclude"
"net_util" # /dev/net/tun
"--exclude"
"vmm" # /dev/kvm
"--"
# io_uring syscalls are blocked by the Lix sandbox
"--skip=io_uring"
"--skip=qcow_async::unit_tests::"
# fallocate(PUNCH_HOLE) reported size depends on the host filesystem
"--skip=test_query_device_size_sparse_file_punch_hole"
];
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
meta = {
homepage = "https://github.com/cloud-hypervisor/cloud-hypervisor";
description = "Open source Virtual Machine Monitor (VMM) that runs on top of KVM";
changelog = "https://github.com/cloud-hypervisor/cloud-hypervisor/releases/tag/v${finalAttrs.version}";
license = with lib.licenses; [
asl20
bsd3
];
mainProgram = "cloud-hypervisor";
maintainers = with lib.maintainers; [
qyliss
phip1611
];
platforms = [
"aarch64-linux"
"riscv64-linux"
"x86_64-linux"
];
};
})