python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / applications / graphics / image_optim / default.nix
bloba7ae37dbc0c4188d785cb80e14b397c6c5de3e35
1 { lib, bundlerApp, bundlerUpdateScript, makeWrapper,
2   withPngcrush ? true,       pngcrush,
3   withPngout ? true,         pngout,
4   withAdvpng ? true,         advancecomp,
5   withOptipng ? true,        optipng,
6   withPngquant ? true,       pngquant,
7   withJhead ? true,          jhead,
8   withJpegoptim ? true,      jpegoptim,
9   withJpegrecompress ? true, jpeg-archive,
10   withJpegtran ? true,       libjpeg,
11   withGifsicle ? true,       gifsicle,
12   withSvgo ? true,           svgo
15 with lib;
17 let
18   optionalDepsPath = []
19     ++ optional withPngcrush pngcrush
20     ++ optional withPngout pngout
21     ++ optional withAdvpng advancecomp
22     ++ optional withOptipng optipng
23     ++ optional withPngquant pngquant
24     ++ optional withJhead jhead
25     ++ optional withJpegoptim jpegoptim
26     ++ optional withJpegrecompress jpeg-archive
27     ++ optional withJpegtran libjpeg
28     ++ optional withGifsicle gifsicle
29     ++ optional withSvgo svgo;
32 bundlerApp {
33   pname = "image_optim";
34   gemdir = ./.;
36   exes = [ "image_optim" ];
38   nativeBuildInputs = [ makeWrapper ];
40   postBuild = ''
41     wrapProgram $out/bin/image_optim \
42       --prefix PATH : ${lib.escapeShellArg (makeBinPath optionalDepsPath)}
43   '';
45   passthru.updateScript = bundlerUpdateScript "image_optim";
47   meta = with lib; {
48     description = "Command line tool and ruby interface to optimize (lossless compress, optionally lossy) jpeg, png, gif and svg images using external utilities (advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegrescan, jpegtran, optipng, pngcrush, pngout, pngquant, svgo)";
49     homepage    = "https://github.com/toy/image_optim";
50     license     = licenses.mit;
51     maintainers = with maintainers; [ srghma nicknovitski ];
52     platforms   = platforms.all;
53   };