From d2143c73bbc4dc3e34f61f47be417c199bd83c48 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 12 Sep 2014 11:10:02 +0200 Subject: [PATCH] readline-6.3: Fix building on Darwin The zip file contains files named CHANGELOG and ChangeLog, so the build fails on case-insensitive systems with: error: creating file `/nix/store/nix-4888-0/unpacked/ChangeLog': File exists The official tar distribution does not have this problem. --- .../libraries/readline/readline6.3.nix | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/pkgs/development/libraries/readline/readline6.3.nix b/pkgs/development/libraries/readline/readline6.3.nix index 04db1ffd4469..38ecc034d892 100644 --- a/pkgs/development/libraries/readline/readline6.3.nix +++ b/pkgs/development/libraries/readline/readline6.3.nix @@ -1,13 +1,11 @@ -{ fetchzip, stdenv, ncurses }: +{ fetchurl, stdenv, ncurses }: -stdenv.mkDerivation (rec { +stdenv.mkDerivation rec { name = "readline-6.3p08"; - src = fetchzip { - #url = "mirror://gnu/readline/${name}.tar.gz"; - url = "http://git.savannah.gnu.org/cgit/readline.git/snapshot/" - + "readline-a73b98f779b388a5d0624e02e8bb187246e3e396.tar.gz"; - sha256 = "19ji3wrv4fs79fd0nkacjy9q94pvy2cm66yb3aqysahg0cbrz5l1"; + src = fetchurl { + url = "mirror://gnu/readline/readline-6.3.tar.gz"; + sha256 = "0hzxr9jxqqx5sxsv9vmlxdnvlr9vi4ih1avjb869hbs6p5qn1fjn"; }; propagatedBuildInputs = [ncurses]; @@ -17,7 +15,19 @@ stdenv.mkDerivation (rec { patches = [ ./link-against-ncurses.patch ./no-arch_only-6.3.patch - ]; + ] + ++ + (let + patch = nr: sha256: + fetchurl { + url = "mirror://gnu/readline/readline-6.3-patches/readline63-${nr}"; + inherit sha256; + }; + in + import ./readline-6.3-patches.nix patch); + + # Don't run the native `strip' when cross-compiling. + dontStrip = stdenv ? cross; meta = with stdenv.lib; { description = "Library for interactive line editing"; @@ -46,10 +56,3 @@ stdenv.mkDerivation (rec { platforms = platforms.unix; }; } - -// - -# Don't run the native `strip' when cross-compiling. -(if (stdenv ? cross) - then { dontStrip = true; } - else { }))