ncurses: refactor

Also, change the unicode option to a better name: unicodeSupport. This change
affects dialog too.
main
AndersonTorres 2 years ago
parent 6a25262952
commit d344124d64
  1. 59
      pkgs/development/libraries/ncurses/default.nix
  2. 2
      pkgs/tools/misc/dialog/default.nix

@ -1,15 +1,13 @@
{ lib, stdenv, fetchurl, pkg-config
{ lib
, stdenv
, fetchurl
, buildPackages
, pkg-config
, abiVersion ? "6"
, mouseSupport ? false
, unicode ? true
, enableStatic ? stdenv.hostPlatform.isStatic
, enableShared ? !enableStatic
, withCxx ? !stdenv.hostPlatform.useAndroidPrebuilt
, gpm
, buildPackages
, mouseSupport ? false, gpm
, unicodeSupport ? true
}:
stdenv.mkDerivation rec {
@ -31,13 +29,13 @@ stdenv.mkDerivation rec {
setOutputFlags = false; # some aren't supported
configureFlags = [
(lib.withFeature enableShared "shared")
(lib.withFeature (!enableStatic) "shared")
"--without-debug"
"--enable-pc-files"
"--enable-symlinks"
"--with-manpage-format=normal"
"--disable-stripping"
] ++ lib.optional unicode "--enable-widec"
] ++ lib.optional unicodeSupport "--enable-widec"
++ lib.optional (!withCxx) "--without-cxx"
++ lib.optional (abiVersion == "5") "--with-abi-version=5"
++ lib.optional stdenv.hostPlatform.isNetBSD "--enable-rpath"
@ -49,12 +47,16 @@ stdenv.mkDerivation rec {
# Only the C compiler, and explicitly not C++ compiler needs this flag on solaris:
CFLAGS = lib.optionalString stdenv.isSunOS "-D_XOPEN_SOURCE_EXTENDED";
depsBuildBuild = [ buildPackages.stdenv.cc ];
depsBuildBuild = [
buildPackages.stdenv.cc
];
nativeBuildInputs = [
pkg-config
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
buildPackages.ncurses
];
buildInputs = lib.optional (mouseSupport && stdenv.isLinux) gpm;
preConfigure = ''
@ -147,31 +149,26 @@ stdenv.mkDerivation rec {
rm "$out"/lib/*.a
'';
meta = {
meta = with lib; {
homepage = "https://www.gnu.org/software/ncurses/";
description = "Free software emulation of curses in SVR4 and more";
longDescription = ''
The Ncurses (new curses) library is a free software emulation of
curses in System V Release 4.0, and more. It uses Terminfo
format, supports pads and color and multiple highlights and
forms characters and function-key mapping, and has all the other
SYSV-curses enhancements over BSD Curses.
The ncurses code was developed under GNU/Linux. It has been in
use for some time with OpenBSD as the system curses library, and
on FreeBSD and NetBSD as an external package. It should port
easily to any ANSI/POSIX-conforming UNIX. It has even been
ported to OS/2 Warp!
The Ncurses (new curses) library is a free software emulation of curses in
System V Release 4.0, and more. It uses Terminfo format, supports pads and
color and multiple highlights and forms characters and function-key
mapping, and has all the other SYSV-curses enhancements over BSD Curses.
The ncurses code was developed under GNU/Linux. It has been in use for
some time with OpenBSD as the system curses library, and on FreeBSD and
NetBSD as an external package. It should port easily to any
ANSI/POSIX-conforming UNIX. It has even been ported to OS/2 Warp!
'';
homepage = "https://www.gnu.org/software/ncurses/";
license = lib.licenses.mit;
platforms = lib.platforms.all;
license = licenses.mit;
platforms = platforms.all;
};
passthru = {
ldflags = "-lncurses";
inherit unicode abiVersion;
inherit unicodeSupport abiVersion;
};
}

@ -8,7 +8,7 @@
}:
assert withLibrary -> libtool != null;
assert unicodeSupport -> ncurses.unicode && ncurses != null;
assert unicodeSupport -> ncurses.unicodeSupport && ncurses != null;
stdenv.mkDerivation rec {
pname = "dialog";

Loading…
Cancel
Save