nixpkgs/pkgs/development/libraries/zlib/default.nix
Lluís Batlle i Rossell ca5d91aa60 Made more libraries cross compile. fontconfig, libxcb, bzip2, libdrm, zlib...
I was trying to cross compile SDL. Many dependencies work, but I ended seeing
libX11 not ready for cross compilation. Other xorg libraries cross-compile
well. libX11 may need a small patch. The problem is the usual "configure test
cannot be run in cross compilation", so the configure script halts.

I made the pkgconfig expression always return buildDrv, as I think it rarely
will be needed as buildInput. So to avoid rewriting all its mentions to use
it as buildNativeInput, I prefered this small change.


svn path=/nixpkgs/branches/stdenv-updates/; revision=18500
2009-11-21 10:44:22 +00:00

21 lines
534 B
Nix

{stdenv, fetchurl, static ? false}:
stdenv.mkDerivation {
name = "zlib-1.2.3";
src = fetchurl {
url = http://www.zlib.net/zlib-1.2.3.tar.gz;
md5 = "debc62758716a169df9f62e6ab2bc634";
};
configureFlags = if static then "" else "--shared";
preConfigure = ''
if test -n "$crossConfig"; then
export CC=$crossConfig-gcc
configureFlags=${if static then "" else "--shared"}
fi
'';
# zlib doesn't like the automatic --disable-shared from the Cygwin stdenv.
cygwinConfigureEnableShared = true;
}