From 80ebc553eca19dafc64c47420cd49ddd506bc9b7 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 9 Aug 2016 06:24:19 -0400 Subject: nix-build: Port to c++ This was a dumb line-for-line rewrite, because nix build/nix run/etc. will replace it. --- scripts/local.mk | 2 - scripts/nix-build.in | 359 --------------------------------------------------- 2 files changed, 361 deletions(-) delete mode 100755 scripts/nix-build.in (limited to 'scripts') diff --git a/scripts/local.mk b/scripts/local.mk index edaf44cc492d..142188ad5f47 100644 --- a/scripts/local.mk +++ b/scripts/local.mk @@ -1,5 +1,4 @@ nix_bin_scripts := \ - $(d)/nix-build \ $(d)/nix-channel \ $(d)/nix-copy-closure \ $(d)/nix-install-package \ @@ -26,6 +25,5 @@ $(eval $(call install-program-in, $(d)/build-remote.pl, $(libexecdir)/nix)) ifeq ($(OS), Darwin) $(eval $(call install-program-in, $(d)/resolve-system-dependencies.pl, $(libexecdir)/nix)) endif -$(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 2d45e37c52d6..000000000000 --- 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 =