anchor.diff:  { stdenv, lib, fetchurl, coreutils, ncurses, gzip, flex, bison
   , less, makeWrapper
   , buildPackages
  -, x11Mode ? false, qtMode ? false, libXaw, libXext, bdftopcf, mkfontdir, pkgconfig, qt5
  +, x11Mode ? false, qtMode ? false, libXaw, libXext, libXpm, bdftopcf, mkfontdir, pkgconfig, qt5
   }:
   
   let
  
positive.code:       -e 's,CFLAGS.*QtGui.*,CFLAGS += `pkg-config Qt5Gui --cflags`,' \
        -e 's,CFLAGS+=-DCOMPRESS.*,CFLAGS+=-DCOMPRESS=\\"${gzip}/bin/gzip\\" \\\
          -DCOMPRESS_EXTENSION=\\".gz\\",' \
        -i sys/unix/hints/linux-qt4
      ''}
      ${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform)
  
negative.code:   binPath = lib.makeBinPath [ coreutils less ];
  
  in stdenv.mkDerivation rec {
    version = "3.6.2";
    name = if x11Mode then "nethack-x11-${version}"
           else if qtMode then "nethack-qt-${version}"
           else "nethack-${version}";
  
    src = fetchurl {
      url = "https://nethack.org/download/3.6.2/nethack-362-src.tgz";
      sha256 = "07fvkm3v11a4pjrq2f66vjslljsvk6raal53skn4gqsfdbd0ml7v";
    };
  
    buildInputs = [ ncurses ]
                  ++ lib.optionals x11Mode [ libXaw libXext libXpm ]
                  ++ lib.optionals qtMode [ gzip qt5.qtbase.bin qt5.qtmultimedia.bin ];
  
    nativeBuildInputs = [ flex bison ]
  