Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / virtualization / cloud-hypervisor / default.nix
blobd7182b8131070f90951bba29863f2191e98cfca6
1 { lib, stdenv, fetchFromGitHub, rustPlatform, pkg-config, dtc, openssl }:
3 rustPlatform.buildRustPackage rec {
4   pname = "cloud-hypervisor";
5   version = "35.0";
7   src = fetchFromGitHub {
8     owner = "cloud-hypervisor";
9     repo = pname;
10     rev = "v${version}";
11     sha256 = "sha256-HZt5xfsP9l18S6nPyVhLNAs5vgDSVYOMFwThzCCon7E=";
12   };
14   cargoLock = {
15     lockFile = ./Cargo.lock;
16     outputHashes = {
17       "acpi_tables-0.1.0" = "sha256-OGJX05yNwE7zZzATs8y0EZ714+lB+FgSia0TygRwWAU=";
18       "kvm-bindings-0.6.0" = "sha256-wGdAuPwsgRIqx9dh0m+hC9A/Akz9qg9BM+p06Fi5ACM=";
19       "kvm-ioctls-0.13.0" = "sha256-jHnFGwBWnAa2lRu4a5eRNy1Y26NX5MV8alJ86VR++QE=";
20       "micro_http-0.1.0" = "sha256-wX35VsrO1vxQcGbOrP+yZm9vG0gcTZLe7gH7xuAa12w=";
21       "mshv-bindings-0.1.1" = "sha256-8fEWawNeJ96CczFoJD3cqCsrROEvh8wJ4I0ForwzTJY=";
22       "versionize_derive-0.1.4" = "sha256-oGuREJ5+FDs8ihmv99WmjIPpL2oPdOr4REk6+7cV/7o=";
23       "vfio-bindings-0.4.0" = "sha256-hGhfOE9q9sf/tzPuaAHOca+JKCutcm1Myu1Tt9spaIQ=";
24       "vfio_user-0.1.0" = "sha256-fAqvy3YTDKXQqtJR+R2nBCWIYe89zTwtbgvJfPLqs1Q=";
25       "vm-fdt-0.2.0" = "sha256-lKW4ZUraHomSDyxgNlD5qTaBTZqM0Fwhhh/08yhrjyE=";
26     };
27   };
29   separateDebugInfo = true;
31   nativeBuildInputs = [ pkg-config ];
32   buildInputs = [ openssl ] ++ lib.optional stdenv.isAarch64 dtc;
34   OPENSSL_NO_VENDOR = true;
36   cargoTestFlags = [
37     "--workspace"
38     "--bins" "--lib" # Integration tests require root.
39     "--exclude" "net_util" # /dev/net/tun
40     "--exclude" "vmm"      # /dev/kvm
41   ];
43   meta = with lib; {
44     homepage = "https://github.com/cloud-hypervisor/cloud-hypervisor";
45     description = "Open source Virtual Machine Monitor (VMM) that runs on top of KVM";
46     changelog = "https://github.com/cloud-hypervisor/cloud-hypervisor/releases/tag/v${version}";
47     license = with licenses; [ asl20 bsd3 ];
48     mainProgram = "cloud-hypervisor";
49     maintainers = with maintainers; [ offline qyliss ];
50     platforms = [ "aarch64-linux" "x86_64-linux" ];
51   };