2013-06-26 09:54:06 +01:00
|
|
|
{ stdenv, fetchurl, zlib, apngSupport ? false}:
|
2011-09-20 00:05:02 +01:00
|
|
|
|
|
|
|
assert zlib != null;
|
2003-11-06 15:24:19 +00:00
|
|
|
|
2013-06-26 09:54:06 +01:00
|
|
|
let whenPatched = stdenv.lib.optionalString apngSupport;
|
|
|
|
version = "1.6.2";
|
|
|
|
patch_src = fetchurl {
|
|
|
|
url = "mirror://sourceforge/libpng-apng/libpng-${version}-apng.patch.gz";
|
|
|
|
sha256 = "0fy7p197ilr9phwqqk9h91s1mc28r6gj0w2ilrw5liagi71z75j1";
|
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation (rec {
|
|
|
|
name = "libpng" + whenPatched "-apng" + "-${version}";
|
2011-10-05 09:13:16 +01:00
|
|
|
|
2003-11-06 15:24:19 +00:00
|
|
|
src = fetchurl {
|
2013-06-26 09:54:06 +01:00
|
|
|
url = "mirror://sourceforge/libpng/libpng-${version}.tar.xz";
|
2013-04-25 20:14:40 +01:00
|
|
|
sha256 = "1pljkqjqgyz8c32w8fipd9f0v2gcyhah2ypp0h7ya1r1q85sk5qw";
|
2003-11-06 15:24:19 +00:00
|
|
|
};
|
2011-10-05 09:13:16 +01:00
|
|
|
|
2010-07-18 22:54:42 +01:00
|
|
|
propagatedBuildInputs = [ zlib ];
|
2010-07-19 23:24:26 +01:00
|
|
|
|
2013-02-14 19:53:46 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2010-07-19 23:24:26 +01:00
|
|
|
passthru = { inherit zlib; };
|
2011-10-05 09:13:16 +01:00
|
|
|
|
2008-03-06 16:22:41 +00:00
|
|
|
meta = {
|
2013-06-26 09:54:06 +01:00
|
|
|
description = "The official reference implementation for the PNG file format" + whenPatched " with animation patch";
|
2008-03-06 16:22:41 +00:00
|
|
|
homepage = http://www.libpng.org/pub/png/libpng.html;
|
2009-10-29 14:19:39 +00:00
|
|
|
license = "free-non-copyleft"; # http://www.libpng.org/pub/png/src/libpng-LICENSE.txt
|
2013-06-18 21:02:52 +01:00
|
|
|
platforms = stdenv.lib.platforms.all;
|
2008-03-06 16:22:41 +00:00
|
|
|
};
|
2013-06-26 09:54:06 +01:00
|
|
|
} // stdenv.lib.optionalAttrs apngSupport {
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
gunzip < ${patch_src} | patch -Np1
|
|
|
|
'';
|
|
|
|
|
|
|
|
})
|