summary refs log tree commit diff
path: root/pkgs/build-support/substitute
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2006-12-10 22:24:42 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2006-12-10 22:24:42 +0000
commit7dfbf0eba7a0e98c16777e40ee0dcb034075a4ef (patch)
treeff14a4035f3e4b0760f21487e9a6a077c41ee32a /pkgs/build-support/substitute
parentcca1ba037283a1f3b4196db19dbd6bae5f500bb4 (diff)
downloadnixpkgs-7dfbf0eba7a0e98c16777e40ee0dcb034075a4ef.tar
nixpkgs-7dfbf0eba7a0e98c16777e40ee0dcb034075a4ef.tar.gz
nixpkgs-7dfbf0eba7a0e98c16777e40ee0dcb034075a4ef.tar.bz2
nixpkgs-7dfbf0eba7a0e98c16777e40ee0dcb034075a4ef.tar.lz
nixpkgs-7dfbf0eba7a0e98c16777e40ee0dcb034075a4ef.tar.xz
nixpkgs-7dfbf0eba7a0e98c16777e40ee0dcb034075a4ef.tar.zst
nixpkgs-7dfbf0eba7a0e98c16777e40ee0dcb034075a4ef.zip
* 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
Diffstat (limited to 'pkgs/build-support/substitute')
-rw-r--r--pkgs/build-support/substitute/generic-substituter.sh22
-rw-r--r--pkgs/build-support/substitute/substitute-all.nix (renamed from pkgs/build-support/substitute/generic-substituter.nix)3
-rw-r--r--pkgs/build-support/substitute/substitute-all.sh15
3 files changed, 16 insertions, 24 deletions
diff --git a/pkgs/build-support/substitute/generic-substituter.sh b/pkgs/build-support/substitute/generic-substituter.sh
deleted file mode 100644
index 51db11bfa79..00000000000
--- a/pkgs/build-support/substitute/generic-substituter.sh
+++ /dev/null
@@ -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
diff --git a/pkgs/build-support/substitute/generic-substituter.nix b/pkgs/build-support/substitute/substitute-all.nix
index acc349ac816..6c0f970a392 100644
--- a/pkgs/build-support/substitute/generic-substituter.nix
+++ b/pkgs/build-support/substitute/substitute-all.nix
@@ -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)
diff --git a/pkgs/build-support/substitute/substitute-all.sh b/pkgs/build-support/substitute/substitute-all.sh
new file mode 100644
index 00000000000..3d3999ad520
--- /dev/null
+++ b/pkgs/build-support/substitute/substitute-all.sh
@@ -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