14 , withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages
15 , gobject-introspection
16 , withDocs ? stdenv.hostPlatform == stdenv.buildPlatform
21 stdenv.mkDerivation rec {
22 pname = "libvirt-glib";
25 outputs = [ "out" "dev" ] ++ lib.optional withDocs "devdoc";
28 url = "https://libvirt.org/sources/glib/${pname}-${version}.tar.xz";
29 sha256 = "hCP3Bp2qR2MHMh0cEeLswoU0DNMsqfwFIHdihD7erL0=";
33 # Fix build with GLib 2.70
35 url = "https://gitlab.com/libvirt/libvirt-glib/-/commit/9a34c4ea55e0246c34896e48b8ecd637bc559ac7.patch";
36 sha256 = "UU70uTi55EzPMuLYVKRzpVcd3WogeAtWAWEC2hWlR7k=";
47 ] ++ lib.optionals withIntrospection [
49 ] ++ lib.optionals withDocs [
57 ] ++ lib.optionals stdenv.isLinux [
63 # The build system won't let us build with docs or introspection
64 # unless we're building natively, but will still do a mandatory
65 # check for the dependencies for those things unless we explicitly
66 # disable the options.
68 (lib.mesonEnable "docs" withDocs)
69 (lib.mesonEnable "introspection" withIntrospection)
72 # https://gitlab.com/libvirt/libvirt-glib/-/issues/4
73 env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=pointer-sign" ];
76 description = "Library for working with virtual machines";
78 libvirt-glib wraps libvirt to provide a high-level object-oriented API better
79 suited for glib-based applications, via three libraries:
81 - libvirt-glib - GLib main loop integration & misc helper APIs
82 - libvirt-gconfig - GObjects for manipulating libvirt XML documents
83 - libvirt-gobject - GObjects for managing libvirt objects
85 homepage = "https://libvirt.org/";
86 license = licenses.lgpl2Plus;
87 platforms = platforms.unix;