Commit 9cb51cf2 authored by John Ericson's avatar John Ericson
Browse files

xorg: Add `meta.pkgConfigModules` and test

parent c00c5163
Loading
Loading
Loading
Loading
+1547 −663

File changed.

Preview size limit exceeded, changes collapsed.

+14 −3
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ my %pkgVersions;
my %pkgRequires;
my %pkgNativeRequires;

my %pcProvides;
my %pcMap;

my %extraAttrs;
@@ -112,6 +113,7 @@ while (<>) {
        my $pc = $pcFile;
        $pc =~ s/.*\///;
        $pc =~ s/.pc.in//;
        push @{$pcProvides{$pkg}}, $pc;
        print "PROVIDES $pc\n";
        die "collision with $pcMap{$pc}" if defined $pcMap{$pc};
        $pcMap{$pc} = $pkg;
@@ -328,9 +330,14 @@ foreach my $pkg (sort (keys %pkgURLs)) {
      $extraAttrsStr = join "", map { "\n    " . $_ } @{$extraAttrs{$pkg}};
    }

    my $pcProvidesStr = "";
    if (defined $pcProvides{$pkg}) {
      $pcProvidesStr = join "", map { "\"" . $_ . "\" " } @{$pcProvides{$pkg}};
    }

    print OUT <<EOF
  # THIS IS A GENERATED FILE.  DO NOT EDIT!
  $pkg = callPackage ({ $argumentsStr }: stdenv.mkDerivation {
  $pkg = callPackage ({ $argumentsStr, testers }: stdenv.mkDerivation (finalAttrs: {
    pname = "$pkgNames{$pkg}";
    version = "$pkgVersions{$pkg}";
    builder = ./builder.sh;
@@ -342,8 +349,12 @@ foreach my $pkg (sort (keys %pkgURLs)) {
    strictDeps = true;
    nativeBuildInputs = [ pkg-config $nativeBuildInputsStr];
    buildInputs = [ $buildInputsStr];$extraAttrsStr
    meta.platforms = lib.platforms.unix;
  }) {};
    passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
    meta = {
      pkgConfigModules = [ $pcProvidesStr];
      platforms = lib.platforms.unix;
    };
  })) {};

EOF
}
+7 −3
Original line number Diff line number Diff line
@@ -304,7 +304,7 @@ self: super:
    postInstall = ''
      sed "/^Requires:/s/$/, freetype2/" -i "$dev/lib/pkgconfig/xft.pc"
    '';
    passthru = {
    passthru = attrs.passthru // {
      inherit freetype fontconfig;
    };
  });
@@ -834,7 +834,9 @@ self: super:
            done
          )
        '';
        passthru.version = version; # needed by virtualbox guest additions
        passthru = attrs.passthru // {
          inherit version; # needed by virtualbox guest additions
        };
      } else {
        nativeBuildInputs = attrs.nativeBuildInputs ++ [ autoreconfHook bootstrap_cmds xorg.utilmacros xorg.fontutil ];
        buildInputs = commonBuildInputs ++ [
@@ -904,7 +906,9 @@ self: super:

          cp ${darwinOtherX}/share/man -rT $out/share/man
        '' ;
        passthru.version = version;
        passthru = attrs.passthru // {
          inherit version;
        };
      }));

  lndir = super.lndir.overrideAttrs (attrs: {