nixpkgs/pkgs/tools/graphics/pngcrush/default.nix
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00

34 lines
980 B
Nix

{ lib, stdenv, fetchurl, fetchpatch2, libpng }:
stdenv.mkDerivation rec {
pname = "pngcrush";
version = "1.8.13";
src = fetchurl {
url = "mirror://sourceforge/pmt/pngcrush-${version}-nolib.tar.xz";
sha256 = "0l43c59d6v9l0g07z3q3ywhb8xb3vz74llv3mna0izk9bj6aqkiv";
};
patches = [
(fetchpatch2 {
url = "https://salsa.debian.org/debian/pngcrush/-/raw/b4856b56fbc28252103cc14d156baddd564ca880/debian/patches/ignore_PNG_IGNORE_ADLER32.patch";
hash = "sha256-pFON/NUJiXMe9GETptgNltWa0izlby6P/fLsG1abz3g=";
})
];
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "LD=${stdenv.cc.targetPrefix}cc" ]; # gcc and/or clang compat
configurePhase = ''
sed -i s,/usr,$out, Makefile
'';
buildInputs = [ libpng ];
meta = {
homepage = "http://pmt.sourceforge.net/pngcrush";
description = "PNG optimizer";
license = lib.licenses.free;
platforms = with lib.platforms; linux ++ darwin;
mainProgram = "pngcrush";
};
}