about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/virtualization/xen-guest-agent/default.nix
blob: 52924b2b624f68eb1a400b2cdb12ea7855e0f02b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{
  lib,
  fetchFromGitLab,
  rustPlatform,
  llvmPackages,
  xen-light,
}:
rustPlatform.buildRustPackage rec {
  pname = "xen-guest-agent";
  version = "0.3.0";

  src = fetchFromGitLab {
    owner = "xen-project";
    repo = pname;
    rev = version;
    hash = "sha256-Csio24ofj+p0j/R0av/28P/KCNXhmcF+r8xGJEfoHjQ=";
  };

  cargoHash = "sha256-XWDDzSu88zCIwMuvkFjCb98DzXHvW2IP9u3EbpAMIgw=";

  env = {
    LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
    BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${xen-light}/include";
    RUSTFLAGS = "-L ${xen-light}/lib";
  };

  nativeBuildInputs = [llvmPackages.clang xen-light];

  postFixup = ''
    patchelf $out/bin/xen-guest-agent --add-rpath ${xen-light}/lib
  '';

  meta = with lib; {
    description = "Xen agent running in Linux/BSDs (POSIX) VMs";
    homepage = "https://gitlab.com/xen-project/xen-guest-agent";
    license = licenses.agpl3;
    platforms = platforms.unix;
    maintainers = with maintainers; [matdibu];
  };
}