From 543d7a41dcb76406e433fde7f5e26c61ac65cc3c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 7 Mar 2005 13:27:56 +0000 Subject: [PATCH] * Automatically add propagated build inputs to user environments. Maybe this is a bad idea. --- corepkgs/buildenv/builder.pl.in | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/corepkgs/buildenv/builder.pl.in b/corepkgs/buildenv/builder.pl.in index d6dd2f4cf..a1914f658 100755 --- a/corepkgs/buildenv/builder.pl.in +++ b/corepkgs/buildenv/builder.pl.in @@ -25,6 +25,7 @@ sub createLinks { if ($srcFile =~ /\/propagated-build-inputs$/ || $srcFile =~ /\/nix-support$/ || + $srcFile =~ /\/perllocal.pod$/ || $srcFile =~ /\/log$/) { # Do nothing. @@ -72,13 +73,27 @@ sub createLinks { my %done; +sub addPkg; sub addPkg { my $pkgDir = shift; return if (defined $done{$pkgDir}); $done{$pkgDir} = 1; + print "adding $pkgDir\n"; createLinks("$pkgDir", "$out"); + + my $propagatedFN = "$pkgDir/nix-support/propagated-build-inputs"; + if (-e $propagatedFN) { + open PROP, "<$propagatedFN" or die; + my $propagated = ; + close PROP; + my @propagated = split ' ', $propagated; + foreach my $p (@propagated) { + addPkg $p; + } + } + } @@ -86,7 +101,6 @@ my @args = split ' ', $ENV{"derivations"}; while (scalar @args > 0) { my $drvPath = shift @args; - print "adding $drvPath\n"; addPkg($drvPath); }