git.iko.soy/typeable/nixpkgs
on master help sign in
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.

commit4295e225f568a61836bcb89e92aa27cbdcd4f19f authorLeon Schuermann <leon-git@lschuermann.xyz> dateTue 4 Sep 2018, 13:30 (8 years ago) parent205f3e9
1 file changed+8
pkgs/development/libraries/libvmi/default.nix+8
pkgs/development/libraries/libvmi/default.nix+8
@@ -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";