Merge pull request #178368 from kilianar/image_optim

This commit is contained in:
Sandro 2023-04-12 00:59:53 +02:00 committed by GitHub
commit 3c5a6e5834
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 18 deletions

View File

@ -1,15 +1,15 @@
GEM
remote: https://rubygems.org/
specs:
exifr (1.3.9)
exifr (1.3.10)
fspath (3.1.2)
image_optim (0.31.1)
image_optim (0.31.3)
exifr (~> 1.2, >= 1.2.2)
fspath (~> 3.0)
image_size (>= 1.5, < 4)
in_threads (~> 1.3)
progress (~> 3.0, >= 3.0.1)
image_size (3.0.2)
image_size (3.2.0)
in_threads (1.6.0)
progress (3.6.0)
@ -20,4 +20,4 @@ DEPENDENCIES
image_optim
BUNDLED WITH
2.3.9
2.4.6

View File

@ -1,9 +1,10 @@
{ lib, bundlerApp, bundlerUpdateScript, makeWrapper,
withPngcrush ? true, pngcrush,
withPngout ? true, pngout,
withPngout ? false, pngout, # disabled by default because it's unfree
withAdvpng ? true, advancecomp,
withOptipng ? true, optipng,
withPngquant ? true, pngquant,
withOxipng ? true, oxipng,
withJhead ? true, jhead,
withJpegoptim ? true, jpegoptim,
withJpegrecompress ? true, jpeg-archive,
@ -15,18 +16,31 @@
with lib;
let
optionalDepsPath = []
++ optional withPngcrush pngcrush
optionalDepsPath = optional withPngcrush pngcrush
++ optional withPngout pngout
++ optional withAdvpng advancecomp
++ optional withOptipng optipng
++ optional withPngquant pngquant
++ optional withOxipng oxipng
++ optional withJhead jhead
++ optional withJpegoptim jpegoptim
++ optional withJpegrecompress jpeg-archive
++ optional withJpegtran libjpeg
++ optional withGifsicle gifsicle
++ optional withSvgo svgo;
disabledWorkersFlags = optional (!withPngcrush) "--no-pngcrush"
++ optional (!withPngout) "--no-pngout"
++ optional (!withAdvpng) "--no-advpng"
++ optional (!withOptipng) "--no-optipng"
++ optional (!withPngquant) "--no-pngquant"
++ optional (!withOxipng) "--no-oxipng"
++ optional (!withJhead) "--no-jhead"
++ optional (!withJpegoptim) "--no-jpegoptim"
++ optional (!withJpegrecompress) "--no-jpegrecompress"
++ optional (!withJpegtran) "--no-jpegtran"
++ optional (!withGifsicle) "--no-gifsicle"
++ optional (!withSvgo) "--no-svgo";
in
bundlerApp {
@ -39,16 +53,23 @@ bundlerApp {
postBuild = ''
wrapProgram $out/bin/image_optim \
--prefix PATH : ${lib.escapeShellArg (makeBinPath optionalDepsPath)}
--prefix PATH : ${lib.escapeShellArg (makeBinPath optionalDepsPath)} \
--add-flags "${lib.concatStringsSep " " disabledWorkersFlags}"
'';
passthru.updateScript = bundlerUpdateScript "image_optim";
meta = with lib; {
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)";
homepage = "https://github.com/toy/image_optim";
license = licenses.mit;
description = "Optimize images using multiple utilities";
longDescription = ''
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, oxipng, pngcrush, pngout, pngquant, svgo)
'';
homepage = "https://github.com/toy/image_optim";
license = licenses.mit;
maintainers = with maintainers; [ srghma nicknovitski ];
platforms = platforms.all;
platforms = platforms.all;
};
}

View File

@ -4,10 +4,10 @@
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "0mylhwmh6n4xihxr9s3zj0lc286f5maxbqd4dgk3paqnd7afz88s";
sha256 = "08fmmswa9fwymwsa2gzlm856ak3y9kjxdzm4zdrcrfyxs2p8yqwc";
type = "gem";
};
version = "1.3.9";
version = "1.3.10";
};
fspath = {
groups = ["default"];
@ -25,20 +25,20 @@
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "1l3n59w1cbvfg2srfa14g3jdqwbkf7l86g4qrgfz3qps7zi0drg7";
sha256 = "02iw1plldayr1l8bdw2gshq0h083h0fxwji1m1nfhzikz917c07p";
type = "gem";
};
version = "0.31.1";
version = "0.31.3";
};
image_size = {
groups = ["default"];
platforms = [];
source = {
remotes = ["https://rubygems.org"];
sha256 = "033k72f8n28psm89wv1qwsrnqyzz57ihyivyi442wha6vr9iyjz3";
sha256 = "10slvvyam8gkdjzlhb3wb21hp46ay18miyh1advwvyny660rmdsb";
type = "gem";
};
version = "3.0.2";
version = "3.2.0";
};
in_threads = {
groups = ["default"];