diff options
author | Robin Gloster <mail@glob.in> | 2018-11-04 22:16:49 +0100 |
---|---|---|
committer | Robin Gloster <mail@glob.in> | 2018-11-28 14:28:32 +0100 |
commit | 2d0fad757ab26d943c1f0f4edf078c6cd8670861 (patch) | |
tree | 89e74fcbe401298bffad0e47630b77661f56b855 /pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl | |
parent | 602efddc24de418c96f03e3d5af4f39a1845da3a (diff) |
xorg: generate python into nativeBuildInputs
Diffstat (limited to 'pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl')
-rwxr-xr-x | pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl index 701a8984ada1..aba45a215349 100755 --- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl +++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl @@ -23,6 +23,7 @@ my %pkgURLs; my %pkgHashes; my %pkgNames; my %pkgRequires; +my %pkgNativeRequires; my %pcMap; @@ -106,6 +107,7 @@ while (<>) { my $provides = `find $pkgDir -name "*.pc.in"`; my @provides2 = split '\n', $provides; my @requires = (); + my @nativeRequires = (); foreach my $pcFile (@provides2) { my $pc = $pcFile; @@ -163,7 +165,7 @@ while (<>) { } if ($file =~ /AM_PATH_PYTHON/) { - push @requires, "python"; + push @nativeRequires, "python"; } if ($file =~ /AC_PATH_PROG\(FCCACHE/) { @@ -230,7 +232,9 @@ while (<>) { push @requires, "gperf", "m4", "xproto" if $pkg =~ /xcbutil/; print "REQUIRES $pkg => @requires\n"; + print "NATIVE_REQUIRES $pkg => @nativeRequires\n"; $pkgRequires{$pkg} = \@requires; + $pkgNativeRequires{$pkg} = \@nativeRequires; print "done\n"; } @@ -255,6 +259,20 @@ EOF foreach my $pkg (sort (keys %pkgURLs)) { print "$pkg\n"; + my %nativeRequires = (); + my @nativeBuildInputs; + foreach my $req (sort @{$pkgNativeRequires{$pkg}}) { + if (defined $pcMap{$req}) { + # Some packages have .pc that depends on itself. + next if $pcMap{$req} eq $pkg; + if (!defined $nativeRequires{$pcMap{$req}}) { + push @nativeBuildInputs, $pcMap{$req}; + $nativeRequires{$pcMap{$req}} = 1; + } + } else { + print " NOT FOUND: $req\n"; + } + } my %requires = (); my @buildInputs; foreach my $req (sort @{$pkgRequires{$pkg}}) { @@ -270,9 +288,11 @@ foreach my $pkg (sort (keys %pkgURLs)) { } } + my $nativeBuildInputsStr = join "", map { $_ . " " } @nativeBuildInputs; my $buildInputsStr = join "", map { $_ . " " } @buildInputs; my @arguments = @buildInputs; + push @arguments, @nativeBuildInputs; unshift @arguments, "stdenv", "pkgconfig", "fetchurl"; my $argumentsStr = join ", ", @arguments; @@ -290,7 +310,7 @@ foreach my $pkg (sort (keys %pkgURLs)) { sha256 = "$pkgHashes{$pkg}"; }; hardeningDisable = [ "bindnow" "relro" ]; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ pkgconfig $nativeBuildInputsStr]; buildInputs = [ $buildInputsStr];$extraAttrsStr meta.platforms = stdenv.lib.platforms.unix; }) {}; |