2021-01-15 09:19:50 +00:00
|
|
|
{lib, stdenv, fetchurl}:
|
2014-08-14 14:59:22 +01:00
|
|
|
|
|
|
|
let
|
2018-08-20 20:11:29 +01:00
|
|
|
folder = if stdenv.hostPlatform.system == "i686-linux" then "i686"
|
|
|
|
else if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64"
|
|
|
|
else throw "Unsupported system: ${stdenv.hostPlatform.system}";
|
2014-08-14 14:59:22 +01:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2019-04-08 11:25:53 +01:00
|
|
|
name = "pngout-20150319";
|
2014-08-14 14:59:22 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-04-01 02:11:51 +01:00
|
|
|
url = "http://static.jonof.id.au/dl/kenutils/pngout-20150319-linux.tar.gz";
|
2019-04-08 11:25:53 +01:00
|
|
|
sha256 = "0iwv941hgs2g7ljpx48fxs24a70m2whrwarkrb77jkfcd309x2h7";
|
2014-08-14 14:59:22 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp ${folder}/pngout $out/bin
|
2021-01-15 09:19:50 +00:00
|
|
|
|
2018-08-20 20:11:29 +01:00
|
|
|
${if stdenv.hostPlatform.system == "i686-linux" then ''
|
2015-04-26 18:54:51 +01:00
|
|
|
patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux.so.2 $out/bin/pngout
|
2018-08-20 20:11:29 +01:00
|
|
|
'' else if stdenv.hostPlatform.system == "x86_64-linux" then ''
|
2015-04-26 18:54:51 +01:00
|
|
|
patchelf --set-interpreter ${stdenv.glibc.out}/lib/ld-linux-x86-64.so.2 $out/bin/pngout
|
2014-08-14 14:59:22 +01:00
|
|
|
'' else ""}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2014-12-30 02:31:03 +00:00
|
|
|
description = "A tool that aggressively optimizes the sizes of PNG images";
|
2021-01-15 09:19:50 +00:00
|
|
|
license = lib.licenses.unfree;
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://advsys.net/ken/utils.htm";
|
2021-01-15 09:19:50 +00:00
|
|
|
maintainers = [ lib.maintainers.sander ];
|
2014-08-14 14:59:22 +01:00
|
|
|
};
|
|
|
|
}
|