mirror of
https://github.com/NixOS/nix.git
synced 2024-11-25 08:12:29 +00:00
* Merge r3919, r3925, r3926 from the trunk.
This commit is contained in:
parent
04b51d25d1
commit
92a4a81784
@ -180,6 +180,13 @@ AC_SUBST(NIX_GROUP)
|
|||||||
AC_DEFINE_UNQUOTED(NIX_GROUP, ["$NIX_GROUP"], [Nix group])
|
AC_DEFINE_UNQUOTED(NIX_GROUP, ["$NIX_GROUP"], [Nix group])
|
||||||
|
|
||||||
|
|
||||||
|
# This is needed if either ATerm or Berkeley DB are static libraries,
|
||||||
|
# and the Nix libraries are dynamic.
|
||||||
|
if test "$(uname)" = "Darwin"; then
|
||||||
|
LDFLAGS="-all_load $LDFLAGS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
AM_CONFIG_HEADER([config.h])
|
AM_CONFIG_HEADER([config.h])
|
||||||
AC_CONFIG_FILES([Makefile
|
AC_CONFIG_FILES([Makefile
|
||||||
externals/Makefile
|
externals/Makefile
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#! @perl@ -w -I@libexecdir@/nix
|
#! @perl@ -w -I@libexecdir@/nix
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use IPC::Open2;
|
|
||||||
use POSIX qw(tmpnam);
|
use POSIX qw(tmpnam);
|
||||||
use readmanifest;
|
use readmanifest;
|
||||||
|
|
||||||
@ -74,11 +73,9 @@ print "$size store paths in manifest\n";
|
|||||||
# Register all substitutes.
|
# Register all substitutes.
|
||||||
print STDERR "registering substitutes...\n";
|
print STDERR "registering substitutes...\n";
|
||||||
|
|
||||||
my $pid = open2(\*READ, \*WRITE, "$binDir/nix-store --register-substitutes")
|
my $pid = open(WRITE, "|$binDir/nix-store --register-substitutes")
|
||||||
or die "cannot run nix-store";
|
or die "cannot run nix-store";
|
||||||
|
|
||||||
close READ;
|
|
||||||
|
|
||||||
foreach my $storePath (keys %narFiles) {
|
foreach my $storePath (keys %narFiles) {
|
||||||
my $narFileList = $narFiles{$storePath};
|
my $narFileList = $narFiles{$storePath};
|
||||||
foreach my $narFile (@{$narFileList}) {
|
foreach my $narFile (@{$narFileList}) {
|
||||||
@ -95,7 +92,4 @@ foreach my $storePath (keys %narFiles) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
close WRITE;
|
close WRITE or die "nix-store failed: $?";
|
||||||
|
|
||||||
waitpid $pid, 0;
|
|
||||||
$? == 0 or die "nix-store failed";
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#! @perl@ -w -I@libexecdir@/nix
|
#! @perl@ -w -I@libexecdir@/nix
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
use IPC::Open2;
|
|
||||||
use POSIX qw(tmpnam);
|
use POSIX qw(tmpnam);
|
||||||
use readmanifest;
|
use readmanifest;
|
||||||
|
|
||||||
@ -62,20 +61,17 @@ foreach my $path (@ARGV) {
|
|||||||
|
|
||||||
# Get all paths referenced by the normalisation of the given
|
# Get all paths referenced by the normalisation of the given
|
||||||
# Nix expression.
|
# Nix expression.
|
||||||
my $pid = open2(\*READ, \*WRITE,
|
my $pid = open(READ,
|
||||||
"$binDir/nix-store --query --requisites --force-realise " .
|
"$binDir/nix-store --query --requisites --force-realise " .
|
||||||
"--include-outputs '$path'") or die;
|
"--include-outputs '$path'|") or die;
|
||||||
close WRITE;
|
|
||||||
|
|
||||||
while (<READ>) {
|
while (<READ>) {
|
||||||
chomp;
|
chomp;
|
||||||
die "bad: $_" unless /^\//;
|
die "bad: $_" unless /^\//;
|
||||||
$storePaths{$_} = "";
|
$storePaths{$_} = "";
|
||||||
}
|
}
|
||||||
close READ;
|
|
||||||
|
close READ or die "nix-store failed: $?";
|
||||||
waitpid $pid, 0;
|
|
||||||
$? == 0 or die "nix-store failed";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
my @storePaths = keys %storePaths;
|
my @storePaths = keys %storePaths;
|
||||||
@ -104,18 +100,14 @@ close NIX;
|
|||||||
# Instantiate store expressions from the Nix expression.
|
# Instantiate store expressions from the Nix expression.
|
||||||
my @storeExprs;
|
my @storeExprs;
|
||||||
print STDERR "instantiating store expressions...\n";
|
print STDERR "instantiating store expressions...\n";
|
||||||
my $pid = open2(\*READ, \*WRITE, "$binDir/nix-instantiate $nixfile")
|
my $pid = open(READ, "$binDir/nix-instantiate $nixfile|")
|
||||||
or die "cannot run nix-instantiate";
|
or die "cannot run nix-instantiate";
|
||||||
close WRITE;
|
|
||||||
while (<READ>) {
|
while (<READ>) {
|
||||||
chomp;
|
chomp;
|
||||||
die unless /^\//;
|
die unless /^\//;
|
||||||
push @storeExprs, $_;
|
push @storeExprs, $_;
|
||||||
}
|
}
|
||||||
close READ;
|
close READ or die "nix-instantiate failed: $?";
|
||||||
|
|
||||||
waitpid $pid, 0;
|
|
||||||
$? == 0 or die "nix-instantiate failed";
|
|
||||||
|
|
||||||
|
|
||||||
# Realise the store expressions.
|
# Realise the store expressions.
|
||||||
@ -130,18 +122,14 @@ while (scalar @tmp > 0) {
|
|||||||
my @tmp2 = @tmp[0..$n - 1];
|
my @tmp2 = @tmp[0..$n - 1];
|
||||||
@tmp = @tmp[$n..scalar @tmp - 1];
|
@tmp = @tmp[$n..scalar @tmp - 1];
|
||||||
|
|
||||||
my $pid = open2(\*READ, \*WRITE, "$binDir/nix-store --realise @tmp2")
|
my $pid = open(READ, "$binDir/nix-store --realise @tmp2|")
|
||||||
or die "cannot run nix-store";
|
or die "cannot run nix-store";
|
||||||
close WRITE;
|
|
||||||
while (<READ>) {
|
while (<READ>) {
|
||||||
chomp;
|
chomp;
|
||||||
die unless (/^\//);
|
die unless (/^\//);
|
||||||
push @narPaths, "$_";
|
push @narPaths, "$_";
|
||||||
}
|
}
|
||||||
close READ;
|
close READ or die "nix-store failed: $?";
|
||||||
|
|
||||||
waitpid $pid, 0;
|
|
||||||
$? == 0 or die "nix-store failed";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user