summary refs log tree commit diff
path: root/pkgs/stdenv/generic
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2006-12-27 17:47:09 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2006-12-27 17:47:09 +0000
commit8ab9a58e0d3ea85491ebf012cfda962d59f1b99b (patch)
treeeedca9f9fa60c13e6a61027428abac0106ea96e6 /pkgs/stdenv/generic
parent1d9dcbba2268d9fc482746a5329b24ed9e7a59de (diff)
downloadnixlib-8ab9a58e0d3ea85491ebf012cfda962d59f1b99b.tar
nixlib-8ab9a58e0d3ea85491ebf012cfda962d59f1b99b.tar.gz
nixlib-8ab9a58e0d3ea85491ebf012cfda962d59f1b99b.tar.bz2
nixlib-8ab9a58e0d3ea85491ebf012cfda962d59f1b99b.tar.lz
nixlib-8ab9a58e0d3ea85491ebf012cfda962d59f1b99b.tar.xz
nixlib-8ab9a58e0d3ea85491ebf012cfda962d59f1b99b.tar.zst
nixlib-8ab9a58e0d3ea85491ebf012cfda962d59f1b99b.zip
* Split the installPhase into installPhase and fixupPhase. The
  fixupPhase strips binaries, runs patchelf, etc.  This is so that
  those things still happen when somebody overrides installPhase.

svn path=/nixpkgs/trunk/; revision=7494
Diffstat (limited to 'pkgs/stdenv/generic')
-rw-r--r--pkgs/stdenv/generic/setup-new2.sh41
1 files changed, 34 insertions, 7 deletions
diff --git a/pkgs/stdenv/generic/setup-new2.sh b/pkgs/stdenv/generic/setup-new2.sh
index 3110637d2628..e39a0772a32c 100644
--- a/pkgs/stdenv/generic/setup-new2.sh
+++ b/pkgs/stdenv/generic/setup-new2.sh
@@ -655,6 +655,33 @@ installW() {
         eval "$installCommand"
     fi
 
+    eval "$postInstall"
+}
+
+
+installPhase() {
+    if test "$dontInstall" = 1; then
+        return
+    fi
+    header "installing"
+    startLog "install"
+    installW
+    stopLog
+    stopNest
+}
+
+
+# The fixup phase performs generic, package-independent, Nix-related
+# stuff, like running patchelf and setting the
+# propagated-build-inputs.  It should rarely be overriden.
+fixupW() {
+    if test -n "$fixupPhase"; then
+        eval "$fixupPhase"
+        return
+    fi
+
+    eval "$preFixup"
+
     if test -z "$dontStrip" -a "$NIX_STRIP_DEBUG" = 1; then
         find "$prefix" -name "*.a" -exec echo stripping {} \; \
             -exec strip -S {} \; || fail
@@ -669,17 +696,17 @@ installW() {
         echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs"
     fi
 
-    eval "$postInstall"
+    eval "$postFixup"
 }
 
 
-installPhase() {
-    if test "$dontInstall" = 1; then
+fixupPhase() {
+    if test "$dontFixup" = 1; then
         return
     fi
-    header "installing"
-    startLog "install"
-    installW
+    header "post-installation fixup"
+    startLog "fixup"
+    fixupW
     stopLog
     stopNest
 }
@@ -741,7 +768,7 @@ genericBuild() {
 
     if test -z "$phases"; then
         phases="patchPhase configurePhase buildPhase checkPhase \
-            installPhase distPhase";
+            installPhase fixupPhase distPhase";
     fi
 
     for i in $phases; do