From e33f6df6fa148393d0bfbd0f24f7428b461e64c7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 25 Aug 2008 15:29:04 +0000 Subject: [PATCH] * Test whether "libcursesw" actually exists before symlinking to it. (Does it ever exist?) svn path=/nixpkgs/trunk/; revision=12710 --- .../development/libraries/ncurses/default.nix | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index 013094ef64be..1fb6c251e3c3 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -2,19 +2,31 @@ stdenv.mkDerivation { name = "ncurses-5.6"; + src = fetchurl { url = mirror://gnu/ncurses/ncurses-5.6.tar.gz; md5 = "b6593abe1089d6aab1551c105c9300e3"; }; - configureFlags="--with-shared --includedir=\${out}/include"+(if unicode then " --enable-widec " else " ") +" --without-debug"; + + configureFlags = + "--with-shared --includedir=\${out}/include" + + (if unicode then " --enable-widec " else " ") + + " --without-debug"; + preBuild = ''sed -e "s@\([[:space:]]\)sh @\1''${SHELL} @" -i */Makefile Makefile''; - postInstall= if unicode then " + + # When building a wide-character (Unicode) build, create backward + # compatibility links from the the "normal" libraries to the + # wide-character libraries (e.g. libncurses.so to libncursesw.so). + postInstall = if unicode then " chmod -v 644 $out/lib/libncurses++w.a for lib in curses ncurses form panel menu; do - rm -vf $out/lib/lib\${lib}.so - 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 + if test -e $out/lib/lib\${lib}w.a; then + rm -vf $out/lib/lib\${lib}.so + 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 + fi done; " else ""; }