From d344124d64589911a63fb80b662cf68f7b8d069a Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Thu, 6 Jan 2022 21:54:08 -0300 Subject: ncurses: refactor Also, change the unicode option to a better name: unicodeSupport. This change affects dialog too. --- pkgs/development/libraries/ncurses/default.nix | 59 ++++++++++++-------------- 1 file changed, 28 insertions(+), 31 deletions(-) (limited to 'pkgs/development') diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index b7ca4df888570..bdce5f48efd70 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/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; }; } -- cgit 1.4.1