1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/development/libraries/libvmi/default.nix
Leon Schuermann 4295e225f5 libvmi: fix libxenctrl dynamic loading (#45865)
libvmi uses dlopen() to only require libxenctrl if the Xen hypervisor is used,
which failed because libxenctrl could not be found.
Add xen libraries to libvmi's RUNPATH using patchelf.
2018-09-04 13:30:07 +02:00

52 lines
1.4 KiB
Nix

{ stdenv,
fetchFromGitHub,
autoreconfHook,
bison,
flex,
glib,
pkgconfig,
json_c,
xen,
libvirt,
xenSupport ? true }:
with stdenv.lib;
stdenv.mkDerivation rec {
name = "libvmi-${version}";
version = "0.12.0";
libVersion = "0.0.12";
src = fetchFromGitHub {
owner = "libvmi";
repo = "libvmi";
rev = "v${version}";
sha256 = "0wbi2nasb1gbci6cq23g6kq7i10rwi1y7r44rl03icr5prqjpdyv";
};
buildInputs = [ glib libvirt json_c ] ++ (optional xenSupport xen);
nativeBuildInputs = [ autoreconfHook bison flex pkgconfig ];
configureFlags = optional (!xenSupport) "--disable-xen";
# 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"
'';
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.
'';
license = with licenses; [ gpl3 lgpl3 ];
platforms = platforms.linux;
maintainers = with maintainers; [ lschuermann ];
};
}