From ac96806db10b0a33063e996344ea78d20e47f8a9 Mon Sep 17 00:00:00 2001 From: quantenzitrone Date: Sat, 22 Nov 2025 21:30:14 +0100 Subject: [PATCH] xdpyinfo: refactor & move to pkgs/by-name from xorg namespace relevant changes: - use gitlab source instead of xorg release tarballs -> builds with meson - remove and add some dependencies according to the upstream meson.build - remove malloc0returnsnull and NIX_CFLAGS_LINK hacks, as it didn't seem to do anything. (I build it both cross and static and the output of `xdpyinfo -ext all` doesn't change.) --- pkgs/by-name/xd/xdpyinfo/package.nix | 75 +++++++++++++++++++ pkgs/servers/x11/xorg/default.nix | 60 +-------------- .../x11/xorg/generate-expr-from-tarballs.pl | 2 + pkgs/servers/x11/xorg/overrides.nix | 17 ----- pkgs/servers/x11/xorg/tarballs.list | 1 - 5 files changed, 79 insertions(+), 76 deletions(-) create mode 100644 pkgs/by-name/xd/xdpyinfo/package.nix diff --git a/pkgs/by-name/xd/xdpyinfo/package.nix b/pkgs/by-name/xd/xdpyinfo/package.nix new file mode 100644 index 000000000000..fab1d39b6e19 --- /dev/null +++ b/pkgs/by-name/xd/xdpyinfo/package.nix @@ -0,0 +1,75 @@ +{ + lib, + stdenv, + fetchFromGitLab, + meson, + pkg-config, + ninja, + libx11, + libxcb, + libxext, + libxi, + libxtst, + libxcomposite, + libxinerama, + libxpresent, + libxrandr, + libxrender, + libxxf86dga, + libxxf86vm, + nix-update-script, +}: +stdenv.mkDerivation (finalAttrs: { + pname = "xdpyinfo"; + version = "1.4.0"; + + src = fetchFromGitLab { + domain = "gitlab.freedesktop.org"; + owner = "xorg"; + repo = "app/xdpyinfo"; + tag = "xdpyinfo-${finalAttrs.version}"; + hash = "sha256-zN2ViUJhrndqyLFCzcUi2DRg2K2q9eJXzHlUsMNmhNg="; + }; + + strictDeps = true; + + nativeBuildInputs = [ + meson + pkg-config + ninja + ]; + + buildInputs = [ + libx11 + libxcb + libxext + libxi + libxtst + # optional deps + libxcomposite + libxinerama + libxpresent + libxrandr + libxrender + libxxf86dga + libxxf86vm + ]; + + passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex=xdpyinfo-(.*)" ]; }; + + meta = { + description = "display information utility for X"; + longDescription = '' + xdpyinfo is a utility for displaying information about an X server. + It is used to examine the capabilities of a server, the predefined + values for various parameters used in communicating between clients + and the server, and the different types of screens, visuals, and X11 + protocol extensions that are available. + ''; + homepage = "https://gitlab.freedesktop.org/xorg/app/xdpyinfo"; + license = lib.licenses.mitOpenGroup; + mainProgram = "xdpyinfo"; + maintainers = [ ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix index 535fdf04308a..735eb8667b0e 100644 --- a/pkgs/servers/x11/xorg/default.nix +++ b/pkgs/servers/x11/xorg/default.nix @@ -122,6 +122,7 @@ xcursorgen, xcursor-themes, xdm, + xdpyinfo, xdriinfo, xev, xeyes, @@ -198,6 +199,7 @@ self: with self; { xconsole xcursorgen xdm + xdpyinfo xdriinfo xev xeyes @@ -408,64 +410,6 @@ self: with self; { }) ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! - xdpyinfo = callPackage ( - { - stdenv, - pkg-config, - fetchurl, - libdmx, - libX11, - libxcb, - libXcomposite, - libXext, - libXi, - libXinerama, - xorgproto, - libXrender, - libXtst, - libXxf86dga, - libXxf86misc, - libXxf86vm, - testers, - }: - stdenv.mkDerivation (finalAttrs: { - pname = "xdpyinfo"; - version = "1.3.4"; - builder = ./builder.sh; - src = fetchurl { - url = "mirror://xorg/individual/app/xdpyinfo-1.3.4.tar.xz"; - sha256 = "0aw2yhx4ys22231yihkzhnw9jsyzksl4yyf3sx0689npvf0sbbd8"; - }; - hardeningDisable = [ - "bindnow" - "relro" - ]; - strictDeps = true; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ - libdmx - libX11 - libxcb - libXcomposite - libXext - libXi - libXinerama - xorgproto - libXrender - libXtst - libXxf86dga - libXxf86misc - libXxf86vm - ]; - passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - meta = { - pkgConfigModules = [ ]; - platforms = lib.platforms.unix; - }; - }) - ) { }; - # THIS IS A GENERATED FILE. DO NOT EDIT! xf86inputevdev = callPackage ( { diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl index c0f6faebd7f8..56ec18bce9f0 100755 --- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl +++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl @@ -453,6 +453,7 @@ print OUT <