Merge pull request 'disable oxipng' (#316) from disable-oxipng into main
Reviewed-on: #316
This commit is contained in:
commit
291086859d
4 changed files with 4 additions and 10 deletions
|
@ -4,7 +4,6 @@
|
||||||
imagemagick,
|
imagemagick,
|
||||||
lib,
|
lib,
|
||||||
callPackage,
|
callPackage,
|
||||||
oxipng,
|
|
||||||
pngquant,
|
pngquant,
|
||||||
}: let
|
}: let
|
||||||
source = builtins.fromJSON (builtins.readFile ./source.json);
|
source = builtins.fromJSON (builtins.readFile ./source.json);
|
||||||
|
@ -19,7 +18,6 @@ in
|
||||||
};
|
};
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
imagemagick
|
imagemagick
|
||||||
oxipng
|
|
||||||
pngquant
|
pngquant
|
||||||
];
|
];
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
stdenvNoCC,
|
stdenvNoCC,
|
||||||
oxipng,
|
|
||||||
pngquant,
|
pngquant,
|
||||||
}: {
|
}: {
|
||||||
name,
|
name,
|
||||||
|
@ -10,7 +9,7 @@
|
||||||
stdenvNoCC.mkDerivation {
|
stdenvNoCC.mkDerivation {
|
||||||
dontUnpack = true;
|
dontUnpack = true;
|
||||||
inherit (args) name src maxsize;
|
inherit (args) name src maxsize;
|
||||||
nativeBuildInputs = [oxipng pngquant];
|
nativeBuildInputs = [pngquant];
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
${./crushpng.sh} $src $out $maxsize
|
${./crushpng.sh} $src $out $maxsize
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -2,11 +2,10 @@
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
oxipng -o 4 --strip safe -Z $1 --out $2
|
[ "$(wc -c $1 | awk '{print $1}')" -le $3 ] && exit 0
|
||||||
[ "$(wc -c $2 | awk '{print $1}')" -le $3 ] && exit 0
|
|
||||||
|
|
||||||
for i in $(seq 100 -1 0); do
|
for i in $(seq 100 -1 0); do
|
||||||
cat $1 | pngquant --quality 0-$i - | oxipng -o 4 --strip safe -Z - --out $2
|
cat $1 | pngquant --quality 0-$i - > $2
|
||||||
[ "$(wc -c $2 | awk '{print $1}')" -le $3 ] && exit 0
|
[ "$(wc -c $2 | awk '{print $1}')" -le $3 ] && exit 0
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
stdenv,
|
stdenv,
|
||||||
fetchurl,
|
fetchurl,
|
||||||
oxipng,
|
|
||||||
pngquant,
|
pngquant,
|
||||||
lib,
|
lib,
|
||||||
libarchive,
|
libarchive,
|
||||||
|
@ -24,7 +23,6 @@ in
|
||||||
stdenv.mkDerivation ({
|
stdenv.mkDerivation ({
|
||||||
inherit name src;
|
inherit name src;
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
oxipng
|
|
||||||
pngquant
|
pngquant
|
||||||
libarchive
|
libarchive
|
||||||
];
|
];
|
||||||
|
@ -41,7 +39,7 @@ in
|
||||||
mkdir $out
|
mkdir $out
|
||||||
cp -r *.png $out
|
cp -r *.png $out
|
||||||
'';
|
'';
|
||||||
meta = with lib; {
|
meta = {
|
||||||
inherit (manifestData) description homepage;
|
inherit (manifestData) description homepage;
|
||||||
license = fixLicense manifestData.license;
|
license = fixLicense manifestData.license;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue