summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@protonmail.com>2022-01-06 21:54:08 -0300
committerAndersonTorres <torres.anderson.85@protonmail.com>2022-01-07 23:55:41 -0300
commitd344124d64589911a63fb80b662cf68f7b8d069a (patch)
tree8b782f042535a19304fac3a26296c747a99f13ae
parent6a252629526a004d16fa9b81a5cb4b6aaa2afa01 (diff)
downloadnixpkgs-d344124d64589911a63fb80b662cf68f7b8d069a.tar
nixpkgs-d344124d64589911a63fb80b662cf68f7b8d069a.tar.gz
nixpkgs-d344124d64589911a63fb80b662cf68f7b8d069a.tar.bz2
nixpkgs-d344124d64589911a63fb80b662cf68f7b8d069a.tar.lz
nixpkgs-d344124d64589911a63fb80b662cf68f7b8d069a.tar.xz
nixpkgs-d344124d64589911a63fb80b662cf68f7b8d069a.tar.zst
nixpkgs-d344124d64589911a63fb80b662cf68f7b8d069a.zip
ncurses: refactor
Also, change the unicode option to a better name: unicodeSupport. This change
affects dialog too.
-rw-r--r--pkgs/development/libraries/ncurses/default.nix59
-rw-r--r--pkgs/tools/misc/dialog/default.nix2
2 files changed, 29 insertions, 32 deletions
diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index b7ca4df8885..bdce5f48efd 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;
   };
 }
diff --git a/pkgs/tools/misc/dialog/default.nix b/pkgs/tools/misc/dialog/default.nix
index e295f7c27ac..3cbea01be8a 100644
--- a/pkgs/tools/misc/dialog/default.nix
+++ b/pkgs/tools/misc/dialog/default.nix
@@ -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";