diff --git a/default.nix b/default.nix index 8690325e5..919082981 100644 --- a/default.nix +++ b/default.nix @@ -4,13 +4,13 @@ with import nixpkgs { inherit system; }; let nix = nixUnstable; in -runCommand "nix-repl" - { buildInputs = [ readline nix boehmgc ]; } +runCommandCC "nix-repl" + { buildInputs = [ pkgconfig readline nix boehmgc ]; } '' mkdir -p $out/bin - g++ -O3 -Wall -std=c++0x \ + g++ -O3 -Wall -std=c++14 \ -o $out/bin/nix-repl ${./nix-repl.cc} \ - -I${nix}/include/nix \ + $(pkg-config --cflags nix-main) \ -lnixformat -lnixutil -lnixstore -lnixexpr -lnixmain -lreadline -lgc \ -DNIX_VERSION=\"${(builtins.parseDrvName nix.name).version}\" '' diff --git a/nix-repl.cc b/nix-repl.cc index 0e8c67cf7..0c50f4683 100644 --- a/nix-repl.cc +++ b/nix-repl.cc @@ -1,3 +1,5 @@ +#include + #include #include @@ -291,7 +293,7 @@ static int runProgram(const string & program, const Strings & args) _exit(1); } - return pid.wait(true); + return pid.wait(); }