summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-08 19:28:24 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-08-08 19:28:24 +0200
commit777617f987c1e3e44f0f399582bc1b2e2f113c42 (patch)
tree4a5796e5602ccd1238e973ce8b14cf1abd738046 /pkgs
parent9226fbf56a28bcc43ceb73773e12fa1e5c3edaa2 (diff)
downloadnixpkgs-777617f987c1e3e44f0f399582bc1b2e2f113c42.tar
nixpkgs-777617f987c1e3e44f0f399582bc1b2e2f113c42.tar.gz
nixpkgs-777617f987c1e3e44f0f399582bc1b2e2f113c42.tar.bz2
nixpkgs-777617f987c1e3e44f0f399582bc1b2e2f113c42.tar.lz
nixpkgs-777617f987c1e3e44f0f399582bc1b2e2f113c42.tar.xz
nixpkgs-777617f987c1e3e44f0f399582bc1b2e2f113c42.tar.zst
nixpkgs-777617f987c1e3e44f0f399582bc1b2e2f113c42.zip
ncurses: Build with standard gcc
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/libraries/ncurses/default.nix28
-rw-r--r--pkgs/top-level/all-packages.nix7
2 files changed, 13 insertions, 22 deletions
diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index 7627fb79e99..87953c1158d 100644
--- a/pkgs/development/libraries/ncurses/default.nix
+++ b/pkgs/development/libraries/ncurses/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, unicode ? true}:
+{ lib, stdenv, fetchurl, unicode ? true }:
 
 let
   /* C++ bindings fail to build on `i386-pc-solaris2.11' with GCC 3.4.3:
@@ -10,7 +10,7 @@ let
      So disable them for now.  */
   cxx = !stdenv.isSunOS;
 in
-stdenv.mkDerivation (rec {
+stdenv.mkDerivation rec {
   name = "ncurses-5.9";
 
   src = fetchurl {
@@ -18,13 +18,7 @@ stdenv.mkDerivation (rec {
     sha256 = "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh";
   };
 
-  clangPatch = fetchurl {
-    # Patch referenced from https://github.com/Homebrew/homebrew-dupes/issues/43
-    url = "http://lists.gnu.org/archive/html/bug-ncurses/2011-04/txtkWQqiQvcZe.txt";
-    sha256 = "03lrwqvb0r2qgi8hz7ayd3g26d6xilr3c92j8li3b77kdc0w0rlv";
-  };
-
-  patches = [ ./patch-ac ] ++ stdenv.lib.optional stdenv.isDarwin clangPatch;
+  patches = [ ./patch-ac ];
 
   configureFlags = ''
     --with-shared --without-debug --enable-pc-files --enable-symlinks
@@ -41,6 +35,8 @@ stdenv.mkDerivation (rec {
     export configureFlags="$configureFlags --includedir=$out/include"
     export PKG_CONFIG_LIBDIR="$out/lib/pkgconfig"
     mkdir -p "$PKG_CONFIG_LIBDIR"
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace configure --replace -no-cpp-precomp ""
   '';
 
   selfNativeBuildInput = true;
@@ -50,8 +46,8 @@ stdenv.mkDerivation (rec {
   preBuild =
     # On Darwin, we end up using the native `sed' during bootstrap, and it
     # fails to run this command, which isn't needed anyway.
-    stdenv.lib.optionalString (!stdenv.isDarwin)
-    ''sed -e "s@\([[:space:]]\)sh @\1''${SHELL} @" -i */Makefile Makefile'';
+    lib.optionalString (!stdenv.isDarwin)
+      ''sed -e "s@\([[:space:]]\)sh @\1''${SHELL} @" -i */Makefile Makefile'';
 
   # When building a wide-character (Unicode) build, create backward
   # compatibility links from the the "normal" libraries to the
@@ -71,6 +67,8 @@ stdenv.mkDerivation (rec {
     ln -svf ncursesw5-config $out/bin/ncurses5-config
   '' else "";
 
+  postFixup = lib.optionalString stdenv.isDarwin "rm $out/lib/*.so";
+
   meta = {
     description = "GNU Ncurses, a free software emulation of curses in SVR4 and more";
 
@@ -90,9 +88,9 @@ stdenv.mkDerivation (rec {
 
     homepage = http://www.gnu.org/software/ncurses/;
 
-    license = stdenv.lib.licenses.mit;
+    license = lib.licenses.mit;
 
-    maintainers = [ stdenv.lib.maintainers.ludo ];
-    platforms = stdenv.lib.platforms.all;
+    maintainers = [ lib.maintainers.ludo ];
+    platforms = lib.platforms.all;
   };
-} // ( if stdenv.isDarwin then { postFixup = "rm $out/lib/*.so"; } else { } ) )
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 6af488d5217..3e77a1231bf 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -5754,13 +5754,6 @@ let
 
   ncurses = callPackage ../development/libraries/ncurses {
     unicode = system != "i686-cygwin";
-    stdenv =
-      # On Darwin, NCurses uses `-no-cpp-precomp', which is specific to
-      # Apple-GCC.  Since NCurses is part of stdenv, always use
-      # `stdenvNative' to build it.
-      if stdenv.isDarwin
-      then allStdenvs.stdenvNative
-      else stdenv;
   };
 
   neon = callPackage ../development/libraries/neon {