* Move the substitution functions into stdenv (not merged yet).
* If the environment variable buildCommand is set, then eval that
instead of doing the build phases. This is used by the runCommand
function in all-packages.nix to allow one-lines like
foo = runCommand "foo" {} "mkdir $out; echo foo > $out/foo";
svn path=/nixpkgs/trunk/; revision=7298
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
source $stdenv/setup
|
||||
source $substitute
|
||||
|
||||
args=
|
||||
|
||||
target=$out
|
||||
if test -n "$dir"; then
|
||||
target=$out/$dir/$name
|
||||
ensureDir $out/$dir
|
||||
fi
|
||||
|
||||
# Select all environment variables that start with a lowercase character.
|
||||
for envVar in $(env | sed "s/^[^a-z].*//" | sed "s/^\([^=]*\)=.*/\1/"); do
|
||||
echo "$envVar -> ${!envVar}"
|
||||
args="$args --subst-var $envVar"
|
||||
done
|
||||
|
||||
substitute $src $target $args
|
||||
|
||||
if test -n "$isExecutable"; then
|
||||
chmod +x $target
|
||||
fi
|
||||
+1
-2
@@ -4,7 +4,6 @@ args:
|
||||
|
||||
stdenv.mkDerivation ({
|
||||
name = if args ? name then args.name else baseNameOf (toString args.src);
|
||||
builder = ./generic-substituter.sh;
|
||||
substitute = ./substitute.sh;
|
||||
builder = ./substitute-all.sh;
|
||||
inherit (args) src;
|
||||
} // args)
|
||||
@@ -0,0 +1,15 @@
|
||||
source $stdenv/setup
|
||||
|
||||
args=
|
||||
|
||||
target=$out
|
||||
if test -n "$dir"; then
|
||||
target=$out/$dir/$name
|
||||
ensureDir $out/$dir
|
||||
fi
|
||||
|
||||
substituteAll $src $target
|
||||
|
||||
if test -n "$isExecutable"; then
|
||||
chmod +x $target
|
||||
fi
|
||||
Reference in New Issue
Block a user