anchor.diff:  
   let
     toolkit =
  -    if withGTK3 then "gtk3"
  -    else if withGTK2 then "gtk2"
  +    if withGTK2 then "gtk2"
  +    else if withGTK3 then "gtk3"
       else "lucid";
   in
   stdenv.mkDerivation rec {
     name = "emacs-25.1";
  -
  -  builder = ./builder.sh;
   
     src = fetchurl {
       url = "mirror://gnu//emacs/${name}.tar.xz";
       sha256 = "0cwgyiyymnx4xdg99dm2drfxcyhy2jmyf0rkr9fwj9mwwf77kwhr";
     };
   
  -  patches = lib.optionals stdenv.isDarwin [
  -    ./at-fdcwd.patch
  -  ];
  +  patches = lib.optional stdenv.isDarwin ./at-fdcwd.patch;
   
  -  postPatch = ''
  -    substituteInPlace lisp/international/mule-cmds.el \
  -      --replace "/usr/share/locale" "${gettext}/share/locale"
  -  '';
  +  nativeBuildInputs = [ pkgconfig ]
  +    ++ lib.optionals srcRepo [ autoconf automake texinfo ];
   
     buildInputs =
  -    [ ncurses gconf libxml2 gnutls alsaLib pkgconfig texinfo acl gpm gettext
  -      autoconf automake ]
  +    [ ncurses gconf libxml2 gnutls alsaLib acl gpm gettext ]
       ++ lib.optional stdenv.isLinux dbus
       ++ lib.optionals withX
         [ xlibsWrapper libXaw Xaw3d libXpm libpng libjpeg libungif libtiff librsvg libXft
  
positive.code: { stdenv, lib, fetchurl, ncurses, xlibsWrapper, libXaw, libXpm, Xaw3d
  , pkgconfig, gettext, libXft, dbus, libpng, libjpeg, libungif
  , libtiff, librsvg, texinfo, gconf, libxml2, imagemagick, gnutls
  , alsaLib, cairo, acl, gpm, AppKit, CoreWLAN, Kerberos, GSS, ImageIO
  , autoconf, automake
  , withX ? !stdenv.isDarwin
  , withGTK3 ? false, gtk3 ? null
  , withXwidgets ? false, webkitgtk24x ? null, wrapGAppsHook ? null, glib_networking ? null
  , withGTK2 ? true, gtk2
  }:
  
  assert (libXft != null) -> libpng != null;      # probably a bug
  
negative.code:              "--with-gif=no" "--with-tiff=no" ])
      ++ lib.optional withXwidgets "--with-xwidgets";
  
    preConfigure = lib.optionalString srcRepo ''
      ./autogen.sh
    '' + ''
      substituteInPlace lisp/international/mule-cmds.el \
        --replace /usr/share/locale ${gettext}/share/locale
  
      for makefile_in in $(find . -name Makefile.in -print); do
          substituteInPlace $makefile_in --replace /bin/pwd pwd
      done
    '';
  
    postInstall = ''
  