From bff9f2720f36ff1f3ac3ac86a3c0adb9d572c7e7 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Wed, 8 Aug 2012 02:30:25 +0400 Subject: [PATCH 1/3] Revert "xen: update to version 4.1.2" This reverts commit af32fd6ce3ce2ae138c2fc2bc5c6067216f8b828. --- .../virtualization/xen/default.nix | 19 +++------ .../virtualization/xen/gcc-4.5.patch | 39 +++++++++++++++++++ 2 files changed, 45 insertions(+), 13 deletions(-) create mode 100644 pkgs/applications/virtualization/xen/gcc-4.5.patch diff --git a/pkgs/applications/virtualization/xen/default.nix b/pkgs/applications/virtualization/xen/default.nix index d898daad2a77..ce799242e12e 100644 --- a/pkgs/applications/virtualization/xen/default.nix +++ b/pkgs/applications/virtualization/xen/default.nix @@ -6,7 +6,7 @@ with stdenv.lib; let - version = "4.1.2"; + version = "4.0.3"; libDir = if stdenv.is64bit then "lib64" else "lib"; @@ -30,24 +30,23 @@ let } ]; - ipxeSrc = - { url = http://xenbits.xensource.com/xen-extfiles/ipxe-git-v1.0.0.tar.gz; - sha256 = "d3128bfda9a1542049c278755f85bbcbb8441da7bfd702d511ce237fcf86a723"; - }; -in +in stdenv.mkDerivation { name = "xen-${version}"; src = fetchurl { url = "http://bits.xensource.com/oss-xen/release/${version}/xen-${version}.tar.gz"; - sha256 = "7d9c93057cf480d3f1efa792b19285a84fa3c06060ea5c5c453be00887389b0d"; + sha256 = "0p4i7mm8cdsr8i9z3dij6nriyvz6la2rhm7jkyk2n8h62nnxi1b5"; }; patches = [ # Xen looks for headers in /usr/include and for libraries using # ldconfig. Don't do that. ./has-header.patch + + # GCC 4.5 compatibility. + ./gcc-4.5.patch ]; buildInputs = @@ -103,18 +102,12 @@ stdenv.mkDerivation { --replace 'XENDOM_CONFIG=/etc/sysconfig/xendomains' "" \ --replace /bin/ls ls - grep -rl /etc/xen * | xargs sed -i 's|/etc/xen|$out/etc/xen|g' - # 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} '')} - ${let src = fetchurl ipxeSrc; in '' - cp ${src} tools/firmware/etherboot/ipxe.tar.gz - ''} - # 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 diff --git a/pkgs/applications/virtualization/xen/gcc-4.5.patch b/pkgs/applications/virtualization/xen/gcc-4.5.patch new file mode 100644 index 000000000000..a8412d69fd3f --- /dev/null +++ b/pkgs/applications/virtualization/xen/gcc-4.5.patch @@ -0,0 +1,39 @@ +http://lists.xensource.com/archives/html/xen-devel/2010-07/msg01276.html + +diff -ru -x '*~' xen-4.0.1-orig//extras/mini-os/arch/x86/mm.c xen-4.0.1//extras/mini-os/arch/x86/mm.c +--- xen-4.0.1-orig//extras/mini-os/arch/x86/mm.c 2010-08-25 12:22:07.000000000 +0200 ++++ xen-4.0.1//extras/mini-os/arch/x86/mm.c 2010-12-22 20:10:05.000000000 +0100 +@@ -281,7 +281,7 @@ + /* + * Mark portion of the address space read only. + */ +-extern void shared_info; ++extern char shared_info[PAGE_SIZE]; + static void set_readonly(void *text, void *etext) + { + unsigned long start_address = +diff -ru -x '*~' xen-4.0.1-orig//extras/mini-os/minios.mk xen-4.0.1//extras/mini-os/minios.mk +--- xen-4.0.1-orig//extras/mini-os/minios.mk 2010-08-25 12:22:07.000000000 +0200 ++++ xen-4.0.1//extras/mini-os/minios.mk 2010-12-22 20:03:11.000000000 +0100 +@@ -10,6 +10,7 @@ + DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,) + DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline) + DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline ++DEF_CFLAGS += -Wno-uninitialized + DEF_CPPFLAGS += -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION) + + DEF_ASFLAGS += -D__ASSEMBLY__ +diff -ru -x '*~' xen-4.0.1-orig//extras/mini-os/netfront.c xen-4.0.1//extras/mini-os/netfront.c +--- xen-4.0.1-orig//extras/mini-os/netfront.c 2010-08-25 12:22:07.000000000 +0200 ++++ xen-4.0.1//extras/mini-os/netfront.c 2010-12-22 19:56:59.000000000 +0100 +@@ -25,8 +25,8 @@ + + + +-#define NET_TX_RING_SIZE __RING_SIZE((struct netif_tx_sring *)0, PAGE_SIZE) +-#define NET_RX_RING_SIZE __RING_SIZE((struct netif_rx_sring *)0, PAGE_SIZE) ++#define NET_TX_RING_SIZE __CONST_RING_SIZE(netif_tx, PAGE_SIZE) ++#define NET_RX_RING_SIZE __CONST_RING_SIZE(netif_rx, PAGE_SIZE) + #define GRANT_INVALID_REF 0 + + From da7408e105d605596ac926dd990d2c2e7aee2bc8 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Wed, 8 Aug 2012 02:33:06 +0400 Subject: [PATCH 2/3] xen: Support PCI passthrough. Previous commit reverted Xen back to 4.0.3 because xend from 4.1.* and newer hangs for unknown reasons. The new "xl" toolstack from 4.1.* and unstable works, yet PCI passthrough is not supported by xl in 4.1.* and is broken in the unstable. With this patch I was able to passthrough ATI Radeon HD 6950 without 3D acceleration, though, to both Linux and Windows guests. Which is the best archived result with Xen PCI passthrough on NixOS after trying out all possible Xen versions. Same VGA card works fine if passed through into a guest with KVM (acceleration, GPGPU, everything works). I should have tried KVM from the start. --- pkgs/applications/virtualization/xen/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/applications/virtualization/xen/default.nix b/pkgs/applications/virtualization/xen/default.nix index ce799242e12e..3cb16a6b4425 100644 --- a/pkgs/applications/virtualization/xen/default.nix +++ b/pkgs/applications/virtualization/xen/default.nix @@ -79,6 +79,9 @@ stdenv.mkDerivation { substituteInPlace tools/xenstat/Makefile \ --replace /usr/include/curses.h ${ncurses}/include/curses.h + substituteInPlace tools/ioemu-qemu-xen/xen-hooks.mak \ + --replace /usr/include/pci ${pciutils}/include/pci + # Work around a bug in our GCC wrapper: `gcc -MF foo -v' doesn't # print the GCC version number properly. substituteInPlace xen/Makefile \ From 179b1bd2943edb2be18c67813e1f4af7dd21cf87 Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Wed, 8 Aug 2012 03:58:17 +0400 Subject: [PATCH 3/3] Add package enca 1.13 to tools/text --- pkgs/tools/text/enca/default.nix | 29 +++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 31 insertions(+) create mode 100644 pkgs/tools/text/enca/default.nix diff --git a/pkgs/tools/text/enca/default.nix b/pkgs/tools/text/enca/default.nix new file mode 100644 index 000000000000..ce1c7401a4e0 --- /dev/null +++ b/pkgs/tools/text/enca/default.nix @@ -0,0 +1,29 @@ +{ stdenv, fetchurl, libiconv ? null }: + +stdenv.mkDerivation rec { + name = "enca-1.13"; + + src = fetchurl { + url = "http://dl.cihar.com/enca/${name}.tar.bz2"; + sha256 = "6c091455d524b3ddae3533fe9bb375092f60ad6fe252e0777c873bd7869c7432"; + }; + + buildInputs = (stdenv.lib.optional (libiconv != null) libiconv); + + meta = { + homepage = http://freecode.com/projects/enca; + description = "Detects the encoding of text files and reencodes them"; + + longDescription = '' + Enca detects the encoding of text files, on the basis of knowledge + of their language. It can also convert them to other encodings, + allowing you to recode files without knowing their current encoding. + It supports most of Central and East European languages, and a few + Unicode variants, independently on language. + ''; + + license = "GPLv2"; + + platforms = stdenv.lib.platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 79bd75833174..356384e95cb3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -447,6 +447,8 @@ let eggdrop = callPackage ../tools/networking/eggdrop { }; + enca = callPackage ../tools/text/enca { }; + mcrl = callPackage ../tools/misc/mcrl { }; mcrl2 = callPackage ../tools/misc/mcrl2 { };