
This reverts commit 65a333600d5c88a98d674f637d092807cfc12253. This wasn't tested for correctness with something like fodwatch [0], and should not have been (self-)merged so quickly, especially without further review. It also resulted in the breakage of at least one package [1] (and that's the one we know of and was caught). A few packages that were updated in between this commit and this revert were not reverted back to using `rev`, but other than that, this is a 1:1 revert. [0]: https://codeberg.org/raphaelr/fodwatch [1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e4587d75882aebc21a04bee960418f8ce9
62 lines
1.2 KiB
Nix
62 lines
1.2 KiB
Nix
{
|
|
lib,
|
|
rustPlatform,
|
|
fetchFromGitHub,
|
|
pkg-config,
|
|
libpng,
|
|
zlib,
|
|
lcms2,
|
|
}:
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "pngquant";
|
|
version = "3.0.3";
|
|
|
|
outputs = [
|
|
"out"
|
|
"man"
|
|
];
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "kornelski";
|
|
repo = "pngquant";
|
|
rev = version;
|
|
hash = "sha256-u2zEp9Llo+c/+1QGW4V4r40KQn/ATHCTEsrpy7bRf/I=";
|
|
fetchSubmodules = true;
|
|
};
|
|
|
|
useFetchCargoVendor = true;
|
|
cargoHash = "sha256-W+/y79KkSVHqBybouUazGVfTQAuelXvn6EXtu+TW7j4=";
|
|
cargoPatches = [
|
|
# https://github.com/kornelski/pngquant/issues/347
|
|
./add-Cargo.lock.patch
|
|
];
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
buildInputs = [
|
|
libpng
|
|
zlib
|
|
lcms2
|
|
];
|
|
|
|
doCheck = false; # Has no Rust-based tests
|
|
|
|
postInstall = ''
|
|
install -Dpm0444 pngquant.1 $man/share/man/man1/pngquant.1
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "https://pngquant.org/";
|
|
description = "Tool to convert 24/32-bit RGBA PNGs to 8-bit palette with alpha channel preserved";
|
|
changelog = "https://github.com/kornelski/pngquant/raw/${version}/CHANGELOG";
|
|
platforms = platforms.unix;
|
|
license = with licenses; [
|
|
gpl3Plus
|
|
hpnd
|
|
bsd2
|
|
];
|
|
mainProgram = "pngquant";
|
|
maintainers = [ ];
|
|
};
|
|
}
|