@@ -1,15 +1,13 @@
1−{ lib, stdenv, fetchurl, pkg-config
2−
1+{ lib
2+, stdenv
3+, fetchurl
4+, buildPackages
5+, pkg-config
36, abiVersion ? "6"
4−, mouseSupport ? false
5−, unicode ? true
67, enableStatic ? stdenv.hostPlatform.isStatic
7−, enableShared ? !enableStatic
88, withCxx ? !stdenv.hostPlatform.useAndroidPrebuilt
9−
10−, gpm
11−
12−, buildPackages
9+, mouseSupport ? false, gpm
10+, unicodeSupport ? true
1311}:
1412
1513stdenv.mkDerivation rec {
@@ -31,13 +29,13 @@ stdenv.mkDerivation rec {
3129 setOutputFlags = false; # some aren't supported
3230
3331 configureFlags = [
34− (lib.withFeature enableShared "shared")
32+ (lib.withFeature (!enableStatic) "shared")
3533 "--without-debug"
3634 "--enable-pc-files"
3735 "--enable-symlinks"
3836 "--with-manpage-format=normal"
3937 "--disable-stripping"
40− ] ++ lib.optional unicode "--enable-widec"
38+ ] ++ lib.optional unicodeSupport "--enable-widec"
4139 ++ lib.optional (!withCxx) "--without-cxx"
4240 ++ lib.optional (abiVersion == "5") "--with-abi-version=5"
4341 ++ lib.optional stdenv.hostPlatform.isNetBSD "--enable-rpath"
@@ -49,12 +47,16 @@ stdenv.mkDerivation rec {
4947 # Only the C compiler, and explicitly not C++ compiler needs this flag on solaris:
5048 CFLAGS = lib.optionalString stdenv.isSunOS "-D_XOPEN_SOURCE_EXTENDED";
5149
52− depsBuildBuild = [ buildPackages.stdenv.cc ];
50+ depsBuildBuild = [
51+ buildPackages.stdenv.cc
52+ ];
53+
5354 nativeBuildInputs = [
5455 pkg-config
5556 ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
5657 buildPackages.ncurses
5758 ];
59+
5860 buildInputs = lib.optional (mouseSupport && stdenv.isLinux) gpm;
5961
6062 preConfigure = ''
@@ -147,31 +149,26 @@ stdenv.mkDerivation rec {
147149 rm "$out"/lib/*.a
148150 '';
149151
150− meta = {
152+ meta = with lib; {
153+ homepage = "https://www.gnu.org/software/ncurses/";
151154 description = "Free software emulation of curses in SVR4 and more";
152−
153155 longDescription = ''
154− The Ncurses (new curses) library is a free software emulation of
155− curses in System V Release 4.0, and more. It uses Terminfo
156− format, supports pads and color and multiple highlights and
157− forms characters and function-key mapping, and has all the other
158− SYSV-curses enhancements over BSD Curses.
159−
160− The ncurses code was developed under GNU/Linux. It has been in
161− use for some time with OpenBSD as the system curses library, and
162− on FreeBSD and NetBSD as an external package. It should port
163− easily to any ANSI/POSIX-conforming UNIX. It has even been
164− ported to OS/2 Warp!
156+ The Ncurses (new curses) library is a free software emulation of curses in
157+ System V Release 4.0, and more. It uses Terminfo format, supports pads and
158+ color and multiple highlights and forms characters and function-key
159+ mapping, and has all the other SYSV-curses enhancements over BSD Curses.
160+
161+ The ncurses code was developed under GNU/Linux. It has been in use for
162+ some time with OpenBSD as the system curses library, and on FreeBSD and
163+ NetBSD as an external package. It should port easily to any
164+ ANSI/POSIX-conforming UNIX. It has even been ported to OS/2 Warp!
165165 '';
166−
167− homepage = "https://www.gnu.org/software/ncurses/";
168−
169− license = lib.licenses.mit;
170− platforms = lib.platforms.all;
166+ license = licenses.mit;
167+ platforms = platforms.all;
171168 };
172169
173170 passthru = {
174171 ldflags = "-lncurses";
175− inherit unicode abiVersion;
172+ inherit unicodeSupport abiVersion;
176173 };
177174}