2024-01-13 08:15:51 +00:00
|
|
|
{ lib, rustPlatform, fetchFromGitHub, pkg-config, libpng, zlib, lcms2 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "pngquant";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "3.0.3";
|
|
|
|
|
|
|
|
outputs = [ "out" "man" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-05-03 20:48:10 +00:00
|
|
|
owner = "kornelski";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "pngquant";
|
|
|
|
rev = version;
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-u2zEp9Llo+c/+1QGW4V4r40KQn/ATHCTEsrpy7bRf/I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
cargoHash = "sha256-mZpg6BRpsvEiMsS6ZJzVYg6wXHLb3Cf72sK1yzTF8y4=";
|
|
|
|
cargoPatches = [
|
|
|
|
# https://github.com/kornelski/pngquant/issues/347
|
|
|
|
./add-Cargo.lock.patch
|
|
|
|
];
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ libpng zlib lcms2 ];
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
doCheck = false; # Has no Rust-based tests
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
install -Dpm0444 pngquant.1 $man/share/man/man1/pngquant.1
|
|
|
|
'';
|
2021-05-03 20:48:10 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://pngquant.org/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Tool to convert 24/32-bit RGBA PNGs to 8-bit palette with alpha channel preserved";
|
2021-05-03 20:48:10 +00:00
|
|
|
changelog = "https://github.com/kornelski/pngquant/raw/${version}/CHANGELOG";
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
2021-05-03 20:48:10 +00:00
|
|
|
license = with licenses; [ gpl3Plus hpnd bsd2 ];
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "pngquant";
|
2023-11-16 04:20:00 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|