Author: ludo
Date: Fri Sep 10 12:39:57 2010
New Revision: 23717
URL: https://svn.nixos.org/websvn/nix/?rev=23717&sc=1

Log:
nixBuild: Add `buildOutOfSourceTree' option.

Modified:
   nixpkgs/trunk/pkgs/build-support/release/nix-build.nix

Modified: nixpkgs/trunk/pkgs/build-support/release/nix-build.nix
==============================================================================
--- nixpkgs/trunk/pkgs/build-support/release/nix-build.nix      Fri Sep 10 
12:25:59 2010        (r23716)
+++ nixpkgs/trunk/pkgs/build-support/release/nix-build.nix      Fri Sep 10 
12:39:57 2010        (r23717)
@@ -5,7 +5,9 @@
 # it turns on GCC's coverage analysis feature.  It then runs `make
 # check' and produces a coverage analysis report using `lcov'.
 
-{ doCoverageAnalysis ? false
+{ buildOutOfSourceTree ? false
+, preConfigure ? null
+, doCoverageAnalysis ? false
 , lcovFilter ? []
 , lcovExtraTraceFiles ? []
 , src, stdenv
@@ -94,4 +96,24 @@
     };
 
   }
+
+  //
+
+  (if buildOutOfSourceTree
+   then {
+     preConfigure =
+       # Build out of source tree and make the source tree read-only.  This
+       # helps catch violations of the GNU Coding Standards (info
+       # "(standards) Configuration"), like `make distcheck' does.
+       '' mkdir "../build"
+          cd "../build"
+          configureScript="../$sourceRoot/configure"
+          chmod -R a-w "../$sourceRoot"
+
+          echo "building out of source tree, from \`$PWD'..."
+
+          ${if preConfigure != null then preConfigure else ""}
+       '';
+   }
+   else {})
 )
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to