Author: eelco
Date: Tue Sep 14 13:50:32 2010
New Revision: 23788
URL: https://svn.nixos.org/websvn/nix/?rev=23788&sc=1

Log:
* Fix various references to /usr.

Modified:
   nixpkgs/trunk/pkgs/applications/virtualization/xen/default.nix

Modified: nixpkgs/trunk/pkgs/applications/virtualization/xen/default.nix
==============================================================================
--- nixpkgs/trunk/pkgs/applications/virtualization/xen/default.nix      Tue Sep 
14 12:47:19 2010        (r23787)
+++ nixpkgs/trunk/pkgs/applications/virtualization/xen/default.nix      Tue Sep 
14 13:50:32 2010        (r23788)
@@ -1,5 +1,6 @@
 { stdenv, fetchurl, which, zlib, pkgconfig, SDL, openssl, python
-, libuuid, gettext, ncurses, dev86, iasl, pciutils, bzip2, xz }:
+, libuuid, gettext, ncurses, dev86, iasl, pciutils, bzip2, xz
+, lvm2, utillinux, procps }:
 
 let version = "4.0.1"; in 
 
@@ -26,18 +27,47 @@
 
   buildFlags = "xen tools";
 
+  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
+
+      # 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'
+    '';
+
   installPhase =
     ''
       cp -prvd dist/install/nix/store/* $out
       cp -prvd dist/install/boot $out/boot
     ''; # */
 
-  # Set the Python search path in all Python scripts.
   postFixup =
     ''
+      # Set the Python search path in all Python scripts.
       for fn in $(grep -l '#!.*python' $out/bin/* $out/sbin/*); do
           sed -i "$fn" -e "1 a import sys\nsys.path = 
['$out/lib/python2.6/site-packages'] + sys.path"
       done
+
+      # Remove calls to `env'.
+      for fn in $(grep -l '#!.*/env.*python' $out/bin/* $out/sbin/*); do
+          sed -i "$fn" -e "1 s^/nix/store/.*/env.*python^${python}/bin/python^"
+      done
     ''; # */
 
   meta = {
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to