@@ -1,4 +1,4 @@
1−{ stdenv, lib, fetchurl, libiconv, xz }:
1+{ stdenv, lib, hostPlatform, fetchurl, libiconv, xz }:
22
33stdenv.mkDerivation rec {
44 name = "gettext-${version}";
@@ -18,15 +18,6 @@ stdenv.mkDerivation rec {
1818 LDFLAGS = if stdenv.isSunOS then "-lm -lmd -lmp -luutil -lnvpair -lnsl -lidmap -lavl -lsec" else "";
1919
2020 configureFlags = [ "--disable-csharp" "--with-xz" ]
21− ++ lib.optionals stdenv.isCygwin [
22− "--disable-java"
23− "--disable-native-java"
24− # Share the cache among the various `configure' runs.
25− "--config-cache"
26− "--with-included-gettext"
27− "--with-included-glib"
28− "--with-included-libcroco"
29− ]
3021 # avoid retaining reference to CF during stdenv bootstrap
3122 ++ lib.optionals stdenv.isDarwin [
3223 "gt_cv_func_CFPreferencesCopyAppValue=no"
@@ -38,6 +29,9 @@ stdenv.mkDerivation rec {
3829 substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd
3930 substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd
4031 substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd
32+ '' + lib.optionalString hostPlatform.isCygwin ''
33+ sed -i -e "s/\(cldr_plurals_LDADD = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
34+ sed -i -e "s/\(libgettextsrc_la_LDFLAGS = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
4135 '';
4236
4337 # On cross building, gettext supposes that the wchar.h from libc
@@ -49,11 +43,9 @@ stdenv.mkDerivation rec {
4943 echo gl_cv_func_wcwidth_works=yes > cachefile
5044 configureFlags="$configureFlags --cache-file=`pwd`/cachefile"
5145 fi
52− '' + lib.optionalString stdenv.isCygwin ''
53− sed -i -e "s/\(am_libgettextlib_la_OBJECTS = \)error.lo/\\1/" gettext-tools/gnulib-lib/Makefile.in
5446 '';
5547
56− nativeBuildInputs = [ xz xz.bin ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv; # HACK, see #10874 (and 14664)
48+ nativeBuildInputs = [ xz xz.bin ] ++ stdenv.lib.optional (!stdenv.isLinux && !hostPlatform.isCygwin) libiconv; # HACK, see #10874 (and 14664)
5749
5850 enableParallelBuilding = true;
5951
@@ -89,14 +81,3 @@ stdenv.mkDerivation rec {
8981// stdenv.lib.optionalAttrs stdenv.isDarwin {
9082 makeFlags = "CFLAGS=-D_FORTIFY_SOURCE=0";
9183}
92−
93−// stdenv.lib.optionalAttrs stdenv.isCygwin {
94− patchPhase =
95− # Make sure `error.c' gets compiled and is part of `libgettextlib.la'.
96− # This fixes:
97− # gettext-0.18.1.1/gettext-tools/src/msgcmp.c:371: undefined reference to `_error_message_count'
98− ''
99− sed -i gettext-tools/gnulib-lib/Makefile.in \
100− -e 's/am_libgettextlib_la_OBJECTS =/am_libgettextlib_la_OBJECTS = error.lo/g'
101− '';
102−}