1 { lib, stdenv, fetchurl, zlib, apngSupport ? true }:
6 patchVersion = "1.6.37";
8 url = "mirror://sourceforge/libpng-apng/libpng-${patchVersion}-apng.patch.gz";
9 sha256 = "1dh0250mw9b2hx7cdmnb2blk7ddl49n6vx8zz7jdmiwxy38v4fw2";
11 whenPatched = lib.optionalString apngSupport;
13 in stdenv.mkDerivation rec {
14 pname = "libpng" + whenPatched "-apng";
18 url = "mirror://sourceforge/libpng/libpng-${version}.tar.xz";
19 sha256 = "1jl8in381z0128vgxnvn33nln6hzckl7l7j9nqvkaf1m9n1p0pjh";
21 postPatch = whenPatched "gunzip < ${patch_src} | patch -Np1";
23 outputs = [ "out" "dev" "man" ];
26 propagatedBuildInputs = [ zlib ];
30 passthru = { inherit zlib; };
33 description = "The official reference implementation for the PNG file format" + whenPatched " with animation patch";
34 homepage = "http://www.libpng.org/pub/png/libpng.html";
35 license = licenses.libpng2;
36 platforms = platforms.all;
37 maintainers = [ maintainers.vcunat ];