biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / tools / graphics / pngquant / default.nix
blob5a2dd5b3006770ba8c094d1533be9d548d69f7c8
1 { lib, rustPlatform, fetchFromGitHub, pkg-config, libpng, zlib, lcms2 }:
3 rustPlatform.buildRustPackage rec {
4   pname = "pngquant";
5   version = "3.0.3";
7   outputs = [ "out" "man" ];
9   src = fetchFromGitHub {
10     owner = "kornelski";
11     repo = "pngquant";
12     rev = version;
13     hash = "sha256-u2zEp9Llo+c/+1QGW4V4r40KQn/ATHCTEsrpy7bRf/I=";
14     fetchSubmodules = true;
15   };
17   cargoHash = "sha256-mZpg6BRpsvEiMsS6ZJzVYg6wXHLb3Cf72sK1yzTF8y4=";
18   cargoPatches = [
19     # https://github.com/kornelski/pngquant/issues/347
20     ./add-Cargo.lock.patch
21   ];
23   nativeBuildInputs = [ pkg-config ];
24   buildInputs = [ libpng zlib lcms2 ];
26   doCheck = false; # Has no Rust-based tests
28   postInstall = ''
29     install -Dpm0444 pngquant.1 $man/share/man/man1/pngquant.1
30   '';
32   meta = with lib; {
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";
39     maintainers = [ ];
40   };