summary refs log tree commit diff
path: root/pkgs/top-level
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/top-level')
-rw-r--r--pkgs/top-level/builder-defs.nix30
-rw-r--r--pkgs/top-level/template-composing+config.nix5
-rw-r--r--pkgs/top-level/template-composing-builder.nix8
3 files changed, 23 insertions, 20 deletions
diff --git a/pkgs/top-level/builder-defs.nix b/pkgs/top-level/builder-defs.nix
index aa53c9ba157..a2b132ee365 100644
--- a/pkgs/top-level/builder-defs.nix
+++ b/pkgs/top-level/builder-defs.nix
@@ -40,7 +40,7 @@ args: with args; with stringsWithDeps; with lib;
 		{
 			addToSearchPathWithCustomDelimiter \"\${PATH_DELIMITER}\" \"\$@\"
 		}
-	") [defNest];
+	") ["defNest"];
 
 	defNest = noDepEntry ("
 		nestingLevel=0
@@ -95,7 +95,7 @@ args: with args; with stringsWithDeps; with lib;
 		prefix=${if args ? prefix then (toString args.prefix) else "\$out"}
 
 		"
-	else "")) [defNest defAddToSearchPath];
+	else "")) ["defNest" "defAddToSearchPath"];
 		
 	addInputs = FullDepEntry ("
 		# Recursively find all build inputs.
@@ -161,7 +161,7 @@ args: with args; with stringsWithDeps; with lib;
 		fi
 
 		PATH=\$_PATH\${_PATH:+:}\$PATH
-	") [minInit];
+	") ["minInit"];
 	
 	defEnsureDir = FullDepEntry ("
 		# Ensure that the given directories exists.
@@ -171,7 +171,7 @@ args: with args; with stringsWithDeps; with lib;
 			if ! test -x \"\$dir\"; then mkdir -p \"\$dir\"; fi
 		    done
 		}
-	") [minInit];
+	") ["minInit"];
 
 	toSrcDir = s : FullDepEntry ((if (archiveType s) == "tar" then "
 		tar xvf '${s}'
@@ -200,11 +200,11 @@ args: with args; with stringsWithDeps; with lib;
 		cd \$(basename ${s} .bz2)
 	" else (abort "unknown archive type : ${s}"))+
 		(if args ? goSrcDir then args.goSrcDir else "")
-	) [minInit];
+	) ["minInit"];
 
 	doConfigure = FullDepEntry ("
 		./configure --prefix=\"\$prefix\" ${toString configureFlags}
-	") [minInit addInputs doUnpack];
+	") ["minInit" "addInputs" "doUnpack"];
 
 	doAutotools = FullDepEntry ("
 		mkdir -p config
@@ -214,21 +214,21 @@ args: with args; with stringsWithDeps; with lib;
 		autoheader || true; 
 		automake --add-missing --copy
 		autoconf
-	")[minInit addInputs doUnpack];
+	")["minInit" "addInputs" "doUnpack"];
 
 	doMake = FullDepEntry ("	
 		make ${toString makeFlags}
-	") [minInit addInputs doUnpack];
+	") ["minInit" "addInputs" "doUnpack"];
 
 	doUnpack = toSrcDir (toString src);
 
 	installPythonPackage = FullDepEntry ("
 		python setup.py install --prefix=\"\$prefix\" 
-		") [minInit addInputs doUnpack];
+		") ["minInit" "addInputs" "doUnpack"];
 
 	doMakeInstall = FullDepEntry ("
 		make ${toString (getAttr ["makeFlags"] "" args)} "+
-			"${toString (getAttr ["installFlags"] "" args)} install") [doMake];
+			"${toString (getAttr ["installFlags"] "" args)} install") ["doMake"];
 
 	doForceShare = FullDepEntry (" 
 		ensureDir \"\$prefix/share\"
@@ -238,7 +238,7 @@ args: with args; with stringsWithDeps; with lib;
 				ln -sv share/\$d \"\$prefix\"
 			fi;
 		done;
-	") [minInit defEnsureDir];
+	") ["minInit" "defEnsureDir"];
 
 	doDump = n: noDepEntry "echo Dump number ${n}; set";
 
@@ -250,7 +250,7 @@ args: with args; with stringsWithDeps; with lib;
 
 	doPatch = FullDepEntry (concatStringsSep ";"
 		(map toPatchCommand patches)
-	) [minInit doUnpack];
+	) ["minInit" "doUnpack"];
 
 	envAdderInner = s: x: if x==null then s else y: 
 		a: envAdderInner (s+"echo export ${x}='\"'\"\$${x}:${y}\";'\"'\n") a;
@@ -268,12 +268,12 @@ args: with args; with stringsWithDeps; with lib;
 		(${envAdderList env}
 		echo '\"'\"${cmd}-orig\"'\"' '\"'\\\$@'\"' \n)  > \"${cmd}\"";
 
-	doWrap = cmd: FullDepEntry (wrapEnv cmd (getAttr ["wrappedEnv"] [] args)) [minInit];
+	doWrap = cmd: FullDepEntry (wrapEnv cmd (getAttr ["wrappedEnv"] [] args)) ["minInit"];
 
 	doPropagate = FullDepEntry ("
 		ensureDir \$out/nix-support
 		echo '${toString (getAttr ["propagatedBuildInputs"] [] args)}' >\$out/nix-support/propagated-build-inputs
-	") [minInit defEnsureDir];
+	") ["minInit" "defEnsureDir"];
 
 	/*debug = x:(__trace x x);
 	debugX = x:(__trace (__toXML x) x);*/
@@ -283,7 +283,7 @@ args: with args; with stringsWithDeps; with lib;
 	replaceScripts = l:(concatStringsSep "\n" (pairMap replaceInScript l));
 	doReplaceScripts = FullDepEntry (replaceScripts (getAttr ["shellReplacements"] [] args)) [minInit];
 	makeNest = x:(if x==defNest.text then x else "startNest\n" + x + "\nstopNest\n");
-	textClosure = textClosureMap makeNest;
+	textClosure = textClosureMapOveridable makeNest;
 
 	inherit noDepEntry FullDepEntry PackEntry;
 
diff --git a/pkgs/top-level/template-composing+config.nix b/pkgs/top-level/template-composing+config.nix
index df751f693f2..7ff4f3f9d50 100644
--- a/pkgs/top-level/template-composing+config.nix
+++ b/pkgs/top-level/template-composing+config.nix
@@ -1,4 +1,4 @@
-args : with args; with builderDefs (args // {
+args : with args; let localDefs = builderDefs (args // {
 		src = /* put a fetchurl here */
 		(abort "Specify source");
 		useConfig = true;
@@ -10,10 +10,11 @@ args : with args; with builderDefs (args // {
 		configFlags = [
 		];
 	}) null; /* null is a terminator for sumArgs */
+	in with localDefs;
 stdenv.mkDerivation rec {
 	name = "${(abort "Specify name")}"+version;
 	builder = writeScript (name + "-builder")
-		(textClosure [(abort "Check phases") doMakeInstall doForceShare doPropagate]);
+		(textClosure localDefs [(abort "Check phases") doMakeInstall doForceShare doPropagate]);
 	meta = {
 		description = "
 	${(abort "Specify description")}
diff --git a/pkgs/top-level/template-composing-builder.nix b/pkgs/top-level/template-composing-builder.nix
index 8117b156879..1175d599233 100644
--- a/pkgs/top-level/template-composing-builder.nix
+++ b/pkgs/top-level/template-composing-builder.nix
@@ -1,14 +1,16 @@
 args : with args;
-	with builderDefs {
+	let localDefs = builderDefs {
 		src = /* put a fetchurl here */
 
 		buildInputs = [];
 		configureFlags = [];
 	} null; /* null is a terminator for sumArgs */
+	in with localDefs;
 stdenv.mkDerivation rec {
-	name = "${abort "Specify name"}";
+	name = "${abort "Specify name"}-"+version;
 	builder = writeScript (name + "-builder")
-		(textClosure [(abort "Specify phases - defined here or in builderDefs") doForceShare doPropagate]);
+		(textClosure localDefs 
+			[(abort "Specify phases - defined here or in builderDefs") doForceShare doPropagate]);
 	meta = {
 		description = "
 		${abort "Write a description"}