2011-03-29 17:19:59 +02:00
|
|
|
{ stdenv, fetchurl, which, zlib, pkgconfig, SDL, openssl
|
2010-09-14 15:50:32 +02:00
|
|
|
, libuuid, gettext, ncurses, dev86, iasl, pciutils, bzip2, xz
|
2011-03-29 17:19:59 +02:00
|
|
|
, lvm2, utillinux, procps, texinfo, perl, pythonPackages }:
|
2010-10-05 01:25:03 +02:00
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2012-08-08 00:30:25 +02:00
|
|
|
version = "4.0.3";
|
2010-10-05 01:25:03 +02:00
|
|
|
|
2010-10-06 13:04:07 +02:00
|
|
|
libDir = if stdenv.is64bit then "lib64" else "lib";
|
|
|
|
|
2010-10-05 01:25:03 +02:00
|
|
|
# Sources needed to build the stubdoms.
|
|
|
|
|
|
|
|
stubdomSrcs =
|
|
|
|
[ { url = http://xenbits.xensource.com/xen-extfiles/lwip-1.3.0.tar.gz;
|
|
|
|
sha256 = "13wlr85s1hnvia6a698qpryyy12lvmqw0a05xmjnd0h71ralsbkp";
|
|
|
|
}
|
|
|
|
{ url = http://xenbits.xensource.com/xen-extfiles/zlib-1.2.3.tar.gz;
|
|
|
|
sha256 = "0pmh8kifb6sfkqfxc23wqp3f2wzk69sl80yz7w8p8cd4cz8cg58p";
|
|
|
|
}
|
|
|
|
{ url = http://xenbits.xensource.com/xen-extfiles/newlib-1.16.0.tar.gz;
|
|
|
|
sha256 = "01rxk9js833mwadq92jx0flvk9jyjrnwrq93j39c2j2wjsa66hnv";
|
|
|
|
}
|
|
|
|
{ url = http://xenbits.xensource.com/xen-extfiles/grub-0.97.tar.gz;
|
|
|
|
sha256 = "02r6b52r0nsp6ryqfiqchnl7r1d9smm80sqx24494gmx5p8ia7af";
|
|
|
|
}
|
|
|
|
{ url = http://xenbits.xensource.com/xen-extfiles/pciutils-2.2.9.tar.bz2;
|
|
|
|
sha256 = "092v4q478i1gc7f3s2wz6p4xlf1wb4gs5shbkn21vnnmzcffc2pn";
|
|
|
|
}
|
|
|
|
];
|
2010-09-09 18:45:18 +02:00
|
|
|
|
2014-08-08 17:58:34 +02:00
|
|
|
in
|
2010-09-09 18:45:18 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "xen-${version}";
|
|
|
|
|
2008-10-04 17:24:08 +02:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://bits.xensource.com/oss-xen/release/${version}/xen-${version}.tar.gz";
|
2012-08-08 00:30:25 +02:00
|
|
|
sha256 = "0p4i7mm8cdsr8i9z3dij6nriyvz6la2rhm7jkyk2n8h62nnxi1b5";
|
2008-10-04 17:24:08 +02:00
|
|
|
};
|
|
|
|
|
2010-09-09 18:45:18 +02:00
|
|
|
patches =
|
|
|
|
[ # Xen looks for headers in /usr/include and for libraries using
|
|
|
|
# ldconfig. Don't do that.
|
|
|
|
./has-header.patch
|
2012-08-08 00:30:25 +02:00
|
|
|
|
|
|
|
# GCC 4.5 compatibility.
|
|
|
|
./gcc-4.5.patch
|
2010-09-09 18:45:18 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs =
|
2011-03-29 17:19:59 +02:00
|
|
|
[ which zlib pkgconfig SDL openssl libuuid gettext ncurses
|
|
|
|
dev86 iasl pciutils bzip2 xz texinfo perl
|
|
|
|
pythonPackages.python pythonPackages.wrapPython
|
2010-09-09 18:45:18 +02:00
|
|
|
];
|
|
|
|
|
2011-03-28 20:12:32 +02:00
|
|
|
pythonPath = [ pythonPackages.curses ];
|
|
|
|
|
2010-09-16 17:21:28 +02:00
|
|
|
makeFlags = "PREFIX=$(out) CONFIG_DIR=/etc";
|
2010-09-09 18:45:18 +02:00
|
|
|
|
2010-10-05 01:25:03 +02:00
|
|
|
buildFlags = "xen tools stubdom";
|
2008-10-04 17:24:08 +02:00
|
|
|
|
2010-09-14 15:50:32 +02:00
|
|
|
preBuild =
|
|
|
|
''
|
|
|
|
substituteInPlace tools/libfsimage/common/fsimage_plugin.c \
|
|
|
|
--replace /usr $out
|
|
|
|
|
|
|
|
substituteInPlace tools/blktap2/lvm/lvm-util.c \
|
|
|
|
--replace /usr/sbin/vgs ${lvm2}/sbin/vgs \
|
|
|
|
--replace /usr/sbin/lvs ${lvm2}/sbin/lvs
|
|
|
|
|
|
|
|
substituteInPlace tools/hotplug/Linux/network-bridge \
|
|
|
|
--replace /usr/bin/logger ${utillinux}/bin/logger
|
|
|
|
|
|
|
|
substituteInPlace tools/xenmon/xenmon.py \
|
|
|
|
--replace /usr/bin/pkill ${procps}/bin/pkill
|
|
|
|
|
|
|
|
substituteInPlace tools/xenstat/Makefile \
|
|
|
|
--replace /usr/include/curses.h ${ncurses}/include/curses.h
|
|
|
|
|
2012-08-08 00:33:06 +02:00
|
|
|
substituteInPlace tools/ioemu-qemu-xen/xen-hooks.mak \
|
|
|
|
--replace /usr/include/pci ${pciutils}/include/pci
|
|
|
|
|
2010-09-14 15:50:32 +02:00
|
|
|
# Work around a bug in our GCC wrapper: `gcc -MF foo -v' doesn't
|
|
|
|
# print the GCC version number properly.
|
|
|
|
substituteInPlace xen/Makefile \
|
|
|
|
--replace '$(CC) $(CFLAGS) -v' '$(CC) -v'
|
2010-09-16 17:21:28 +02:00
|
|
|
|
|
|
|
substituteInPlace tools/python/xen/xend/server/BlktapController.py \
|
|
|
|
--replace /usr/sbin/tapdisk2 $out/sbin/tapdisk2
|
|
|
|
|
|
|
|
substituteInPlace tools/python/xen/xend/XendQCoWStorageRepo.py \
|
|
|
|
--replace /usr/sbin/qcow-create $out/sbin/qcow-create
|
2010-10-05 01:25:03 +02:00
|
|
|
|
2010-10-06 13:04:07 +02:00
|
|
|
substituteInPlace tools/python/xen/remus/save.py \
|
|
|
|
--replace /usr/lib/xen/bin/xc_save $out/${libDir}/xen/bin/xc_save
|
|
|
|
|
|
|
|
substituteInPlace tools/python/xen/remus/device.py \
|
|
|
|
--replace /usr/lib/xen/bin/imqebt $out/${libDir}/xen/bin/imqebt
|
|
|
|
|
2010-10-06 18:04:04 +02:00
|
|
|
# Allow the location of the xendomains config file to be
|
|
|
|
# overriden at runtime.
|
|
|
|
substituteInPlace tools/hotplug/Linux/init.d/xendomains \
|
|
|
|
--replace 'XENDOM_CONFIG=/etc/sysconfig/xendomains' "" \
|
|
|
|
--replace /bin/ls ls
|
|
|
|
|
2010-10-05 01:25:03 +02:00
|
|
|
# Xen's stubdoms need various sources that it usually fetches at
|
|
|
|
# build time using wget. We can't have that.
|
|
|
|
${flip concatMapStrings stubdomSrcs (x: let src = fetchurl x; in ''
|
|
|
|
cp ${src} stubdom/${src.name}
|
|
|
|
'')}
|
2010-12-22 20:38:26 +01:00
|
|
|
|
|
|
|
# Hack to get `gcc -m32' to work without having 32-bit Glibc headers.
|
|
|
|
mkdir -p tools/include/gnu
|
|
|
|
touch tools/include/gnu/stubs-32.h
|
2010-09-14 15:50:32 +02:00
|
|
|
'';
|
|
|
|
|
2010-10-06 13:04:07 +02:00
|
|
|
postBuild =
|
|
|
|
''
|
|
|
|
make -C docs man-pages
|
|
|
|
'';
|
|
|
|
|
2010-09-09 18:45:18 +02:00
|
|
|
installPhase =
|
|
|
|
''
|
2011-07-02 21:21:28 +02:00
|
|
|
mkdir -p $out
|
|
|
|
cp -prvd dist/install/nix/store/*/* $out/
|
2010-09-09 18:45:18 +02:00
|
|
|
cp -prvd dist/install/boot $out/boot
|
2010-09-16 17:21:28 +02:00
|
|
|
cp -prvd dist/install/etc $out/etc
|
2010-10-06 13:04:07 +02:00
|
|
|
cp -dR docs/man1 docs/man5 $out/share/man/
|
2011-03-28 20:12:32 +02:00
|
|
|
wrapPythonPrograms
|
2010-09-10 12:53:17 +02:00
|
|
|
''; # */
|
|
|
|
|
2008-10-04 17:24:08 +02:00
|
|
|
meta = {
|
2010-09-09 18:45:18 +02:00
|
|
|
homepage = http://www.xen.org/;
|
|
|
|
description = "Xen hypervisor and management tools for Dom0";
|
2010-10-05 01:25:03 +02:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
|
|
|
maintainers = [ stdenv.lib.maintainers.eelco ];
|
2014-10-02 10:23:03 +02:00
|
|
|
broken = true; # bump to at least 4.1.6.1 to fix security issues
|
2008-10-04 17:24:08 +02:00
|
|
|
};
|
|
|
|
}
|