2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv,
|
2018-06-27 23:24:47 +01:00
|
|
|
fetchFromGitHub,
|
|
|
|
autoreconfHook,
|
|
|
|
bison,
|
|
|
|
flex,
|
|
|
|
glib,
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config,
|
2018-06-27 23:24:47 +01:00
|
|
|
json_c,
|
|
|
|
xen,
|
2018-06-27 23:25:44 +01:00
|
|
|
libvirt,
|
|
|
|
xenSupport ? true }:
|
2017-06-11 18:49:33 +01:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
with lib;
|
2017-06-11 18:49:33 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "libvmi";
|
2018-07-03 18:14:04 +01:00
|
|
|
version = "0.12.0";
|
2018-09-04 12:30:07 +01:00
|
|
|
libVersion = "0.0.12";
|
2017-06-11 18:49:33 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libvmi";
|
|
|
|
repo = "libvmi";
|
2018-07-03 18:14:04 +01:00
|
|
|
rev = "v${version}";
|
2018-06-27 23:24:47 +01:00
|
|
|
sha256 = "0wbi2nasb1gbci6cq23g6kq7i10rwi1y7r44rl03icr5prqjpdyv";
|
2017-06-11 18:49:33 +01:00
|
|
|
};
|
|
|
|
|
2018-07-04 09:14:57 +01:00
|
|
|
buildInputs = [ glib libvirt json_c ] ++ (optional xenSupport xen);
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook bison flex pkg-config ];
|
2017-06-11 18:49:33 +01:00
|
|
|
|
2018-06-27 23:25:44 +01:00
|
|
|
configureFlags = optional (!xenSupport) "--disable-xen";
|
|
|
|
|
2018-09-04 12:30:07 +01:00
|
|
|
# libvmi uses dlopen() for the xen libraries, however autoPatchelfHook doesn't work here
|
|
|
|
postFixup = optionalString xenSupport ''
|
|
|
|
libvmi="$out/lib/libvmi.so.${libVersion}"
|
|
|
|
oldrpath=$(patchelf --print-rpath "$libvmi")
|
|
|
|
patchelf --set-rpath "$oldrpath:${makeLibraryPath [ xen ]}" "$libvmi"
|
|
|
|
'';
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2017-06-11 18:49:33 +01:00
|
|
|
homepage = "http://libvmi.com/";
|
|
|
|
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.
|
|
|
|
'';
|
2018-06-27 23:42:33 +01:00
|
|
|
license = with licenses; [ gpl3 lgpl3 ];
|
2018-07-03 18:17:51 +01:00
|
|
|
platforms = platforms.linux;
|
2020-10-28 13:32:06 +00:00
|
|
|
maintainers = with maintainers; [ matthiasbeyer ];
|
2017-06-11 18:49:33 +01:00
|
|
|
};
|
|
|
|
}
|