From 0a7c5e4f686ade2cfac329afdaee5da05a366556 Mon Sep 17 00:00:00 2001 From: Rok Garbas Date: Fri, 5 Jun 2015 10:34:00 +0200 Subject: [PATCH] cygwin: libedit patch for cygwin --- .../libraries/libedit/01-cygwin.patch | 25 +++++++++++++++++++ .../development/libraries/libedit/default.nix | 4 +++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/development/libraries/libedit/01-cygwin.patch diff --git a/pkgs/development/libraries/libedit/01-cygwin.patch b/pkgs/development/libraries/libedit/01-cygwin.patch new file mode 100644 index 00000000000..33bd39ed61e --- /dev/null +++ b/pkgs/development/libraries/libedit/01-cygwin.patch @@ -0,0 +1,25 @@ +--- libedit-20120311-3.0/src/chartype.h 2012-03-11 10:54:58.000000000 +0100 ++++ libedit-20120311-3.0/src/chartype.h 2012-05-03 19:00:20.651847423 +0200 +@@ -56,9 +56,11 @@ + /* Oh for a with char32_t and __STDC_UTF_32__ in it... + * ref: ISO/IEC DTR 19769 + */ ++#ifndef __CYGWIN__ + #if WCHAR_MAX < INT32_MAX + #warning Build environment does not support non-BMP characters + #endif ++#endif + + #ifndef HAVE_WCSDUP + wchar_t *wcsdup(const wchar_t *s); +--- libedit-20120311-3.0/src/editline/readline.h 2011-02-26 23:42:59.000000000 +0100 ++++ libedit-20120311-3.0/src/editline/readline.h 2012-05-03 19:00:49.211244803 +0200 +@@ -75,7 +75,7 @@ typedef KEYMAP_ENTRY *Keymap; + + #ifndef CTRL + #include +-#if !defined(__sun) && !defined(__hpux) && !defined(_AIX) ++#if !defined(__sun) && !defined(__hpux) && !defined(_AIX) && !defined(__CYGWIN__) + #include + #endif + #ifndef CTRL diff --git a/pkgs/development/libraries/libedit/default.nix b/pkgs/development/libraries/libedit/default.nix index 61bb15dde7d..dc2f5842b28 100644 --- a/pkgs/development/libraries/libedit/default.nix +++ b/pkgs/development/libraries/libedit/default.nix @@ -11,6 +11,10 @@ stdenv.mkDerivation rec { # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds. NROFF = "${groff}/bin/nroff"; + patches = if stdenv.isCygwin then [ + ./01-cygwin.patch + ] else null; + postInstall = '' sed -i ${stdenv.lib.optionalString (stdenv.isDarwin && stdenv.cc.nativeTools) "''"} s/-lncurses/-lncursesw/g $out/lib/pkgconfig/libedit.pc '';