From 98180e3bb29388508ec1f8a6c2c2f8f4d3c40c8e Mon Sep 17 00:00:00 2001 From: Danny Wilson Date: Sun, 8 Nov 2015 02:47:17 +0100 Subject: Fix ncurses 5.9 build on SmartOS. Has been fixed before, but now includes C++ support. --- pkgs/development/libraries/ncurses/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkgs/development/libraries/ncurses/default.nix') diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index c505d89a6d8f..8817e2c5523b 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -27,12 +27,21 @@ stdenv.mkDerivation rec { "--enable-symlinks" ] ++ lib.optional unicode "--enable-widec"; + # Only the C compiler, and explicitly not C++ compiler needs this flag on solaris: + CFLAGS = lib.optionalString stdenv.isSunOS "-D_XOPEN_SOURCE_EXTENDED"; + buildInputs = lib.optional (mouseSupport && stdenv.isLinux) gpm; preConfigure = '' configureFlagsArray+=("--includedir=$out/include") export PKG_CONFIG_LIBDIR="$out/lib/pkgconfig" mkdir -p "$PKG_CONFIG_LIBDIR" + '' + + lib.optionalString stdenv.isSunOS '' + sed -i -e '/-D__EXTENSIONS__/ s/-D_XOPEN_SOURCE=\$cf_XOPEN_SOURCE//' \ + -e '/CPPFLAGS="$CPPFLAGS/s/ -D_XOPEN_SOURCE_EXTENDED//' \ + configure + CFLAGS=-D_XOPEN_SOURCE_EXTENDED '' + lib.optionalString stdenv.isCygwin '' sed -i -e 's,LIB_SUFFIX="t,LIB_SUFFIX=",' configure ''; -- cgit 1.4.1