nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchFromGitHub, pkg-config, libpng, zlib, lcms2 }:
2
3stdenv.mkDerivation rec {
4 pname = "pngquant";
5 version = "2.17.0";
6
7 src = fetchFromGitHub {
8 owner = "kornelski";
9 repo = "pngquant";
10 rev = version;
11 sha256 = "sha256-D2KNn6AJ4eIHeb/2Oo1Wf0djMCXTtVGrua0D6z7+9V4=";
12 fetchSubmodules = true;
13 };
14
15 preConfigure = "patchShebangs .";
16
17 configureFlags = lib.optionals (!stdenv.hostPlatform.isx86) [ "--disable-sse" ];
18
19 nativeBuildInputs = [ pkg-config ];
20 buildInputs = [ libpng zlib lcms2 ];
21
22 doCheck = true;
23
24 meta = with lib; {
25 homepage = "https://pngquant.org/";
26 description = "A tool to convert 24/32-bit RGBA PNGs to 8-bit palette with alpha channel preserved";
27 changelog = "https://github.com/kornelski/pngquant/raw/${version}/CHANGELOG";
28 platforms = platforms.unix;
29 license = with licenses; [ gpl3Plus hpnd bsd2 ];
30 maintainers = [ maintainers.srapenne ];
31 };
32}