nixpkgs/pkgs/development/libraries/libvirt-glib/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

91 lines
2.3 KiB
Nix
Raw Normal View History

2021-04-15 00:03:57 +00:00
{ lib
, stdenv
, fetchurl
2021-09-28 12:09:39 +00:00
, fetchpatch
2021-04-15 00:03:57 +00:00
, meson
, ninja
, pkg-config
, gettext
, vala
, libcap_ng
, libvirt
, libxml2
2023-01-25 15:00:41 +00:00
, withIntrospection ? stdenv.hostPlatform == stdenv.buildPlatform
, gobject-introspection
, withDocs ? stdenv.hostPlatform == stdenv.buildPlatform
, gtk-doc
, docbook-xsl-nons
}:
2019-08-20 17:49:10 +00:00
stdenv.mkDerivation rec {
2021-06-22 13:21:29 +00:00
pname = "libvirt-glib";
version = "4.0.0";
2023-01-25 15:00:41 +00:00
outputs = [ "out" "dev" ] ++ lib.optional withDocs "devdoc";
2018-03-15 18:09:30 +00:00
src = fetchurl {
2021-06-22 13:21:29 +00:00
url = "https://libvirt.org/sources/glib/${pname}-${version}.tar.xz";
2021-04-15 00:03:57 +00:00
sha256 = "hCP3Bp2qR2MHMh0cEeLswoU0DNMsqfwFIHdihD7erL0=";
};
2021-09-28 12:09:39 +00:00
patches = [
# Fix build with GLib 2.70
(fetchpatch {
url = "https://gitlab.com/libvirt/libvirt-glib/-/commit/9a34c4ea55e0246c34896e48b8ecd637bc559ac7.patch";
sha256 = "UU70uTi55EzPMuLYVKRzpVcd3WogeAtWAWEC2hWlR7k=";
})
];
2021-04-15 00:03:57 +00:00
nativeBuildInputs = [
meson
ninja
pkg-config
gettext
vala
gobject-introspection
2023-01-25 15:00:41 +00:00
] ++ lib.optionals withIntrospection [
gobject-introspection
] ++ lib.optionals withDocs [
gtk-doc
docbook-xsl-nons
2021-04-15 00:03:57 +00:00
];
2023-01-25 15:00:41 +00:00
buildInputs = [
2021-04-15 00:03:57 +00:00
libvirt
libxml2
2023-01-25 15:00:41 +00:00
] ++ lib.optionals stdenv.isLinux [
libcap_ng
] ++ lib.optionals withIntrospection [
2021-04-15 00:03:57 +00:00
gobject-introspection
];
2019-08-20 17:49:10 +00:00
strictDeps = true;
2017-03-25 13:58:26 +00:00
2023-01-25 15:00:41 +00:00
# The build system won't let us build with docs or introspection
# unless we're building natively, but will still do a mandatory
# check for the dependencies for those things unless we explicitly
# disable the options.
mesonFlags = [
(lib.mesonEnable "docs" withDocs)
(lib.mesonEnable "introspection" withIntrospection)
];
# https://gitlab.com/libvirt/libvirt-glib/-/issues/4
NIX_CFLAGS_COMPILE = [ "-Wno-error=pointer-sign" ];
meta = with lib; {
description = "Library for working with virtual machines";
longDescription = ''
libvirt-glib wraps libvirt to provide a high-level object-oriented API better
suited for glib-based applications, via three libraries:
- libvirt-glib - GLib main loop integration & misc helper APIs
- libvirt-gconfig - GObjects for manipulating libvirt XML documents
- libvirt-gobject - GObjects for managing libvirt objects
'';
homepage = "https://libvirt.org/";
license = licenses.lgpl2Plus;
2022-08-02 23:57:01 +00:00
platforms = platforms.unix;
};
}