mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-12 08:43:06 +00:00
6c437afe2c
Also splits the package output and adds more configuration options. Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
98 lines
2.1 KiB
Nix
98 lines
2.1 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
unstableGitUpdater,
|
|
autoreconfHook,
|
|
autoconf-archive,
|
|
bison,
|
|
flex,
|
|
glib,
|
|
pkg-config,
|
|
json_c,
|
|
libvirt,
|
|
|
|
withVMIFS ? true,
|
|
fuse,
|
|
|
|
legacyKVM ? false,
|
|
libkvmi,
|
|
|
|
xenSupport ? true,
|
|
xen-slim,
|
|
}:
|
|
|
|
let
|
|
pname = "libvmi";
|
|
version = "0.14.0-unstable-2024-08-06";
|
|
libVersion = "0.0.15";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "libvmi";
|
|
repo = "libvmi";
|
|
rev = "bdb9ffb8f1f70b425454bc41da2be353cc6cbf5c";
|
|
hash = "sha256-5K+9Qq5vGeYYy8kqWIeO25iNJoD/HvtyircH6odr/qA=";
|
|
};
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
inherit pname version src;
|
|
|
|
outputs = [
|
|
"out"
|
|
"lib"
|
|
"dev"
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
autoreconfHook
|
|
autoconf-archive
|
|
bison
|
|
flex
|
|
pkg-config
|
|
];
|
|
|
|
buildInputs =
|
|
[
|
|
glib
|
|
json_c
|
|
libvirt
|
|
]
|
|
++ lib.optionals xenSupport [ xen-slim ]
|
|
++ lib.optionals (!legacyKVM) [ libkvmi ]
|
|
++ lib.optionals withVMIFS [ fuse ];
|
|
|
|
configureFlags =
|
|
lib.optionals (!xenSupport) [ "--disable-xen" ]
|
|
++ lib.optionals legacyKVM [ "--enable-kvm-legacy" ]
|
|
++ lib.optionals withVMIFS [ "--enable-vmifs" ];
|
|
|
|
# libvmi uses dlopen() for the xen libraries, however autoPatchelfHook doesn't work here
|
|
postFixup = lib.optionalString xenSupport ''
|
|
libvmi="$lib/lib/libvmi.so.${libVersion}"
|
|
oldrpath=$(patchelf --print-rpath "$libvmi")
|
|
patchelf --set-rpath "$oldrpath:${lib.makeLibraryPath [ xen-slim ]}" "$libvmi"
|
|
'';
|
|
|
|
passthru = {
|
|
updateScript = unstableGitUpdater { tagPrefix = "v"; };
|
|
inherit libVersion;
|
|
};
|
|
|
|
meta = {
|
|
description = "C library for virtual machine introspection";
|
|
longDescription = ''
|
|
LibVMI is a C library with Python bindings that makes it easy to monitor the low-level
|
|
details of a running virtual machine by viewing its memory, trapping on hardware events,
|
|
and accessing the vCPU registers.
|
|
'';
|
|
homepage = "https://libvmi.com/";
|
|
license = with lib.licenses; [
|
|
gpl3Only
|
|
lgpl3Only
|
|
];
|
|
platforms = [ "x86_64-linux" ];
|
|
maintainers = with lib.maintainers; [ sigmasquadron ];
|
|
};
|
|
}
|