1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-20 11:11:03 -04:00

Fix building against Nix 1.7

This commit is contained in:
Eelco Dolstra 2014-04-11 12:50:46 +02:00
parent 6a4a8208be
commit 22a47ab03c
2 changed files with 6 additions and 5 deletions

View file

@ -3,11 +3,12 @@
with import nixpkgs { inherit system; }; with import nixpkgs { inherit system; };
runCommand "nix-repl" runCommand "nix-repl"
{ buildInputs = [ readline nixUnstable boehmgc ]; } { buildInputs = [ readline nix boehmgc ]; }
'' ''
mkdir -p $out/bin mkdir -p $out/bin
g++ -O3 -Wall -std=c++0x \ g++ -O3 -Wall -std=c++0x \
-o $out/bin/nix-repl ${./nix-repl.cc} \ -o $out/bin/nix-repl ${./nix-repl.cc} \
-I${nixUnstable}/include/nix -L${nixUnstable}/lib/nix \ -I${nix}/include/nix \
-lformat -lutil -lstore -lexpr -lmain -lreadline -lgc -lnixformat -lnixutil -lnixstore -lnixexpr -lnixmain -lreadline -lgc \
-DNIX_VERSION=${(builtins.parseDrvName nix.name).version}
'' ''

View file

@ -323,7 +323,7 @@ bool NixRepl::processLine(string line)
but doing it in a child makes it easier to recover from but doing it in a child makes it easier to recover from
problems / SIGINT. */ problems / SIGINT. */
if (runProgram("nix-store", Strings{"-r", drvPath}) == 0) { if (runProgram("nix-store", Strings{"-r", drvPath}) == 0) {
Derivation drv = parseDerivation(readFile(drvPath)); Derivation drv = readDerivation(drvPath);
std::cout << std::endl << "this derivation produced the following outputs:" << std::endl; std::cout << std::endl << "this derivation produced the following outputs:" << std::endl;
foreach (DerivationOutputs::iterator, i, drv.outputs) foreach (DerivationOutputs::iterator, i, drv.outputs)
std::cout << format(" %1% -> %2%") % i->first % i->second.path << std::endl; std::cout << format(" %1% -> %2%") % i->first % i->second.path << std::endl;
@ -494,7 +494,7 @@ std::ostream & NixRepl::printValue(std::ostream & str, Value & v, unsigned int m
str << "«derivation "; str << "«derivation ";
Bindings::iterator i = v.attrs->find(state.sDrvPath); Bindings::iterator i = v.attrs->find(state.sDrvPath);
PathSet context; PathSet context;
Path drvPath = i != v.attrs->end() ? state.coerceToPath(*i->value, context) : "???"; Path drvPath = i != v.attrs->end() ? state.coerceToPath(*i->pos, *i->value, context) : "???";
str << drvPath << "»"; str << drvPath << "»";
} }