From a9f676e09832e2f96bfe814ba74df591e1438310 Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Sat, 18 Aug 2007 18:42:18 +0000 Subject: [PATCH] unpackSource is to be included in phases .. So you can set phases after calling unpackSource manually cd $rootSource is called at end of unpackPhase svn path=/nixpkgs/trunk/; revision=9161 --- pkgs/stdenv/generic/setup-new-2.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/pkgs/stdenv/generic/setup-new-2.sh b/pkgs/stdenv/generic/setup-new-2.sh index 90bf997eb9f..de635aee95b 100644 --- a/pkgs/stdenv/generic/setup-new-2.sh +++ b/pkgs/stdenv/generic/setup-new-2.sh @@ -489,11 +489,13 @@ unpackW() { unpackPhase() { + sourceRoot=. # don't change to user dir homeless shelter if custom unpackSource does'nt set sourceRoot header "unpacking sources" startLog "unpack" unpackW stopLog stopNest + cd $sourceRoot } @@ -523,6 +525,23 @@ patchW() { done } +purifyPhase() { + # copied and modified from acroread and ghcboot + # to be called in postUnpack + + fullPath= + for i in \$buildInputs; do + fullPath=\$fullPath\${fullPath:+:}\$i/lib + done + + dirs=${dirsToPurify:-.} + for dir in $dirs; do + find $dir -type f -perm +100 \\ + -exec patchelf --interpreter \"\$(cat \$NIX_GCC/nix-support/dynamic-linker)\" \\ + --set-rpath \$fullPath {}; + done +} + patchPhase() { if test -z "$patchPhase" -a -z "$patches"; then return; fi @@ -834,9 +853,6 @@ genericBuild() { return fi - unpackPhase - cd $sourceRoot - if test -z "$phases"; then phases="patchPhase configurePhase buildPhase checkPhase \ installPhase fixupPhase distPhase";