1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-24 22:50:49 +00:00

Merge pull request #126372 from Stunkymonkey/xorg_pname_version

This commit is contained in:
Sandro 2021-06-16 15:32:00 +02:00 committed by GitHub
commit 0c53e3116d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 451 additions and 224 deletions

File diff suppressed because it is too large Load diff

View file

@ -17,6 +17,7 @@ use File::Temp;
my %pkgURLs;
my %pkgHashes;
my %pkgNames;
my %pkgVersions;
my %pkgRequires;
my %pkgNativeRequires;
@ -73,8 +74,12 @@ while (<>) {
next;
}
# split by first occurence of hyphen followd by only numbers ends line or another hyphen follows
my ($name, $version) = split(/-(?=[.0-9]+(?:$|-))/, $pkgName, 2);
$pkgURLs{$pkg} = $tarball;
$pkgNames{$pkg} = $pkgName;
$pkgNames{$pkg} = $name;
$pkgVersions{$pkg} = $version;
my $cachePath = catdir($downloadCache, basename($tarball));
my $hash;
@ -302,7 +307,8 @@ foreach my $pkg (sort (keys %pkgURLs)) {
print OUT <<EOF
$pkg = callPackage ({ $argumentsStr }: stdenv.mkDerivation {
name = "$pkgNames{$pkg}";
pname = "$pkgNames{$pkg}";
version = "$pkgVersions{$pkg}";
builder = ./builder.sh;
src = fetchurl {
url = "$pkgURLs{$pkg}";

View file

@ -664,7 +664,7 @@ self: super:
( # assert() keeps runtime reference xorgserver-dev in xf86-video-intel and others
cd "$dev"
for f in include/xorg/*.h; do
sed "1i#line 1 \"${attrs.name}/$f\"" -i "$f"
sed "1i#line 1 \"${attrs.pname}-${attrs.version}/$f\"" -i "$f"
done
)
'';