diff --git a/.gitignore b/.gitignore index c9e396996..04dd79196 100644 --- a/.gitignore +++ b/.gitignore @@ -37,7 +37,6 @@ Makefile.config /scripts/nix-switch /scripts/nix-collect-garbage /scripts/nix-prefetch-url -/scripts/nix-build /scripts/nix-copy-closure /scripts/NixConfig.pm /scripts/NixManifest.pm @@ -80,6 +79,9 @@ Makefile.config # /src/buildenv/ /src/buildenv/buildenv +# /src/nix-build/ +/src/nix-build/nix-build + # /tests/ /tests/test-tmp /tests/common.sh diff --git a/Makefile b/Makefile index 37a3d99ca..2ee40b56b 100644 --- a/Makefile +++ b/Makefile @@ -15,6 +15,7 @@ makefiles = \ src/buildenv/local.mk \ src/resolve-system-dependencies/local.mk \ src/nix-channel/local.mk \ + src/nix-build/local.mk \ perl/local.mk \ scripts/local.mk \ corepkgs/local.mk \ diff --git a/scripts/local.mk b/scripts/local.mk index b831fdab5..ee8ae6845 100644 --- a/scripts/local.mk +++ b/scripts/local.mk @@ -1,5 +1,4 @@ nix_bin_scripts := \ - $(d)/nix-build \ $(d)/nix-copy-closure \ bin-scripts += $(nix_bin_scripts) @@ -16,6 +15,5 @@ profiledir = $(sysconfdir)/profile.d $(eval $(call install-file-as, $(d)/nix-profile.sh, $(profiledir)/nix.sh, 0644)) $(eval $(call install-program-in, $(d)/build-remote.pl, $(libexecdir)/nix)) -$(eval $(call install-symlink, nix-build, $(bindir)/nix-shell)) clean-files += $(nix_bin_scripts) $(nix_noinst_scripts) diff --git a/scripts/nix-build.in b/scripts/nix-build.in deleted file mode 100755 index 2d45e37c5..000000000 --- a/scripts/nix-build.in +++ /dev/null @@ -1,359 +0,0 @@ -#! @perl@ -w @perlFlags@ - -use utf8; -use strict; -use Nix::Config; -use Nix::Store; -use Nix::Utils; -use File::Basename; -use Text::ParseWords; -use Cwd; - -binmode STDERR, ":encoding(utf8)"; - -my $dryRun = 0; -my $verbose = 0; -my $runEnv = $0 =~ /nix-shell$/; -my $pure = 0; -my $fromArgs = 0; -my $packages = 0; -my $interactive = 1; - -my @instArgs = (); -my @buildArgs = (); -my @exprs = (); - -my $shell = $ENV{SHELL} || "/bin/sh"; -my $envCommand = ""; # interactive shell -my @envExclude = (); - -my $myName = $runEnv ? "nix-shell" : "nix-build"; - -my $inShebang = 0; -my $script; -my @savedArgs; - -my $tmpDir = mkTempDir($myName); - -my $outLink = "./result"; -my $drvLink = "$tmpDir/derivation"; - -# Ensure that the $tmpDir is deleted. -$SIG{'INT'} = sub { exit 1 }; - - -# Heuristic to see if we're invoked as a shebang script, namely, if we -# have a single argument, it's the name of an executable file, and it -# starts with "#!". -if ($runEnv && defined $ARGV[0] && $ARGV[0] !~ /nix-shell/) { - $script = $ARGV[0]; - if (-f $script && -x $script) { - open SCRIPT, "<$script" or die "$0: cannot open ‘$script’: $!\n"; - my $first =