about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorDanny Wilson <danny@prime.vc>2015-11-08 02:47:17 +0100
committerDanny Wilson <danny@prime.vc>2015-11-16 17:20:17 +0100
commit98180e3bb29388508ec1f8a6c2c2f8f4d3c40c8e (patch)
tree2ebcb6b462c4f7d6a08983d1d1e2dbe605342be8 /pkgs
parentf17dea3b3dcae065c6ddb187111bef2975ad2eba (diff)
downloadnixlib-98180e3bb29388508ec1f8a6c2c2f8f4d3c40c8e.tar
nixlib-98180e3bb29388508ec1f8a6c2c2f8f4d3c40c8e.tar.gz
nixlib-98180e3bb29388508ec1f8a6c2c2f8f4d3c40c8e.tar.bz2
nixlib-98180e3bb29388508ec1f8a6c2c2f8f4d3c40c8e.tar.lz
nixlib-98180e3bb29388508ec1f8a6c2c2f8f4d3c40c8e.tar.xz
nixlib-98180e3bb29388508ec1f8a6c2c2f8f4d3c40c8e.tar.zst
nixlib-98180e3bb29388508ec1f8a6c2c2f8f4d3c40c8e.zip
Fix ncurses 5.9 build on SmartOS.
Has been fixed before, but now includes C++ support.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/libraries/ncurses/default.nix9
1 files changed, 9 insertions, 0 deletions
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
   '';