nixpkgs/pkgs/tools/graphics/pngquant
6t8k ef0b88ac3c
pngquant: 2.17.0 -> 3.0.3
https://github.com/kornelski/pngquant/blob/3.0.3/CHANGELOG

Since 3.0.0, pngquant uses libimagequant 4.x, which is a Rust rewrite,
and and switches the build system from make to Cargo. The `pngquant`
executable is now a Rust wrapper around `pngquant.c`, which in turn
interfaces with libimagequant via the `imagequant_sys` crate, which
exports a C API.[1] The CLI seems unchanged.

Upstream lacks a Cargo.lock[2], so I generated one and patched it in.

Set `doCheck = false;` as there are no Rust-based tests. `test/` was
previously part of the make-based workflow (which is gone with pngquant
3.x) and looks like it isn't meant for pngquant 3.x anyway (as `test.sh`
executes `$BIN --version 2>&1 | fgrep 2.`).

`$ nix build .#pkgsCross.raspberryPi.pngquant` succeeds[3]; remove the
workaround originally introduced in [4].

Notes on dependencies:

- While nixpkgs package libimagequant on its own, pngquant depends on a
  specific vendored version

- pngquant 3.x depends on the libpng-sys and lcms2-sys crates, which
  provide bindings to the respective C libraries. If those are not
  provided by the system at build time, vendored versions of them will
  be built and statically linked; libpng 1.6.37 and LCMS 2.15,
  respectively

[1] See also: https://github.com/kornelski/pngquant/issues/368#issuecomment-1542507114
[2] See also: https://github.com/kornelski/pngquant/issues/347
[3] New SSE flag decision logic: https://github.com/kornelski/pngquant/blob/3.0.3/rust/build.rs#L31
[4] https://github.com/NixOS/nixpkgs/pull/145672
2023-11-17 00:51:57 +01:00
..
add-Cargo.lock.patch pngquant: 2.17.0 -> 3.0.3 2023-11-17 00:51:57 +01:00
default.nix pngquant: 2.17.0 -> 3.0.3 2023-11-17 00:51:57 +01:00