2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv,
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchFromGitHub,
|
|
|
|
autoreconfHook,
|
|
|
|
bison,
|
|
|
|
flex,
|
|
|
|
glib,
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config,
|
2020-04-24 23:36:52 +00:00
|
|
|
json_c,
|
|
|
|
xen,
|
|
|
|
libvirt,
|
|
|
|
xenSupport ? true }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libvmi";
|
|
|
|
version = "0.12.0";
|
|
|
|
libVersion = "0.0.12";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libvmi";
|
|
|
|
repo = "libvmi";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0wbi2nasb1gbci6cq23g6kq7i10rwi1y7r44rl03icr5prqjpdyv";
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
buildInputs = [ glib libvirt json_c ] ++ (lib.optional xenSupport xen);
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook bison flex pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
configureFlags = lib.optional (!xenSupport) "--disable-xen";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# libvmi uses dlopen() for the xen libraries, however autoPatchelfHook doesn't work here
|
2023-02-02 18:25:31 +00:00
|
|
|
postFixup = lib.optionalString xenSupport ''
|
2020-04-24 23:36:52 +00:00
|
|
|
libvmi="$out/lib/libvmi.so.${libVersion}"
|
|
|
|
oldrpath=$(patchelf --print-rpath "$libvmi")
|
2023-02-02 18:25:31 +00:00
|
|
|
patchelf --set-rpath "$oldrpath:${lib.makeLibraryPath [ xen ]}" "$libvmi"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-08-05 21:33:18 +00:00
|
|
|
homepage = "https://libvmi.com/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A 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.
|
|
|
|
'';
|
|
|
|
license = with licenses; [ gpl3 lgpl3 ];
|
|
|
|
platforms = platforms.linux;
|
2024-01-13 08:15:51 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|