diff --git a/pkgs/applications/virtualization/xen/default.nix b/pkgs/applications/virtualization/xen/default.nix index 46625436798..b7c9c1c3d5b 100644 --- a/pkgs/applications/virtualization/xen/default.nix +++ b/pkgs/applications/virtualization/xen/default.nix @@ -1,36 +1,39 @@ -args : -let - lib = args.lib; - fetchurl = args.fetchurl; - fullDepEntry = args.fullDepEntry; +{ stdenv, fetchurl, which, zlib, pkgconfig, SDL, openssl, python +, libuuid, gettext, ncurses, dev86, iasl, pciutils, bzip2, xz }: + +let version = "4.0.1"; in + +stdenv.mkDerivation { + name = "xen-${version}"; - version = lib.attrByPath ["version"] "3.3.0" args; - _buildInputs = with args; [ - python e2fsprogs gnutls pkgconfig libjpeg - ncurses SDL libvncserver zlib graphviz ghostscript - texLive - ]; -in -rec { src = fetchurl { url = "http://bits.xensource.com/oss-xen/release/${version}/xen-${version}.tar.gz"; - sha256 = "0vghm31pqq8sc6x81jass2h5s22jlvv582xb8aq4j4cbcc5qixc9"; + sha256 = "0ww8j5fa2jxg0zyx7d7z9jyv2j47m8w420sy16w3rf8d80lisvbf"; }; - buildInputs = lib.filter (x: x != null) _buildInputs; - configureFlags = []; + patches = + [ # Xen looks for headers in /usr/include and for libraries using + # ldconfig. Don't do that. + ./has-header.patch + ]; - /* doConfigure should be specified separately */ - phaseNames = ["makeTools" "makeXen"]; + buildInputs = + [ which zlib pkgconfig SDL openssl python libuuid gettext ncurses + dev86 iasl pciutils bzip2 xz + ]; + + makeFlags = "PREFIX=$(out)"; + + buildFlags = "xen tools"; + + installPhase = + '' + cp -prvd dist/install/nix/store/* $out + cp -prvd dist/install/boot $out/boot + ''; # */ - makeTools = fullDepEntry (''make -C tools install PREFIX=$out '') - ["minInit" "addInputs" "doUnpack"]; - - makeXen = fullDepEntry (''make -C xen install PREFIX=$out '') - ["minInit" "addInputs" "doUnpack"]; - - name = "xen-" + version; meta = { - description = "Xen paravirtualization tools"; + homepage = http://www.xen.org/; + description = "Xen hypervisor and management tools for Dom0"; }; } diff --git a/pkgs/applications/virtualization/xen/has-header.patch b/pkgs/applications/virtualization/xen/has-header.patch new file mode 100644 index 00000000000..b59dd7ea5af --- /dev/null +++ b/pkgs/applications/virtualization/xen/has-header.patch @@ -0,0 +1,40 @@ +diff -ru --exclude '*~' xen-4.0.1-orig/tools/check/funcs.sh xen-4.0.1/tools/check/funcs.sh +--- xen-4.0.1-orig/tools/check/funcs.sh 2010-08-25 12:22:07.000000000 +0200 ++++ xen-4.0.1/tools/check/funcs.sh 2010-09-09 17:47:20.000000000 +0200 +@@ -25,33 +25,13 @@ + } + + has_header() { +- case $1 in +- /*) ;; +- *) set -- "/usr/include/$1" ;; +- esac +- +- check_sys_root || return 1 +- +- test -r "$CROSS_SYS_ROOT$1" +- return $? ++ echo "#include <$1>" | gcc -E - > /dev/null && return 0 ++ return 1 + } + + has_lib() { + check_sys_root || return 1 +- +- # subshell to prevent pollution of caller's environment +- ( +- PATH=/sbin:$PATH # for ldconfig +- +- # This relatively common in a sys-root; libs are installed but +- # ldconfig hasn't run there, so ldconfig -p won't work. +- if [ "$OS" = Linux -a ! -f "$CROSS_SYS_ROOT/etc/ld.so.cache" ]; then +- echo "Please run ldconfig -r \"$CROSS_SYS_ROOT\" to generate ld.so.cache" +- # fall through; ldconfig test below should fail +- fi +- ldconfig -p ${CROSS_SYS_ROOT+-r "$CROSS_SYS_ROOT"} | grep -Fq "$1" +- return $? +- ) ++ return 0 + } + + test_link() { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ead85f07f0d..1c57f9b84f4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6314,15 +6314,7 @@ let xdg_utils = callPackage ../tools/X11/xdg-utils { }; - /* Doesn't work yet - - xen = builderDefsPackage (import ../applications/virtualization/xen) { - inherit python e2fsprogs gnutls pkgconfig libjpeg - ncurses SDL libvncserver zlib; - texLive = if (getConfig ["xen" "texLive"] false) then texLive else null; - graphviz = if (getConfig ["xen" "graphviz"] false) then graphviz else null; - ghostscript = if (getConfig ["xen" "ghostscript"] false) then ghostscript else null; - }; */ + xen = callPackage ../applications/virtualization/xen { }; xfig = callPackage ../applications/graphics/xfig { stdenv = overrideGCC stdenv gcc34;