Unverified Commit ac96806d authored by quantenzitrone's avatar quantenzitrone
Browse files

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.)
parent 6bd877d2
Loading
Loading
Loading
Loading
+75 −0
Original line number Diff line number Diff line
{
  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;
  };
})
+2 −58
Original line number Diff line number Diff line
@@ -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 (
    {
+2 −0
Original line number Diff line number Diff line
@@ -453,6 +453,7 @@ print OUT <<EOF;
  xcursorgen,
  xcursor-themes,
  xdm,
  xdpyinfo,
  xdriinfo,
  xev,
  xeyes,
@@ -529,6 +530,7 @@ self: with self; {
    xconsole
    xcursorgen
    xdm
    xdpyinfo
    xdriinfo
    xev
    xeyes
+0 −17
Original line number Diff line number Diff line
@@ -59,10 +59,6 @@
let
  inherit (stdenv.hostPlatform) isDarwin;

  malloc0ReturnsNullCrossFlag = lib.optional (
    stdenv.hostPlatform != stdenv.buildPlatform
  ) "--enable-malloc0returnsnull";

  addMainProgram =
    pkg:
    {
@@ -115,19 +111,6 @@ self: super:

  mkfontdir = xorg.mkfontscale;

  xdpyinfo = super.xdpyinfo.overrideAttrs (attrs: {
    configureFlags = attrs.configureFlags or [ ] ++ malloc0ReturnsNullCrossFlag;
    preConfigure =
      attrs.preConfigure or ""
      # missing transitive dependencies
      + lib.optionalString stdenv.hostPlatform.isStatic ''
        export NIX_CFLAGS_LINK="$NIX_CFLAGS_LINK -lXau -lXdmcp"
      '';
    meta = attrs.meta // {
      mainProgram = "xdpyinfo";
    };
  });

  xf86inputevdev = super.xf86inputevdev.overrideAttrs (attrs: {
    outputs = [
      "out"
+0 −1
Original line number Diff line number Diff line
mirror://xorg/individual/app/xclock-1.1.1.tar.xz
mirror://xorg/individual/app/xdpyinfo-1.3.4.tar.xz
mirror://xorg/individual/app/xfd-1.1.4.tar.xz
mirror://xorg/individual/app/xfs-1.2.2.tar.xz
mirror://xorg/individual/app/xinit-1.4.4.tar.xz