* Export the input attributes.
svn path=/nixpkgs/trunk/; revision=4533
This commit is contained in:
parent
05f665116a
commit
94517a614e
File diff suppressed because it is too large
Load Diff
@ -75,7 +75,7 @@ while (<>) {
|
|||||||
print "\nunpacking $path\n";
|
print "\nunpacking $path\n";
|
||||||
system "rm -rf '$tmpDir'";
|
system "rm -rf '$tmpDir'";
|
||||||
mkdir $tmpDir, 0700;
|
mkdir $tmpDir, 0700;
|
||||||
system "cd '$tmpDir' && tar xvfj '$path'";
|
system "cd '$tmpDir' && tar xf '$path'";
|
||||||
die "cannot unpack `$path'" if $? != 0;
|
die "cannot unpack `$path'" if $? != 0;
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
@ -89,31 +89,24 @@ while (<>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my @requires = ();
|
my @requires = ();
|
||||||
my %requires = ();
|
|
||||||
open FOO, "cd '$tmpDir'/* && cat configure.ac |";
|
open FOO, "cd '$tmpDir'/* && cat configure.ac |";
|
||||||
while (<FOO>) {
|
while (<FOO>) {
|
||||||
if (/XAW_CHECK_XPRINT_SUPPORT/) {
|
if (/XAW_CHECK_XPRINT_SUPPORT/) {
|
||||||
if (!defined $requires{"libXaw"}) {
|
|
||||||
push @requires, "libXaw";
|
push @requires, "libXaw";
|
||||||
$requires{"libXaw"} = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (/PKG_CHECK_MODULES\([^,]*,\s*\[?([^\),\]]*)/ ||
|
if (/PKG_CHECK_MODULES\([^,]*,\s*\[?([^\),\]]*)/ ||
|
||||||
/MODULES=\"(.*)\"/ ||
|
/MODULES=\"(.*)\"/ ||
|
||||||
/REQUIRED_LIBS=\"(.*)\"/ ||
|
/REQUIRED_LIBS=\"(.*)\"/ ||
|
||||||
/REQUIRES=\"(.*)\"/)
|
/REQUIRES=\"(.*)\"/)
|
||||||
{
|
{
|
||||||
print "MATCH: $_\n";
|
|
||||||
foreach my $req (split / /, $1) {
|
foreach my $req (split / /, $1) {
|
||||||
next if $req eq ">=";
|
next if $req eq ">=";
|
||||||
next if $req =~ /^\$/;
|
next if $req =~ /^\$/;
|
||||||
next if $req =~ /^[0-9]/;
|
next if $req =~ /^[0-9]/;
|
||||||
$req =~ s/\[//g;
|
$req =~ s/\[//g;
|
||||||
$req =~ s/\]//g;
|
$req =~ s/\]//g;
|
||||||
if (!defined $requires{$req}) {
|
print "REQUIRE: $req\n";
|
||||||
push @requires, $req;
|
push @requires, $req;
|
||||||
$requires{$req} = 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -143,10 +136,14 @@ EOF
|
|||||||
foreach my $pkg (sort (keys %pkgURLs)) {
|
foreach my $pkg (sort (keys %pkgURLs)) {
|
||||||
print "$pkg\n";
|
print "$pkg\n";
|
||||||
|
|
||||||
|
my %requires = ();
|
||||||
my $inputs = "";
|
my $inputs = "";
|
||||||
foreach my $req (@{$pkgRequires{$pkg}}) {
|
foreach my $req (sort @{$pkgRequires{$pkg}}) {
|
||||||
if (defined $pcMap{$req}) {
|
if (defined $pcMap{$req}) {
|
||||||
|
if (!defined $requires{$pcMap{$req}}) {
|
||||||
$inputs .= "$pcMap{$req} ";
|
$inputs .= "$pcMap{$req} ";
|
||||||
|
$requires{$pcMap{$req}} = 1;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
print " NOT FOUND: $req\n";
|
print " NOT FOUND: $req\n";
|
||||||
}
|
}
|
||||||
@ -156,7 +153,7 @@ foreach my $pkg (sort (keys %pkgURLs)) {
|
|||||||
$extraAttrs = "" unless defined $extraAttrs;
|
$extraAttrs = "" unless defined $extraAttrs;
|
||||||
|
|
||||||
print OUT <<EOF
|
print OUT <<EOF
|
||||||
$pkg = stdenv.mkDerivation {
|
$pkg = (stdenv.mkDerivation {
|
||||||
name = "$pkgNames{$pkg}";
|
name = "$pkgNames{$pkg}";
|
||||||
builder = ./builder.sh;
|
builder = ./builder.sh;
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
@ -164,7 +161,7 @@ foreach my $pkg (sort (keys %pkgURLs)) {
|
|||||||
md5 = "$pkgHashes{$pkg}";
|
md5 = "$pkgHashes{$pkg}";
|
||||||
};
|
};
|
||||||
buildInputs = [pkgconfig $inputs];$extraAttrs
|
buildInputs = [pkgconfig $inputs];$extraAttrs
|
||||||
};
|
}) // {inherit $inputs;};
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user