summary refs log tree commit diff
path: root/pkgs/development/libraries/ncurses/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/ncurses/default.nix')
-rw-r--r--pkgs/development/libraries/ncurses/default.nix21
1 files changed, 19 insertions, 2 deletions
diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index 569d7fe2a328..2e5db48b7df3 100644
--- a/pkgs/development/libraries/ncurses/default.nix
+++ b/pkgs/development/libraries/ncurses/default.nix
@@ -8,7 +8,7 @@ let
      <http://mail.python.org/pipermail/python-bugs-list/2006-September/035362.html>,
      but this is left as an exercise to the reader.
      So disable them for now.  */
-  cxx = stdenv.system != "i686-solaris";
+  cxx = !stdenv.isSunOS;
 in
 stdenv.mkDerivation (rec {
   name = "ncurses-5.9";
@@ -18,11 +18,25 @@ stdenv.mkDerivation (rec {
     sha256 = "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh";
   };
 
+  patches = [ ./patch-ac ];
+
   configureFlags = ''
-    --with-shared --includedir=''${out}/include --without-debug
+    --with-shared --without-debug --enable-pc-files
     ${if unicode then "--enable-widec" else ""}${if cxx then "" else "--without-cxx-binding"}
   '';
 
+  # PKG_CONFIG_LIBDIR is where the *.pc files will be installed. If this
+  # directory doesn't exist, the configure script will disable installation of
+  # *.pc files. The configure script usually (on LSB distros) pick $(path of
+  # pkg-config)/../lib/pkgconfig. On NixOS that path doesn't exist and is not
+  # the place we want to put *.pc files from other packages anyway. So we must
+  # tell it explicitly where to install with PKG_CONFIG_LIBDIR.
+  preConfigure = ''
+    export configureFlags="$configureFlags --includedir=$out/include"
+    export PKG_CONFIG_LIBDIR="$out/lib/pkgconfig"
+    mkdir -p "$PKG_CONFIG_LIBDIR"
+  '';
+
   selfNativeBuildInput = true;
 
   enableParallelBuilding = true;
@@ -44,8 +58,11 @@ stdenv.mkDerivation (rec {
         echo "INPUT(-l''${lib}w)" > $out/lib/lib$lib.so
         ln -svf lib''${lib}w.a $out/lib/lib$lib.a
         ln -svf lib''${lib}w.so.5 $out/lib/lib$lib.so.5
+        ln -svf ''${lib}w.pc $out/lib/pkgconfig/$lib.pc
       fi
     done;
+    ln -svf . $out/include/ncursesw
+    ln -svf ncursesw5-config $out/bin/ncurses5-config
   '' else "";
 
   meta = {