python312Packages.types-aiobotocore: 2.15.2 -> 2.15.2.post3 (#361801)
[NixPkgs.git] / pkgs / applications / virtualization / rust-hypervisor-firmware / default.nix
blobbaa95b13c9ed567df58a62692aff7450aca06d1a
1 { lib
2 , fetchFromGitHub
3 , stdenv
4 , lld
5 }:
7 let
8   arch = stdenv.hostPlatform.qemuArch;
10   target = ./. + "/${arch}-unknown-none.json";
14 assert lib.assertMsg (builtins.pathExists target) "Target spec not found";
16 let
17   cross = import ../../../.. {
18     system = stdenv.hostPlatform.system;
19     crossSystem = lib.systems.examples."${arch}-embedded" // {
20       rust.rustcTarget = "${arch}-unknown-none";
21       rust.platform = lib.importJSON target;
22     };
23   };
25   inherit (cross) rustPlatform;
29 rustPlatform.buildRustPackage rec {
30   pname = "rust-hypervisor-firmware";
31   version = "0.4.2";
33   src = fetchFromGitHub {
34     owner = "cloud-hypervisor";
35     repo = pname;
36     rev = version;
37     sha256 = "sha256-hKk5pcop8rb5Q+IVchcl+XhMc3DCBBPn5P+AkAb9XxI=";
38   };
40   cargoHash = "sha256-edi6/Md6KebKM3wHArZe1htUCg0/BqMVZKA4xEH25GI=";
42   # lld: error: unknown argument '-Wl,--undefined=AUDITABLE_VERSION_INFO'
43   # https://github.com/cloud-hypervisor/rust-hypervisor-firmware/issues/249
44   auditable = false;
46   RUSTC_BOOTSTRAP = 1;
48   nativeBuildInputs = [
49     lld
50   ];
52   RUSTFLAGS = "-C linker=lld -C linker-flavor=ld.lld";
54   # Tests don't work for `no_std`. See https://os.phil-opp.com/testing/
55   doCheck = false;
57   meta = with lib; {
58     homepage = "https://github.com/cloud-hypervisor/rust-hypervisor-firmware";
59     description = "Simple firmware that is designed to be launched from anything that supports loading ELF binaries and running them with the PVH booting standard";
60     license = with licenses; [ asl20 ];
61     maintainers = with maintainers; [ astro ];
62     platforms = [ "x86_64-none" ];
63     mainProgram = "hypervisor-fw";
64   };