2018-06-28 00:24:47 +02:00
|
|
|
{ stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
autoreconfHook,
|
|
|
|
bison,
|
|
|
|
flex,
|
|
|
|
glib,
|
|
|
|
pkgconfig,
|
|
|
|
json_c,
|
|
|
|
xen,
|
2018-06-28 00:25:44 +02:00
|
|
|
libvirt,
|
|
|
|
xenSupport ? true }:
|
2017-06-11 19:49:33 +02:00
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "libvmi";
|
2018-07-03 19:14:04 +02:00
|
|
|
version = "0.12.0";
|
2018-09-04 13:30:07 +02:00
|
|
|
libVersion = "0.0.12";
|
2017-06-11 19:49:33 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libvmi";
|
|
|
|
repo = "libvmi";
|
2018-07-03 19:14:04 +02:00
|
|
|
rev = "v${version}";
|
2018-06-28 00:24:47 +02:00
|
|
|
sha256 = "0wbi2nasb1gbci6cq23g6kq7i10rwi1y7r44rl03icr5prqjpdyv";
|
2017-06-11 19:49:33 +02:00
|
|
|
};
|
|
|
|
|
2018-07-04 10:14:57 +02:00
|
|
|
buildInputs = [ glib libvirt json_c ] ++ (optional xenSupport xen);
|
|
|
|
nativeBuildInputs = [ autoreconfHook bison flex pkgconfig ];
|
2017-06-11 19:49:33 +02:00
|
|
|
|
2018-06-28 00:25:44 +02:00
|
|
|
configureFlags = optional (!xenSupport) "--disable-xen";
|
|
|
|
|
2018-09-04 13:30:07 +02: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"
|
|
|
|
'';
|
|
|
|
|
2017-06-11 19:49:33 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
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-28 00:42:33 +02:00
|
|
|
license = with licenses; [ gpl3 lgpl3 ];
|
2018-07-03 19:17:51 +02:00
|
|
|
platforms = platforms.linux;
|
2018-06-27 23:33:00 +02:00
|
|
|
maintainers = with maintainers; [ lschuermann ];
|
2017-06-11 19:49:33 +02:00
|
|
|
};
|
|
|
|
}
|