From 3c57f1fd8a53e532d505461e740bbef5e4c960bc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 27 Jul 2010 11:37:29 +0000 Subject: [PATCH] * Fix zlib 1.2.5 on Cygwin. (The Makefile doesn't support building just a static library.) svn path=/nixpkgs/trunk/; revision=22748 --- pkgs/development/libraries/zlib/default.nix | 7 +++++-- pkgs/development/libraries/zlib/no-shared.patch | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/libraries/zlib/no-shared.patch diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix index df834f9f8858..a4a91960c0bc 100644 --- a/pkgs/development/libraries/zlib/default.nix +++ b/pkgs/development/libraries/zlib/default.nix @@ -1,6 +1,6 @@ {stdenv, fetchurl, static ? false}: -stdenv.mkDerivation rec { +stdenv.mkDerivation (rec { name = "zlib-1.2.5"; src = fetchurl { @@ -23,4 +23,7 @@ stdenv.mkDerivation rec { # zlib doesn't like the automatic --disable-shared from the Cygwin stdenv. cygwinConfigureEnableShared = true; -} + +} // stdenv.lib.optionalAttrs (stdenv.system == "i686-cygwin") { + patches = [ ./no-shared.patch ]; +}) diff --git a/pkgs/development/libraries/zlib/no-shared.patch b/pkgs/development/libraries/zlib/no-shared.patch new file mode 100644 index 000000000000..e26449ffd9f0 --- /dev/null +++ b/pkgs/development/libraries/zlib/no-shared.patch @@ -0,0 +1,14 @@ +Support building the static library only. + +diff -ru -x '*~' zlib-1.2.5-orig/Makefile.in zlib-1.2.5/Makefile.in +--- zlib-1.2.5-orig/Makefile.in 2010-04-20 06:12:21.000000000 +0200 ++++ zlib-1.2.5/Makefile.in 2010-07-27 13:25:02.176322291 +0200 +@@ -168,7 +168,7 @@ + -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi + -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi + cp $(STATICLIB) $(DESTDIR)$(libdir) +- cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir) ++ test -z "$(SHAREDLIBV)" || cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir) + cd $(DESTDIR)$(libdir); chmod u=rw,go=r $(STATICLIB) + -@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 + -@cd $(DESTDIR)$(sharedlibdir); if test "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \