anchor.diff:    # gcc-5.patch should be removed after 5.9
     patches = [ ./clang.patch ./gcc-5.patch ];
   
  +  nativeBuildInputs = [ pkgconfig libtool ];
     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"
  +    (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)
  +    (mkEnable true        "mixed-case"    "auto")
  +    (mkWith   true        "libtool"       null)
  +    (mkWith   true        "shared"        null)
  +    (mkWith   true        "normal"        null)
  +    (mkWith   false       "debug"         null)
  +    (mkWith   false       "profile"       null)
  +    (mkWith   false       "termlib"       null)
  +    (mkWith   false       "ticlib"        null)
  +    (mkWith   optGpm      "gpm"           null)
  +    (mkWith   true        "dlsym"         null)
  +    (mkWith   true        "sysmouse"      "maybe")
  +    (mkEnable true        "relink"        null)
  +    (mkEnable true        "overwrite"     null)
  +    (mkEnable true        "database"      null)
  +    (mkWith   false       "hashed-db"     null)
  +    (mkWith   true        "fallbacks"     "")
  +    (mkWith   true        "xterm-new"     null)
  +    # With terminfo-dirs
  +    # With default-terminfo-dir
  +    # Enable big-core: Autodetected
  +    # Enable big-strings: Autodetected
  +    (mkEnable false       "termcap"       null)
  +    (mkWith   true        "termpath"      "\${out}/share/misc/termcap")
  +    (mkEnable true        "getcap"        null)
  +    (mkEnable false       "getcap-cache"  null)
  +    (mkEnable true        "home-terminfo" null)
  +    (mkEnable true        "root-environ"  null)
  +    (mkEnable true        "symlinks"      null)
  +    (mkEnable false       "broken-linker" null)
  +    (mkEnable false       "bsdpad"        null)
  +    (mkEnable unicode     "widec"         null)
  +    (mkEnable true        "lp64"          null)
  +    (mkEnable true        "tparm-varargs" null)
  +    (mkWith   true        "tic-depends"   null)
  +    (mkWith   true        "bool"          null)
  +    # With caps
  +    # With chtype
  +    # With ospeed
  +    # With mmask-t
  +    # With ccharw-max
  +    (mkWith   false       "rcs-ids"       null)
  +    (mkEnable true        "ext-funcs"     null)
  +    (mkEnable true        "sp-funcs"      null)
  +    (mkEnable true        "term-driver"   null)
  +    (mkEnable true        "const"         null)
  +    (mkEnable true        "ext-colors"    null)
  +    (mkEnable true        "ext-mouse"     null)
  +    (mkEnable true        "no-padding"    null)
  +    (mkEnable false       "signed-char"   null)
  +    (mkEnable true        "sigwinch"      null)
  +    (mkEnable true        "tcap-names"    null)
  +    (mkWith   true        "devlop"        null)
  +    (mkEnable true        "hard-tabs"     null)
  +    (mkEnable true        "xmc-glitch"    null)
  +    (mkWith   true        "assumed-color" null)
  +    (mkEnable true        "hashmap"       null)
  +    (mkEnable true        "colorfgbg"      null)
  +    (mkEnable true        "interop"        null)
  +    (mkWith   true        "pthread"        null)
  +    (mkEnable false       "pthreads-eintr" null)
  +    (mkEnable false       "weak-symbols"   null)
  +    (mkEnable true        "reentrant"      null)
  +    # With wrap-prefix
  +    (mkEnable true        "safe-sprintf"   null)
  +    (mkEnable true        "scroll-hints"   null)
  +    (mkEnable false       "wgetch-events"  null)
  +    (mkEnable true        "echo"           null)
  +    (mkEnable true        "warnings"       null)
  +    (mkEnable false       "assertions"     null)
  +    (mkEnable false       "expanded"       null)
  +    (mkEnable true        "macros"         null)
  +    (mkWith   false       "trace"          null)
     ];
   
     # PKG_CONFIG_LIBDIR is where the *.pc files will be installed. If this
  
positive.code: { stdenv, fetchurl
  
  # Optional Dependencies
  , gpm ? null
  
negative.code: 
  with stdenv.lib;
  let
    optGpm = stdenv.shouldUsePkg gpm;
  in
  stdenv.mkDerivation rec {
  