font-{alias,util}, gccmakedep, libp{ciacces,threadstub}s: refactor and migrate to pkgs/by-name from xorg namespace (#369520)

This commit is contained in:
jopejoe1 2025-04-24 19:11:58 +02:00 committed by GitHub
commit 13c1207a12
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 330 additions and 207 deletions

View file

@ -257,6 +257,11 @@ lib.mapAttrs mkLicense (
fullName = "BSD Protection License";
};
bsdSourceCode = {
spdxId = "BSD-Source-Code";
fullName = "BSD Source Code Attribution";
};
bsl11 = {
spdxId = "BUSL-1.1";
fullName = "Business Source License 1.1";
@ -452,6 +457,11 @@ lib.mapAttrs mkLicense (
fullName = "Common Public License 1.0";
};
cronyx = {
spdxId = "Cronyx";
fullName = "Cronyx License";
};
curl = {
spdxId = "curl";
fullName = "curl License";
@ -937,6 +947,11 @@ lib.mapAttrs mkLicense (
fullName = "MIT No Attribution";
};
mitOpenGroup = {
spdxId = "MIT-open-group";
fullName = "MIT Open Group variant";
};
mpl10 = {
spdxId = "MPL-1.0";
fullName = "Mozilla Public License 1.0";
@ -1328,6 +1343,11 @@ lib.mapAttrs mkLicense (
fullName = "Unicode License Agreement - Data Files and Software (2016)";
};
unicodeTOU = {
spdxId = "Unicode-TOU";
fullName = "Unicode Terms of Use";
};
unlicense = {
spdxId = "Unlicense";
fullName = "The Unlicense";

View file

@ -0,0 +1,40 @@
{
lib,
stdenv,
fetchurl,
writeScript,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "font-alias";
version = "1.0.5";
src = fetchurl {
url = "mirror://xorg/individual/font/font-alias-${finalAttrs.version}.tar.xz";
hash = "sha256-n4niF7tz4ONjagpJP7+LfJlRVuDFPZoEdtIBtnwta24=";
};
passthru = {
updateScript = writeScript "update-${finalAttrs.pname}" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts
version="$(list-directory-versions --pname ${finalAttrs.pname} \
--url https://xorg.freedesktop.org/releases/individual/font/ \
| sort -V | tail -n1)"
update-source-version ${finalAttrs.pname} "$version"
'';
};
meta = {
description = "Common aliases for Xorg fonts";
homepage = "https://gitlab.freedesktop.org/xorg/font/alias";
license = with lib.licenses; [
cronyx
mit
];
maintainers = [ ];
platforms = lib.platforms.all;
};
})

View file

@ -0,0 +1,49 @@
{
lib,
stdenv,
fetchurl,
testers,
writeScript,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "font-util";
version = "1.4.1";
src = fetchurl {
url = "mirror://xorg/individual/font/font-util-${finalAttrs.version}.tar.xz";
hash = "sha256-XJ9kEjwZSxUP7okEmZFoc4bm/zbvKve4C6U++vNozJU=";
};
passthru = {
updateScript = writeScript "update-${finalAttrs.pname}" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts
version="$(list-directory-versions --pname ${finalAttrs.pname} \
--url https://xorg.freedesktop.org/releases/individual/font/ \
| sort -V | tail -n1)"
update-source-version ${finalAttrs.pname} "$version"
'';
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
meta = {
description = "X.Org font package creation/installation utilities";
homepage = "https://gitlab.freedesktop.org/xorg/font/util";
license = with lib.licenses; [
mit
bsd2
bsdSourceCode
mitOpenGroup
# there is a bit of a diff, but i think its close enough
# it was probably just adapted a bit to fit to the repository structure
# or its an older version that the one on spdx
unicodeTOU
];
maintainers = [ ];
pkgConfigModules = [ "fontutil" ];
platforms = lib.platforms.unix;
};
})

View file

@ -0,0 +1,59 @@
{
lib,
stdenv,
fetchurl,
writeScript,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gccmakedep";
version = "1.0.4";
src = fetchurl {
url = "mirror://xorg/individual/util/gccmakedep-${finalAttrs.version}.tar.xz";
hash = "sha256-UIj5h2n7Y8Mm6bnSy3yfSmMKKAHdHaBpcdCCkXbPJbY=";
};
passthru.updateScript = writeScript "update-${finalAttrs.pname}" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts
version="$(list-directory-versions --pname ${finalAttrs.pname} \
--url https://xorg.freedesktop.org/releases/individual/util/ \
| sort -V | tail -n1)"
update-source-version ${finalAttrs.pname} "$version"
'';
meta = {
description = "Creates dependencies in makefiles using 'gcc -M'";
homepage = "https://gitlab.freedesktop.org/xorg/util/gccmakedep";
license = with lib.licenses; [
# COPYING file suggests looking at the Copyright headers of every file:
# upstream issue: https://gitlab.freedesktop.org/xorg/util/gccmakedep/-/issues/1
# 1. build system files Copyright Red Hat
hpndSellVariant
# 2. gccmakedep.man was written by Colin Watson for Debian somewhen
# earlier than November 2003. While I wasn't able to trace the exact
# source, between 1997 and 2004 the "Debian Social Contract, Version
# 1.0" was in effect, which requires all components of the Debian
# Operating System to be free software, which includes this man page.
# https://www.debian.org/social_contract.1.0
free
# 3. gccmakedep.in, originally named gccmdep.cpp was copied from the
# XFree86 project around 2000. While it states to be "Based on
# mdepend.cpp and code supplied by Hongjiu Lu", that doesn't matter
# because it was supposedly completely rewritten by XFree86.
# XFree86 code without any explicit Copyright Statement is under X11.
x11
# 4. some files don't have any license info, but they are all trivial
];
mainProgram = "gccmakedep";
maintainers = [ ];
platforms = lib.platforms.unix;
};
})

View file

@ -0,0 +1,81 @@
{
lib,
stdenv,
fetchurl,
testers,
writeScript,
pkg-config,
meson,
ninja,
zlib,
netbsd,
hwdata,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libpciaccess";
version = "0.18.1";
src = fetchurl {
url = "mirror://xorg/individual/lib/libpciaccess-${finalAttrs.version}.tar.xz";
hash = "sha256-SvQ0RLOK21VF0O0cLORtlgjMR7McI4f8UYFlZ2Wm+nY=";
};
strictDeps = true;
nativeBuildInputs = [
pkg-config
meson
ninja
];
buildInputs =
[ zlib ]
++ lib.optionals stdenv.hostPlatform.isNetBSD [
netbsd.libarch
netbsd.libpci
];
mesonFlags = [
(lib.mesonOption "pci-ids" "${hwdata}/share/hwdata")
(lib.mesonEnable "zlib" true)
];
passthru = {
updateScript = writeScript "update-${finalAttrs.pname}" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts
version="$(list-directory-versions --pname ${finalAttrs.pname} \
--url https://xorg.freedesktop.org/releases/individual/lib/ \
| sort -V | tail -n1)"
update-source-version ${finalAttrs.pname} "$version"
'';
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
meta = {
description = "Generic PCI access library";
homepage = "https://gitlab.freedesktop.org/xorg/lib/libpciaccess";
license = with lib.licenses; [
mit
isc
x11
];
pkgConfigModules = [ "pciaccess" ];
# https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/blob/6cd5a4afbb70868c7746de8d50dea59e02e9acf2/configure.ac#L108-114
platforms =
with lib.platforms;
cygwin
++ freebsd
++ illumos
++ linux
++ lib.platforms.netbsd # otherwise netbsd from the function arguments is used
++ openbsd;
badPlatforms = [
# mandatory shared library
lib.systems.inspect.platformPatterns.isStatic
];
};
})

View file

@ -0,0 +1,43 @@
{
lib,
stdenv,
fetchurl,
testers,
writeScript,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libpthread-stubs";
version = "0.5";
src = fetchurl {
url = "mirror://xorg/individual/lib/libpthread-stubs-${finalAttrs.version}.tar.xz";
hash = "sha256-WdpWbezOunwqeXCkoDtI2ZBfEmL/lEEKZJIk4z0kQrw=";
};
passthru = {
updateScript = writeScript "update-${finalAttrs.pname}" ''
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts
version="$(list-directory-versions --pname ${finalAttrs.pname} \
--url https://xorg.freedesktop.org/releases/individual/lib/ \
| sort -V | tail -n1)"
update-source-version ${finalAttrs.pname} "$version"
'';
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
};
meta = {
description = "Provides a pkg-config file `pthread-stubs.pc` containing the Cflags/Libs flags applicable to programs/libraries that use only lightweight pthread API";
homepage = "https://gitlab.freedesktop.org/xorg/lib/pthread-stubs";
# gitlab says x11-distribute-modifications but it's not
# maybe due to https://github.com/spdx/spdx-online-tools/issues/540
license = lib.licenses.x11;
maintainers = [ ];
pkgConfigModules = [ "pthread-stubs" ];
# on these platforms according to the readme
platforms = with lib.platforms; linux ++ cygwin ++ darwin ++ [ "x86_64-solaris" ];
};
})

View file

@ -1,14 +1,26 @@
# THIS IS A GENERATED FILE. DO NOT EDIT!
{
lib,
pixman,
font-alias,
font-util,
gccmakedep,
libpciaccess,
libpthread-stubs,
luit,
pixman,
}:
self: with self; {
inherit pixman;
inherit luit;
inherit
gccmakedep
libpciaccess
luit
pixman
;
fontalias = font-alias;
fontutil = font-util;
libpthreadstubs = libpthread-stubs;
# THIS IS A GENERATED FILE. DO NOT EDIT!
appres = callPackage (
@ -413,37 +425,6 @@ self: with self; {
})
) { };
# THIS IS A GENERATED FILE. DO NOT EDIT!
fontalias = callPackage (
{
stdenv,
pkg-config,
fetchurl,
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "font-alias";
version = "1.0.5";
builder = ./builder.sh;
src = fetchurl {
url = "mirror://xorg/individual/font/font-alias-1.0.5.tar.xz";
sha256 = "0vkb5mybc0fjfq29lgf5w1b536bwifzkyj8ad9iy7q3kpcby52cz";
};
hardeningDisable = [
"bindnow"
"relro"
];
strictDeps = true;
nativeBuildInputs = [ pkg-config ];
buildInputs = [ ];
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = {
pkgConfigModules = [ ];
platforms = lib.platforms.unix;
};
})
) { };
# THIS IS A GENERATED FILE. DO NOT EDIT!
fontarabicmisc = callPackage (
{
@ -1594,37 +1575,6 @@ self: with self; {
})
) { };
# THIS IS A GENERATED FILE. DO NOT EDIT!
fontutil = callPackage (
{
stdenv,
pkg-config,
fetchurl,
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "font-util";
version = "1.4.1";
builder = ./builder.sh;
src = fetchurl {
url = "mirror://xorg/individual/font/font-util-1.4.1.tar.xz";
sha256 = "15fcd3rzlgm51fwgfapg6vzyd1kkd28rj149xq7iajqr7h9697sw";
};
hardeningDisable = [
"bindnow"
"relro"
];
strictDeps = true;
nativeBuildInputs = [ pkg-config ];
buildInputs = [ ];
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = {
pkgConfigModules = [ "fontutil" ];
platforms = lib.platforms.unix;
};
})
) { };
# THIS IS A GENERATED FILE. DO NOT EDIT!
fontwinitzkicyrillic = callPackage (
{
@ -1703,37 +1653,6 @@ self: with self; {
})
) { };
# THIS IS A GENERATED FILE. DO NOT EDIT!
gccmakedep = callPackage (
{
stdenv,
pkg-config,
fetchurl,
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "gccmakedep";
version = "1.0.4";
builder = ./builder.sh;
src = fetchurl {
url = "mirror://xorg/individual/util/gccmakedep-1.0.4.tar.xz";
sha256 = "1di5rxv930nhf5ls07fx04l0lqsakxycplmrx4kc6qzvd63zk22h";
};
hardeningDisable = [
"bindnow"
"relro"
];
strictDeps = true;
nativeBuildInputs = [ pkg-config ];
buildInputs = [ ];
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = {
pkgConfigModules = [ ];
platforms = lib.platforms.unix;
};
})
) { };
# THIS IS A GENERATED FILE. DO NOT EDIT!
iceauth = callPackage (
{
@ -3282,68 +3201,6 @@ self: with self; {
})
) { };
# THIS IS A GENERATED FILE. DO NOT EDIT!
libpciaccess = callPackage (
{
stdenv,
pkg-config,
fetchurl,
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libpciaccess";
version = "0.18.1";
builder = ./builder.sh;
src = fetchurl {
url = "mirror://xorg/individual/lib/libpciaccess-0.18.1.tar.xz";
sha256 = "0xpslrjnfrc1a7y8f8qwnd3wq24ndpj2q77ds12mbnwand239x2a";
};
hardeningDisable = [
"bindnow"
"relro"
];
strictDeps = true;
nativeBuildInputs = [ pkg-config ];
buildInputs = [ ];
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = {
pkgConfigModules = [ "pciaccess" ];
platforms = lib.platforms.unix;
};
})
) { };
# THIS IS A GENERATED FILE. DO NOT EDIT!
libpthreadstubs = callPackage (
{
stdenv,
pkg-config,
fetchurl,
testers,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "libpthread-stubs";
version = "0.5";
builder = ./builder.sh;
src = fetchurl {
url = "mirror://xorg/individual/xcb/libpthread-stubs-0.5.tar.xz";
sha256 = "1g224hyy694jch54357zc895z46r90xs193hg4m7rfnfxinmdnjr";
};
hardeningDisable = [
"bindnow"
"relro"
];
strictDeps = true;
nativeBuildInputs = [ pkg-config ];
buildInputs = [ ];
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = {
pkgConfigModules = [ "pthread-stubs" ];
platforms = lib.platforms.unix;
};
})
) { };
# THIS IS A GENERATED FILE. DO NOT EDIT!
libxcb = callPackage (
{

View file

@ -36,6 +36,9 @@ $pcMap{"gl"} = "libGL";
$pcMap{"GL"} = "libGL";
$pcMap{"gbm"} = "libgbm";
$pcMap{"hwdata"} = "hwdata";
$pcMap{"fontutil"} = "fontutil";
$pcMap{"pciaccess"} = "libpciaccess";
$pcMap{"pthread-stubs"} = "libpthreadstubs";
$pcMap{"\$PIXMAN"} = "pixman";
$pcMap{"\$RENDERPROTO"} = "xorgproto";
$pcMap{"\$DRI3PROTO"} = "xorgproto";
@ -260,14 +263,26 @@ print OUT <<EOF;
# THIS IS A GENERATED FILE. DO NOT EDIT!
{
lib,
pixman,
font-alias,
font-util,
gccmakedep,
libpciaccess,
libpthread-stubs,
luit,
pixman,
}:
self: with self; {
inherit pixman;
inherit luit;
inherit
gccmakedep
libpciaccess
luit
pixman
;
fontalias = font-alias;
fontutil = font-util;
libpthreadstubs = libpthread-stubs;
EOF

View file

@ -153,7 +153,6 @@ self: super:
};
});
gccmakedep = addMainProgram super.gccmakedep { };
iceauth = addMainProgram super.iceauth { };
ico = addMainProgram super.ico { };
@ -619,45 +618,6 @@ self: super:
]; # mainly to avoid propagation
});
libpciaccess = super.libpciaccess.overrideAttrs (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [
meson
ninja
];
buildInputs =
attrs.buildInputs
++ [ zlib ]
++ lib.optionals stdenv.hostPlatform.isNetBSD [
netbsd.libarch
netbsd.libpci
];
mesonFlags = [
(lib.mesonOption "pci-ids" "${hwdata}/share/hwdata")
(lib.mesonEnable "zlib" true)
];
meta = attrs.meta // {
# https://gitlab.freedesktop.org/xorg/lib/libpciaccess/-/blob/master/configure.ac#L108-114
platforms =
lib.fold (os: ps: ps ++ lib.platforms.${os})
[ ]
[ "cygwin" "freebsd" "linux" "netbsd" "openbsd" "illumos" ];
badPlatforms = [
# mandatory shared library
lib.systems.inspect.platformPatterns.isStatic
];
};
});
libpthreadstubs = super.libpthreadstubs.overrideAttrs (attrs: {
# only contains a pkgconfig file on linux and windows
meta = attrs.meta // {
platforms = lib.platforms.unix ++ lib.platforms.windows;
};
});
setxkbmap = super.setxkbmap.overrideAttrs (attrs: {
postInstall = ''
mkdir -p $out/share/man/man7

View file

@ -1,4 +1,3 @@
mirror://xorg/individual/xcb/libpthread-stubs-0.5.tar.xz
mirror://xorg/individual/xcb/xcb-util-0.4.1.tar.xz
mirror://xorg/individual/xcb/xcb-util-errors-1.0.1.tar.xz
mirror://xorg/individual/xcb/xcb-util-image-0.4.1.tar.xz
@ -132,7 +131,6 @@ mirror://xorg/individual/font/font-adobe-100dpi-1.0.4.tar.xz
mirror://xorg/individual/font/font-adobe-utopia-75dpi-1.0.5.tar.xz
mirror://xorg/individual/font/font-adobe-utopia-100dpi-1.0.5.tar.xz
mirror://xorg/individual/font/font-adobe-utopia-type1-1.0.5.tar.xz
mirror://xorg/individual/font/font-alias-1.0.5.tar.xz
mirror://xorg/individual/font/font-arabic-misc-1.0.4.tar.xz
mirror://xorg/individual/font/font-bh-75dpi-1.0.4.tar.xz
mirror://xorg/individual/font/font-bh-100dpi-1.0.4.tar.xz
@ -161,7 +159,6 @@ mirror://xorg/individual/font/font-schumacher-misc-1.1.3.tar.xz
mirror://xorg/individual/font/font-screen-cyrillic-1.0.5.tar.xz
mirror://xorg/individual/font/font-sony-misc-1.0.4.tar.xz
mirror://xorg/individual/font/font-sun-misc-1.0.4.tar.xz
mirror://xorg/individual/font/font-util-1.4.1.tar.xz
mirror://xorg/individual/font/font-winitzki-cyrillic-1.0.4.tar.xz
mirror://xorg/individual/font/font-xfree86-type1-1.0.5.tar.xz
https://gitlab.freedesktop.org/xorg/lib/libAppleWM/-/archive/be972ebc3a97292e7d2b2350eff55ae12df99a42/libAppleWM-be972ebc3a97292e7d2b2350eff55ae12df99a42.tar.bz2
@ -169,7 +166,6 @@ mirror://xorg/individual/lib/libdmx-1.1.5.tar.xz
mirror://xorg/individual/lib/libfontenc-1.1.8.tar.xz
mirror://xorg/individual/lib/libFS-1.0.10.tar.xz
mirror://xorg/individual/lib/libICE-1.1.2.tar.xz
mirror://xorg/individual/lib/libpciaccess-0.18.1.tar.xz
mirror://xorg/individual/lib/libSM-1.2.5.tar.xz
mirror://xorg/individual/lib/libWindowsWM-1.0.1.tar.bz2
mirror://xorg/individual/lib/libX11-1.8.12.tar.xz
@ -211,7 +207,6 @@ mirror://xorg/individual/lib/xtrans-1.6.0.tar.xz
mirror://xorg/individual/proto/xcb-proto-1.17.0.tar.xz
mirror://xorg/individual/proto/xorgproto-2024.1.tar.xz
mirror://xorg/individual/util/bdftopcf-1.1.2.tar.xz
mirror://xorg/individual/util/gccmakedep-1.0.4.tar.xz
mirror://xorg/individual/util/imake-1.0.10.tar.xz
mirror://xorg/individual/util/lndir-1.0.5.tar.xz
mirror://xorg/individual/util/makedepend-1.0.9.tar.xz

View file

@ -1,5 +1,5 @@
#!/usr/bin/env nix-shell
#!nix-shell --pure --keep NIX_PATH -i python3 -p nix git "python3.withPackages (ps: [ ps. packaging ps.beautifulsoup4 ps.requests ])"
#!nix-shell --pure --keep NIX_PATH -i python3 -p nix git nixfmt-rfc-style "python3.withPackages (ps: [ ps. packaging ps.beautifulsoup4 ps.requests ])"
# Usage: Run ./update.py from the directory containing tarballs.list. The script checks for the
# latest versions of all packages, updates the expressions if any update is found, and commits
@ -93,6 +93,10 @@ print("Generating updated expr (slow)...")
subprocess.run(["./generate-expr-from-tarballs.pl", "tarballs.list"], check=True)
print("Formatting generated expr...")
subprocess.run(["nixfmt", "default.nix"], check=True)
print("Committing...")
subprocess.run(["git", "add", "default.nix", "tarballs.list"], check=True)