nix num-cores.patch
pass MAX_PARALLELIZATION and TARGET_LOAD to the builder. See comments svn path=/nixpkgs/branches/stdenv-updates/; revision=22284
This commit is contained in:
parent
3c14e712ca
commit
7db7857d15
31
pkgs/tools/package-management/nix/num-cores.patch
Normal file
31
pkgs/tools/package-management/nix/num-cores.patch
Normal file
@ -0,0 +1,31 @@
|
||||
commit b77e3721f19b4e5084125eb8dc7186117004dd4b
|
||||
Author: Marc Weber <marco-oweber@gmx.de>
|
||||
Date: Sun Jun 13 23:53:46 2010 +0200
|
||||
|
||||
generic/setup.sh: add -j (+1) -l (*2) options to make depending on $NUM_CORES
|
||||
|
||||
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
|
||||
index a9f4d4d..685c0ec 100644
|
||||
--- a/pkgs/stdenv/generic/setup.sh
|
||||
+++ b/pkgs/stdenv/generic/setup.sh
|
||||
@@ -79,9 +79,19 @@ cmd(){
|
||||
}
|
||||
|
||||
runMake(){
|
||||
- cmd make ${makefile:+-f $makefile} "$@"
|
||||
+ local optout=NO_PARALLEL_BUILD_${curPhase}
|
||||
+ [ -n "${!optout}" ] || \
|
||||
+ local j="$makeFlagsParallelBuild"
|
||||
+ cmd make ${makefile:+-f $makefile} "$@" $j
|
||||
}
|
||||
|
||||
+######################################################################
|
||||
+# parallel builds: opt-out
|
||||
+# - in a phase: set NO_PARALLEL_BUILD_${PHASE_NAME}
|
||||
+# - for this build: pass NUM_CORES=1 to the builder
|
||||
+if [ "$NUM_CORES" -gt 1 ]; then
|
||||
+ makeFlagsParallelBuild="-j $(( $NUM_CORES + 1 )) -l $(( 2 * $NUM_CORES ))"
|
||||
+fi
|
||||
|
||||
######################################################################
|
||||
# Initialisation.
|
@ -40,4 +40,6 @@ stdenv.mkDerivation rec {
|
||||
homepage = http://nixos.org/;
|
||||
license = "LGPLv2+";
|
||||
};
|
||||
|
||||
patches = [ ./num-cores.patch ];
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user