anchor.diff:      })
     ];
   
  -  makeFlags = [ "cups_serverroot=$(out)" "cups_serverbin=$(out)/lib/cups" ];
  -
     preConfigure = ''
       # requires in-tree (heavily patched) openjpeg
       rm -rf jpeg libpng zlib jasper expat tiff lcms{,2} jbig2dec freetype cups/libs ijs
  
positive.code:     sed "s@^ZLIBDIR=.*@ZLIBDIR=${zlib}/include@" -i configure.ac
  
      autoconf
    '';
  
    configureFlags =
      [ "--with-system-libtiff"
        "--enable-dynamic"
        (if x11Support then "--with-x" else "--without-x")
        (if cupsSupport then "--enable-cups" else "--disable-cups")
      ];
  
    doCheck = true;
    preCheck = "mkdir ./obj";
    # parallel check sometimes gave: Fatal error: can't create ./obj/whitelst.o
  
    # don't build/install statically linked bin/gs
    buildFlags = "so";
    installTargets="soinstall";
  
    postInstall = ''
      ln -s gsc "$out"/bin/gs
  
      mkdir -p "$doc/share/ghostscript/${version}"
      mv "$out/share/ghostscript/${version}"/{doc,examples} "$doc/share/ghostscript/${version}/"
  
negative.code: { stdenv, lib, fetchurl, fetchpatch, pkgconfig, zlib, expat, openssl, autoconf
  , libjpeg, libpng, libtiff, freetype, fontconfig, lcms2, libpaper, jbig2dec
  , libiconv, ijs
  , x11Support ? false, xlibsWrapper ? null
  