2011-02-25 13:24:41 +00:00
|
|
|
{ stdenv, fetchurl, pkgconfig, libxml2, gnutls, devicemapper, perl, python
|
2013-07-24 13:41:20 +01:00
|
|
|
, iproute, iptables, readline, lvm2, utillinux, udev, libpciaccess, gettext
|
2013-09-14 09:35:31 +01:00
|
|
|
, libtasn1, ebtables, libgcrypt, yajl, makeWrapper, pmutils, libcap_ng
|
2015-02-18 02:42:14 +00:00
|
|
|
, dnsmasq, libnl, libpcap, libxslt, xhtml1
|
|
|
|
, pythonPackages, perlPackages
|
2011-03-14 14:46:41 +00:00
|
|
|
}:
|
2010-01-27 12:12:35 +00:00
|
|
|
|
2015-02-18 02:42:14 +00:00
|
|
|
let version = "1.2.12"; in
|
2010-01-27 12:12:35 +00:00
|
|
|
|
2014-10-08 18:01:05 +01:00
|
|
|
assert version == pythonPackages.libvirt.version;
|
|
|
|
|
2014-03-12 07:27:05 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2010-01-27 12:12:35 +00:00
|
|
|
name = "libvirt-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2014-03-12 07:27:05 +00:00
|
|
|
url = "http://libvirt.org/sources/${name}.tar.gz";
|
2015-02-18 02:42:14 +00:00
|
|
|
sha256 = "0sp6xm6iyg5wfjgxiba4rpl527429r22lh241dzxjq25fxzj5xgg";
|
2010-01-27 12:12:35 +00:00
|
|
|
};
|
|
|
|
|
2014-03-12 07:27:05 +00:00
|
|
|
buildInputs = [
|
|
|
|
pkgconfig libxml2 gnutls devicemapper perl python readline lvm2
|
|
|
|
utillinux udev libpciaccess gettext libtasn1 libgcrypt yajl makeWrapper
|
2015-02-18 02:42:14 +00:00
|
|
|
libcap_ng libnl libxslt xhtml1 perlPackages.XMLXPath
|
2014-03-12 07:27:05 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
PATH=${iproute}/sbin:${iptables}/sbin:${ebtables}/sbin:${lvm2}/sbin:${udev}/sbin:${dnsmasq}/bin:$PATH
|
2015-01-08 09:26:49 +00:00
|
|
|
patchShebangs . # fixes /usr/bin/python references
|
2014-03-12 07:27:05 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--with-init-script=redhat"
|
2014-03-27 13:08:36 +00:00
|
|
|
"--with-macvtap"
|
|
|
|
"--with-virtualport"
|
2014-10-27 16:34:41 +00:00
|
|
|
"--with-libpcap"
|
2014-03-12 07:27:05 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
installFlags = [
|
|
|
|
"localstatedir=$(TMPDIR)/var"
|
|
|
|
"sysconfdir=$(out)/etc"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
2014-06-16 15:45:08 +01:00
|
|
|
sed -i 's/ON_SHUTDOWN=suspend/ON_SHUTDOWN=''${ON_SHUTDOWN:-suspend}/' $out/libexec/libvirt-guests.sh
|
2014-03-12 07:27:05 +00:00
|
|
|
substituteInPlace $out/libexec/libvirt-guests.sh \
|
|
|
|
--replace "$out/bin" "${gettext}/bin"
|
|
|
|
wrapProgram $out/sbin/libvirtd \
|
|
|
|
--prefix PATH : ${iptables}/sbin:${iproute}/sbin:${pmutils}/bin
|
|
|
|
'';
|
2011-02-25 15:56:10 +00:00
|
|
|
|
2012-04-19 22:40:07 +01:00
|
|
|
enableParallelBuilding = true;
|
2014-03-12 07:27:05 +00:00
|
|
|
|
2012-05-06 23:39:39 +01:00
|
|
|
NIX_CFLAGS_COMPILE = "-fno-stack-protector";
|
2012-04-19 22:40:07 +01:00
|
|
|
|
2014-03-12 07:27:05 +00:00
|
|
|
meta = with stdenv.lib; {
|
2010-01-27 12:12:35 +00:00
|
|
|
homepage = http://libvirt.org/;
|
2014-03-27 13:27:12 +00:00
|
|
|
repositories.git = git://libvirt.org/libvirt.git;
|
2014-03-12 07:27:05 +00:00
|
|
|
description = ''
|
|
|
|
A toolkit to interact with the virtualization capabilities of recent
|
|
|
|
versions of Linux (and other OSes)
|
|
|
|
'';
|
|
|
|
license = licenses.lgpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
2010-01-27 12:12:35 +00:00
|
|
|
};
|
|
|
|
}
|