Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

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.

authored by

Leon Schuermann and committed by
xeji
4295e225 205f3e94

+8
+8
pkgs/development/libraries/libvmi/default.nix
··· 15 15 stdenv.mkDerivation rec { 16 16 name = "libvmi-${version}"; 17 17 version = "0.12.0"; 18 + libVersion = "0.0.12"; 18 19 19 20 src = fetchFromGitHub { 20 21 owner = "libvmi"; ··· 27 28 nativeBuildInputs = [ autoreconfHook bison flex pkgconfig ]; 28 29 29 30 configureFlags = optional (!xenSupport) "--disable-xen"; 31 + 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 + ''; 30 38 31 39 meta = with stdenv.lib; { 32 40 homepage = "http://libvmi.com/";