about summary refs log tree commit diff
path: root/tests/config.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2016-08-17T13·12+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2016-08-17T15·19+0200
commit22d6e31fc6a9de2ee424984e629ccd2e394ba512 (patch)
tree0c8ea6b2799583edf3597f7723883ba4c1655c7e /tests/config.nix
parentac841a46797a91eaddb3e0ad193c505fc49da597 (diff)
Add a mechanism for derivation attributes to reference the derivation's outputs
For example, you can now say:

  configureFlags = "--prefix=${placeholder "out"} --includedir=${placeholder "dev"}";

The strings returned by the ‘placeholder’ builtin are replaced at
build time by the actual store paths corresponding to the specified
outputs.

Previously, you had to work around the inability to self-reference by doing stuff like:

  preConfigure = ''
    configureFlags+=" --prefix $out --includedir=$dev"
  '';

or rely on ad-hoc variable interpolation semantics in Autoconf or Make
(e.g. --prefix=\$(out)), which doesn't always work.
Diffstat (limited to 'tests/config.nix')
-rw-r--r--tests/config.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/config.nix b/tests/config.nix
index 6244a15fa48a..76388fdd5b95 100644
--- a/tests/config.nix
+++ b/tests/config.nix
@@ -13,7 +13,7 @@ rec {
     derivation ({
       inherit system;
       builder = shell;
-      args = ["-e" args.builder];
+      args = ["-e" args.builder or (builtins.toFile "builder.sh" "eval \"$buildCommand\"")];
       PATH = path;
     } // removeAttrs args ["builder" "meta"])
     // { meta = args.meta or {}; };