* Fix various references to /usr.

svn path=/nixpkgs/trunk/; revision=23788

+32 -2
+32 -2
pkgs/applications/virtualization/xen/default.nix
··· 1 1 { stdenv, fetchurl, which, zlib, pkgconfig, SDL, openssl, python 2 - , libuuid, gettext, ncurses, dev86, iasl, pciutils, bzip2, xz }: 2 + , libuuid, gettext, ncurses, dev86, iasl, pciutils, bzip2, xz 3 + , lvm2, utillinux, procps }: 3 4 4 5 let version = "4.0.1"; in 5 6 ··· 26 27 27 28 buildFlags = "xen tools"; 28 29 30 + preBuild = 31 + '' 32 + substituteInPlace tools/libfsimage/common/fsimage_plugin.c \ 33 + --replace /usr $out 34 + 35 + substituteInPlace tools/blktap2/lvm/lvm-util.c \ 36 + --replace /usr/sbin/vgs ${lvm2}/sbin/vgs \ 37 + --replace /usr/sbin/lvs ${lvm2}/sbin/lvs 38 + 39 + substituteInPlace tools/hotplug/Linux/network-bridge \ 40 + --replace /usr/bin/logger ${utillinux}/bin/logger 41 + 42 + substituteInPlace tools/xenmon/xenmon.py \ 43 + --replace /usr/bin/pkill ${procps}/bin/pkill 44 + 45 + substituteInPlace tools/xenstat/Makefile \ 46 + --replace /usr/include/curses.h ${ncurses}/include/curses.h 47 + 48 + # Work around a bug in our GCC wrapper: `gcc -MF foo -v' doesn't 49 + # print the GCC version number properly. 50 + substituteInPlace xen/Makefile \ 51 + --replace '$(CC) $(CFLAGS) -v' '$(CC) -v' 52 + ''; 53 + 29 54 installPhase = 30 55 '' 31 56 cp -prvd dist/install/nix/store/* $out 32 57 cp -prvd dist/install/boot $out/boot 33 58 ''; # */ 34 59 35 - # Set the Python search path in all Python scripts. 36 60 postFixup = 37 61 '' 62 + # Set the Python search path in all Python scripts. 38 63 for fn in $(grep -l '#!.*python' $out/bin/* $out/sbin/*); do 39 64 sed -i "$fn" -e "1 a import sys\nsys.path = ['$out/lib/python2.6/site-packages'] + sys.path" 65 + done 66 + 67 + # Remove calls to `env'. 68 + for fn in $(grep -l '#!.*/env.*python' $out/bin/* $out/sbin/*); do 69 + sed -i "$fn" -e "1 s^/nix/store/.*/env.*python^${python}/bin/python^" 40 70 done 41 71 ''; # */ 42 72