lol
1{ stdenv, fetchurl, pkgconfig, libvirt, glib, libxml2, intltool, libtool, yajl
2, nettle, libgcrypt, python, pygobject, gobjectIntrospection, libcap_ng
3}:
4
5stdenv.mkDerivation rec {
6 name = "libvirt-glib-0.2.0";
7
8 src = fetchurl {
9 url = "http://libvirt.org/sources/glib/${name}.tar.gz";
10 sha256 = "02saqkk4wzsimsan7s9yc5bx05xn7j00hnxhq4sczkgr4krf1drh";
11 };
12
13 buildInputs = [
14 pkgconfig libvirt glib libxml2 intltool libtool yajl nettle libgcrypt
15 python pygobject gobjectIntrospection libcap_ng
16 ];
17
18 # Compiler flag -fstack-protector-all fixes this build error:
19 #
20 # ./.libs/libvirt-glib-1.0.so: undefined reference to `__stack_chk_guard'
21 #
22 # And the extra include path fixes this build error:
23 #
24 # In file included from ../libvirt-gobject/libvirt-gobject-domain-device.h:30:0,
25 # from /tmp/nix-build-libvirt-glib-0.1.7.drv-2/libvirt-glib-0.1.7/libvirt-gobject/libvirt-gobject.h:33,
26 # from <stdin>:4:
27 # ../libvirt-gobject/libvirt-gobject-domain.h:33:29: fatal error: libvirt/libvirt.h: No such file or directory
28 # compilation terminated.
29 # make[3]: *** [LibvirtGObject-1.0.gir] Error 1
30 preConfigure = ''
31 export NIX_CFLAGS_COMPILE="-fstack-protector-all -I${libvirt}/include"
32 '';
33
34 meta = with stdenv.lib; {
35 description = "Library for working with virtual machines";
36 longDescription = ''
37 libvirt-glib wraps libvirt to provide a high-level object-oriented API better
38 suited for glib-based applications, via three libraries:
39
40 - libvirt-glib - GLib main loop integration & misc helper APIs
41 - libvirt-gconfig - GObjects for manipulating libvirt XML documents
42 - libvirt-gobject - GObjects for managing libvirt objects
43 '';
44 homepage = http://libvirt.org/;
45 license = licenses.lgpl2Plus;
46 platforms = platforms.linux;
47 };
48}