1 { lib, rustPlatform, fetchFromGitHub, pkg-config, libpng, zlib, lcms2 }:
3 rustPlatform.buildRustPackage rec {
7 outputs = [ "out" "man" ];
9 src = fetchFromGitHub {
13 hash = "sha256-u2zEp9Llo+c/+1QGW4V4r40KQn/ATHCTEsrpy7bRf/I=";
14 fetchSubmodules = true;
17 cargoHash = "sha256-mZpg6BRpsvEiMsS6ZJzVYg6wXHLb3Cf72sK1yzTF8y4=";
19 # https://github.com/kornelski/pngquant/issues/347
20 ./add-Cargo.lock.patch
23 nativeBuildInputs = [ pkg-config ];
24 buildInputs = [ libpng zlib lcms2 ];
26 doCheck = false; # Has no Rust-based tests
29 install -Dpm0444 pngquant.1 $man/share/man/man1/pngquant.1
33 homepage = "https://pngquant.org/";
34 description = "Tool to convert 24/32-bit RGBA PNGs to 8-bit palette with alpha channel preserved";
35 changelog = "https://github.com/kornelski/pngquant/raw/${version}/CHANGELOG";
36 platforms = platforms.unix;
37 license = with licenses; [ gpl3Plus hpnd bsd2 ];
38 mainProgram = "pngquant";