1 { lib, stdenv, fetchurl, fetchpatch2, libpng }:
3 stdenv.mkDerivation rec {
8 url = "mirror://sourceforge/pmt/pngcrush-${version}-nolib.tar.xz";
9 sha256 = "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv";
14 url = "https://salsa.debian.org/debian/pngcrush/-/raw/b4856b56fbc28252103cc14d156baddd564ca880/debian/patches/ignore_PNG_IGNORE_ADLER32.patch";
15 hash = "sha256-pFON/NUJiXMe9GETptgNltWa0izlby6P/fLsG1abz3g=";
19 makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "LD=${stdenv.cc.targetPrefix}cc" ]; # gcc and/or clang compat
22 sed -i s,/usr,$out, Makefile
25 buildInputs = [ libpng ];
28 homepage = "http://pmt.sourceforge.net/pngcrush";
29 description = "PNG optimizer";
30 license = lib.licenses.free;
31 platforms = with lib.platforms; linux ++ darwin;
32 mainProgram = "pngcrush";