2024-04-21 15:54:59 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch2, libpng }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2021-08-18 13:19:15 +00:00
|
|
|
pname = "pngcrush";
|
|
|
|
version = "1.8.13";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-08-18 13:19:15 +00:00
|
|
|
url = "mirror://sourceforge/pmt/pngcrush-${version}-nolib.tar.xz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv";
|
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch2 {
|
|
|
|
url = "https://salsa.debian.org/debian/pngcrush/-/raw/b4856b56fbc28252103cc14d156baddd564ca880/debian/patches/ignore_PNG_IGNORE_ADLER32.patch";
|
|
|
|
hash = "sha256-pFON/NUJiXMe9GETptgNltWa0izlby6P/fLsG1abz3g=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-02-19 19:06:45 +00:00
|
|
|
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "LD=${stdenv.cc.targetPrefix}cc" ]; # gcc and/or clang compat
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
sed -i s,/usr,$out, Makefile
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ libpng ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://pmt.sourceforge.net/pngcrush";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "PNG optimizer";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.free;
|
|
|
|
platforms = with lib.platforms; linux ++ darwin;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "pngcrush";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|