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.
This commit is contained in:
parent
205f3e941a
commit
4295e225f5
@ -15,6 +15,7 @@ with stdenv.lib;
|
||||
stdenv.mkDerivation rec {
|
||||
name = "libvmi-${version}";
|
||||
version = "0.12.0";
|
||||
libVersion = "0.0.12";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "libvmi";
|
||||
@ -28,6 +29,13 @@ stdenv.mkDerivation rec {
|
||||
|
||||
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";
|
||||
|
Loading…
Reference in New Issue
Block a user