nixpkgs/pkgs/development/libraries/libpng/default.nix
Vladimír Čunát bf414c9d4f Merge 'staging' into closure-size
- there were many easy merge conflicts
- cc-wrapper needed nontrivial changes

Many other problems might've been created by interaction of the branches,
but stdenv and a few other packages build fine now.
2015-04-18 11:22:20 +02:00

43 lines
1.2 KiB
Nix

{ stdenv, fetchurl, zlib, apngSupport ? false }:
assert zlib != null;
let
version = "1.6.16";
sha256 = "0q5ygy15jkpqbj5701ywrjzqp4nl5yz3r4g58h2p0kiycggm9xs2";
patch_src = fetchurl {
url = "mirror://sourceforge/libpng-apng/libpng-${version}-apng.patch.gz";
sha256 = "1sf27a5gvwvcm4wsf2pyq87d3g4l2fym8cirq9sli54bi753ikbh";
};
whenPatched = stdenv.lib.optionalString apngSupport;
in stdenv.mkDerivation rec {
name = "libpng" + whenPatched "-apng" + "-${version}";
src = fetchurl {
url = "mirror://sourceforge/libpng/libpng-${version}.tar.xz";
inherit sha256;
};
postPatch = whenPatched "gunzip < ${patch_src} | patch -Np1";
outputs = [ "dev" "out" "man" ];
propagatedBuildInputs = [ zlib ];
preConfigure = "export bin=$dev";
doCheck = true;
postInstall = ''mv "$out/bin" "$dev/bin"'';
passthru = { inherit zlib; };
meta = with stdenv.lib; {
description = "The official reference implementation for the PNG file format" + whenPatched " with animation patch";
homepage = http://www.libpng.org/pub/png/libpng.html;
license = licenses.libpng;
platforms = platforms.all;
maintainers = [ maintainers.vcunat maintainers.fuuzetsu ];
};
}