Use crushpng for mkPleromaEmoji

This commit is contained in:
Charlotte 🦝 Delenk 2022-11-21 11:01:19 +01:00
parent 2752fee519
commit 30c3c69f38
Signed by: darkkirb
GPG key ID: AB2BD8DAF2E37122

View file

@ -2,6 +2,7 @@
stdenv,
fetchurl,
oxipng,
pngquant,
lib,
libarchive,
}: {
@ -24,17 +25,21 @@ in
inherit name src;
nativeBuildInputs = [
oxipng
pngquant
libarchive
];
unpackPhase = ''
bsdtar -xf $src
'';
buildPhase = ''
find . -type f -name '*.png' -execdir oxipng -o max -t $NIX_BUILD_CORES {} \;
find . -type f -name '*.png' -execdir ${./crushpng.sh} {} {}.new 40000 \;
for f in $(find . -type f -name '*.new'); do
mv $f ${"$"}{f%.new}
done
'';
installPhase = ''
mkdir $out
cp -r * $out
cp -r *.png $out
'';
meta = with lib; {
inherit (manifestData) description homepage;