libvmi: 0.12.0 -> 0.14.0-unstable-2024-08-06

Also splits the package output and adds more configuration options.

Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
This commit is contained in:
Fernando Rodrigues 2024-08-01 19:02:19 +00:00
parent 0fae3ce962
commit 6c437afe2c
No known key found for this signature in database
GPG Key ID: CC3AE2EA00000000

View File

@ -2,64 +2,96 @@
lib,
stdenv,
fetchFromGitHub,
unstableGitUpdater,
autoreconfHook,
autoconf-archive,
bison,
flex,
glib,
pkg-config,
json_c,
xen,
libvirt,
withVMIFS ? true,
fuse,
legacyKVM ? false,
libkvmi,
xenSupport ? true,
xen-slim,
}:
stdenv.mkDerivation rec {
let
pname = "libvmi";
version = "0.12.0";
libVersion = "0.0.12";
version = "0.14.0-unstable-2024-08-06";
libVersion = "0.0.15";
src = fetchFromGitHub {
owner = "libvmi";
repo = "libvmi";
rev = "v${version}";
sha256 = "0wbi2nasb1gbci6cq23g6kq7i10rwi1y7r44rl03icr5prqjpdyv";
rev = "bdb9ffb8f1f70b425454bc41da2be353cc6cbf5c";
hash = "sha256-5K+9Qq5vGeYYy8kqWIeO25iNJoD/HvtyircH6odr/qA=";
};
in
stdenv.mkDerivation {
inherit pname version src;
outputs = [
"out"
"lib"
"dev"
];
buildInputs = [
glib
libvirt
json_c
] ++ (lib.optional xenSupport xen);
nativeBuildInputs = [
autoreconfHook
autoconf-archive
bison
flex
pkg-config
];
configureFlags = lib.optional (!xenSupport) "--disable-xen";
buildInputs =
[
glib
json_c
libvirt
]
++ lib.optionals xenSupport [ xen-slim ]
++ lib.optionals (!legacyKVM) [ libkvmi ]
++ lib.optionals withVMIFS [ fuse ];
configureFlags =
lib.optionals (!xenSupport) [ "--disable-xen" ]
++ lib.optionals legacyKVM [ "--enable-kvm-legacy" ]
++ lib.optionals withVMIFS [ "--enable-vmifs" ];
# libvmi uses dlopen() for the xen libraries, however autoPatchelfHook doesn't work here
postFixup = lib.optionalString xenSupport ''
libvmi="$out/lib/libvmi.so.${libVersion}"
libvmi="$lib/lib/libvmi.so.${libVersion}"
oldrpath=$(patchelf --print-rpath "$libvmi")
patchelf --set-rpath "$oldrpath:${lib.makeLibraryPath [ xen ]}" "$libvmi"
patchelf --set-rpath "$oldrpath:${lib.makeLibraryPath [ xen-slim ]}" "$libvmi"
'';
meta = with lib; {
homepage = "https://libvmi.com/";
passthru = {
updateScript = unstableGitUpdater { tagPrefix = "v"; };
inherit libVersion;
};
meta = {
description = "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
homepage = "https://libvmi.com/";
license = with lib.licenses; [
gpl3Only
lgpl3Only
];
platforms = platforms.linux;
maintainers = [ ];
broken = true;
platforms = [ "x86_64-linux" ];
maintainers = with lib.maintainers; [ sigmasquadron ];
};
}