anchor.diff:     substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd
      substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd
      substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd
  +  '' + lib.optionalString hostPlatform.isCygwin ''
  +    sed -i -e "s/\(cldr_plurals_LDADD = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
  +    sed -i -e "s/\(libgettextsrc_la_LDFLAGS = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
     '';
   
     # On cross building, gettext supposes that the wchar.h from libc
  
positive.code: // stdenv.lib.optionalAttrs stdenv.isDarwin {
    makeFlags = "CFLAGS=-D_FORTIFY_SOURCE=0";
  }
  
  // stdenv.lib.optionalAttrs stdenv.isCygwin {
    patchPhase =
     # Make sure `error.c' gets compiled and is part of `libgettextlib.la'.
     # This fixes:
     # gettext-0.18.1.1/gettext-tools/src/msgcmp.c:371: undefined reference to `_error_message_count'
    '' 
     sed -i gettext-tools/gnulib-lib/Makefile.in \
            -e 's/am_libgettextlib_la_OBJECTS =/am_libgettextlib_la_OBJECTS = error.lo/g'
     '';
  }
  
negative.code:   LDFLAGS = if stdenv.isSunOS then "-lm -lmd -lmp -luutil -lnvpair -lnsl -lidmap -lavl -lsec" else "";
  
    configureFlags = [ "--disable-csharp" "--with-xz" ]
       # avoid retaining reference to CF during stdenv bootstrap
       ++ lib.optionals stdenv.isDarwin [
              "gt_cv_func_CFPreferencesCopyAppValue=no"
  