@@ -15,6 +15,7 @@ with stdenv.lib;
1515stdenv.mkDerivation rec {
1616 name = "libvmi-${version}";
1717 version = "0.12.0";
18+ libVersion = "0.0.12";
1819
1920 src = fetchFromGitHub {
2021 owner = "libvmi";
@@ -28,6 +29,13 @@ stdenv.mkDerivation rec {
2829
2930 configureFlags = optional (!xenSupport) "--disable-xen";
3031
32+ # libvmi uses dlopen() for the xen libraries, however autoPatchelfHook doesn't work here
33+ postFixup = optionalString xenSupport ''
34+ libvmi="$out/lib/libvmi.so.${libVersion}"
35+ oldrpath=$(patchelf --print-rpath "$libvmi")
36+ patchelf --set-rpath "$oldrpath:${makeLibraryPath [ xen ]}" "$libvmi"
37+ '';
38+
3139 meta = with stdenv.lib; {
3240 homepage = "http://libvmi.com/";
3341 description = "A C library for virtual machine introspection";