diff --git a/pkgs/build-support/buildenv/builder.pl b/pkgs/build-support/buildenv/builder.pl index cdd65cbc523a..71502c9f6683 100755 --- a/pkgs/build-support/buildenv/builder.pl +++ b/pkgs/build-support/buildenv/builder.pl @@ -10,7 +10,6 @@ STDOUT->autoflush(1); my $out = $ENV{"out"}; - my @pathsToLink = split ' ', $ENV{"pathsToLink"}; sub isInPathsToLink { @@ -153,7 +152,3 @@ my $manifest = $ENV{"manifest"}; if ($manifest) { symlink($manifest, "$out/manifest") or die "cannot create manifest"; } - - -system("eval \"\$postBuild\"") == 0 - or die "post-build hook failed"; diff --git a/pkgs/build-support/buildenv/default.nix b/pkgs/build-support/buildenv/default.nix index abe2f37ec660..1bfada4fb627 100644 --- a/pkgs/build-support/buildenv/default.nix +++ b/pkgs/build-support/buildenv/default.nix @@ -2,7 +2,7 @@ # a fork of the buildEnv in the Nix distribution. Most changes should # eventually be merged back into the Nix distribution. -{stdenv, perl}: +{ perl, runCommand }: { name @@ -25,8 +25,9 @@ postBuild ? "" }: -stdenv.mkDerivation { - inherit name manifest paths ignoreCollisions pathsToLink postBuild; - realBuilder = "${perl}/bin/perl"; - args = ["-w" ./builder.pl]; -} +runCommand name + { inherit manifest paths ignoreCollisions pathsToLink postBuild; } + '' + ${perl}/bin/perl -w ${./builder.pl} + eval "$postBuild" + '' diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1021d65ddaa7..df199ae36ea4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -233,9 +233,8 @@ let theAttrSet = arg; }; - buildEnvScript = ../build-support/buildenv/builder.pl; buildEnv = import ../build-support/buildenv { - inherit stdenv perl; + inherit runCommand perl; }; dotnetenv = import ../build-support/dotnetenv {