libvirt: make it build on darwin
Not sure if it works, but it no longer fails miserably at build time
This commit is contained in:
parent
50a00101c1
commit
6878b2b21d
@ -2,6 +2,7 @@
|
|||||||
, iproute, iptables, readline, lvm2, utillinux, udev, libpciaccess, gettext
|
, iproute, iptables, readline, lvm2, utillinux, udev, libpciaccess, gettext
|
||||||
, libtasn1, ebtables, libgcrypt, yajl, makeWrapper, pmutils, libcap_ng
|
, libtasn1, ebtables, libgcrypt, yajl, makeWrapper, pmutils, libcap_ng
|
||||||
, dnsmasq, libnl, libpcap, libxslt, xhtml1, numad, numactl, perlPackages
|
, dnsmasq, libnl, libpcap, libxslt, xhtml1, numad, numactl, perlPackages
|
||||||
|
, curl, libiconv, gmp
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
@ -14,25 +15,39 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
pkgconfig libxml2 gnutls devicemapper perl python readline lvm2
|
pkgconfig libxml2 gnutls perl python readline
|
||||||
utillinux udev libpciaccess gettext libtasn1 libgcrypt yajl makeWrapper
|
gettext libtasn1 libgcrypt yajl makeWrapper
|
||||||
libcap_ng libnl libxslt xhtml1 perlPackages.XMLXPath numad numactl
|
libxslt xhtml1 perlPackages.XMLXPath curl
|
||||||
|
] ++ stdenv.lib.optionals stdenv.isLinux [
|
||||||
|
libpciaccess devicemapper lvm2 utillinux udev libcap_ng libnl numad numactl
|
||||||
|
] ++ stdenv.lib.optionals stdenv.isDarwin [
|
||||||
|
libiconv gmp
|
||||||
];
|
];
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = stdenv.lib.optionalString stdenv.isLinux ''
|
||||||
PATH=${iproute}/sbin:${iptables}/sbin:${ebtables}/sbin:${lvm2}/sbin:${udev}/sbin:${dnsmasq}/bin:$PATH
|
PATH=${iproute}/sbin:${iptables}/sbin:${ebtables}/sbin:${lvm2}/sbin:${udev}/sbin:$PATH
|
||||||
substituteInPlace configure --replace 'as_dummy="/bin:/usr/bin:/usr/sbin"' 'as_dummy="${numad}/bin"'
|
substituteInPlace configure --replace 'as_dummy="/bin:/usr/bin:/usr/sbin"' 'as_dummy="${numad}/bin"'
|
||||||
|
'' + ''
|
||||||
|
PATH=${dnsmasq}/bin:$PATH
|
||||||
patchShebangs . # fixes /usr/bin/python references
|
patchShebangs . # fixes /usr/bin/python references
|
||||||
'';
|
'';
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--localstatedir=/var"
|
"--localstatedir=/var"
|
||||||
"--sysconfdir=/etc"
|
"--sysconfdir=/etc"
|
||||||
"--with-init-script=redhat"
|
"--with-libpcap"
|
||||||
|
"--with-vmware"
|
||||||
|
"--with-vbox"
|
||||||
|
"--with-test"
|
||||||
|
"--with-esx"
|
||||||
|
"--with-remote"
|
||||||
|
] ++ stdenv.lib.optionals stdenv.isLinux [
|
||||||
|
"--with-numad"
|
||||||
"--with-macvtap"
|
"--with-macvtap"
|
||||||
"--with-virtualport"
|
"--with-virtualport"
|
||||||
"--with-libpcap"
|
"--with-init-script=redhat"
|
||||||
"--with-numad"
|
] ++ stdenv.lib.optionals stdenv.isDarwin [
|
||||||
|
"--with-init-script=none"
|
||||||
];
|
];
|
||||||
|
|
||||||
installFlags = [
|
installFlags = [
|
||||||
@ -44,6 +59,7 @@ stdenv.mkDerivation rec {
|
|||||||
sed -i 's/ON_SHUTDOWN=suspend/ON_SHUTDOWN=''${ON_SHUTDOWN:-suspend}/' $out/libexec/libvirt-guests.sh
|
sed -i 's/ON_SHUTDOWN=suspend/ON_SHUTDOWN=''${ON_SHUTDOWN:-suspend}/' $out/libexec/libvirt-guests.sh
|
||||||
substituteInPlace $out/libexec/libvirt-guests.sh \
|
substituteInPlace $out/libexec/libvirt-guests.sh \
|
||||||
--replace "$out/bin" "${gettext}/bin"
|
--replace "$out/bin" "${gettext}/bin"
|
||||||
|
'' + stdenv.lib.optionalString stdenv.isLinux ''
|
||||||
wrapProgram $out/sbin/libvirtd \
|
wrapProgram $out/sbin/libvirtd \
|
||||||
--prefix PATH : ${iptables}/sbin:${iproute}/sbin:${pmutils}/bin:${numad}/bin:${numactl}/bin
|
--prefix PATH : ${iptables}/sbin:${iproute}/sbin:${pmutils}/bin:${numad}/bin:${numactl}/bin
|
||||||
'';
|
'';
|
||||||
@ -60,6 +76,6 @@ stdenv.mkDerivation rec {
|
|||||||
versions of Linux (and other OSes)
|
versions of Linux (and other OSes)
|
||||||
'';
|
'';
|
||||||
license = licenses.lgpl2Plus;
|
license = licenses.lgpl2Plus;
|
||||||
platforms = platforms.linux;
|
platforms = platforms.unix;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user