Skip to content

Commit

Permalink
pngquant: 2.17.0 -> 3.0.3
Browse files Browse the repository at this point in the history
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: kornelski/pngquant#368 (comment)
[2] See also: kornelski/pngquant#347
[3] New SSE flag decision logic: https://github.com/kornelski/pngquant/blob/3.0.3/rust/build.rs#L31
[4] NixOS#145672
  • Loading branch information
6t8k committed Nov 16, 2023
1 parent c7b67b6 commit ef0b88a
Show file tree
Hide file tree
Showing 2 changed files with 444 additions and 8 deletions.
Loading

0 comments on commit ef0b88a

Please sign in to comment.