anchor.diff: -{ stdenv, fetchurl
  +{ stdenv, fetchurl, pkgconfig, libtool
   
   # Optional Dependencies
   , gpm ? null
  
positive.code:   # gcc-5.patch should be removed after 5.9
    patches = [ ./clang.patch ./gcc-5.patch ];
  
    buildInputs = [ optGpm ];
  
    configureFlags = [
      (mkWith   true        "abi-version" abiVersion)
      (mkWith   true        "cxx"         null)
      (mkWith   true        "cxx-binding" null)
      (mkWith   false       "ada"         null)
      (mkWith   true        "manpages"    null)
      (mkWith   true        "progs"       null)
      (mkWith   doCheck     "tests"       null)
      (mkWith   true        "curses-h"    null)
      (mkEnable true        "pc-files"    null)
      (mkWith   buildShared "shared"      null)
      (mkWith   true        "normal"      null)
      (mkWith   false       "debug"       null)
      (mkWith   false       "termlib"     null)
      (mkWith   false       "ticlib"      null)
      (mkWith   optGpm      "gpm"         null)
      (mkEnable true        "overwrite"   null)
      (mkEnable true        "database"    null)
      (mkWith   true        "xterm-new"   null)
      (mkEnable true        "symlinks"    null)
      (mkEnable unicode     "widec"       null)
      (mkEnable true        "ext-colors"  null)
      (mkEnable true        "ext-mouse"   null)
    ] ++ stdenv.lib.optionals stdenv.isCygwin [
      "--enable-sp-funcs"
      "--enable-term-driver"
      "--enable-const"
      "--enable-ext-colors"
      "--enable-ext-mouse"
      "--enable-reentrant"
      "--enable-colorfgbg"
      "--enable-tcap-names"
    ];
  
    # PKG_CONFIG_LIBDIR is where the *.pc files will be installed. If this
  
negative.code:     ln -svf . $out/include/ncursesw
      ln -svf . $out/include/ncurses
  
      suffix="$(awk -F': ' 'f{print $3; f=0} /default library suffix/{f=1}' config.log)"
      libs="$(ls $out/lib/pkgconfig | tr ' ' '\n' | sed "s,\(.*\)$suffix\.pc,\1,g")"
    '' + optionalString stdenv.isLinux ''
      for lib in $libs; do
        if [ -e "$out/lib/lib''${lib}$suffix.so" ]; then
          ln -svf lib''${lib}$suffix.so $out/lib/lib$lib.so
          ln -svf lib''${lib}$suffix.so.${abiVersion} $out/lib/lib$lib.so.${abiVersion}
        fi
        if [ -e "$out/lib/lib''${lib}$suffix.a" ]; then
          ln -svf lib''${lib}$suffix.a $out/lib/lib$lib.a
        fi
        ln -svf lib''${lib}$suffix.la $out/lib/lib$lib.la
        ln -svf ''${lib}$suffix.pc $out/lib/pkgconfig/$lib.pc
      done
  
      # Create curses compatability
      ln -svf libncurses.so $out/lib/libcurses.so
    '' + stdenv.lib.optionalString stdenv.isCygwin ''
      for lib in $libs; do
        if test -e $out/lib/lib''${lib}$suffix.dll.a; then
          ln -svf lib''${lib}$suffix.dll.a $out/lib/lib$lib.dll.a
        fi
      done
    '') else ''
  