Merge pull request #261484 from Ericson2314/xorg-pkg-config

xorg: Add `meta.pkgConfigModules` and test
This commit is contained in:
John Ericson 2023-10-17 14:31:36 -04:00 committed by GitHub
commit caf5ba6d92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1568 additions and 669 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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
}

View File

@ -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: {