lol
at v206 38 lines 1.0 kB view raw
1{ stdenv, fetchurl, libpng, static ? false }: 2 3# This package comes with its own copy of zlib, libpng and pngxtern 4 5with stdenv.lib; 6 7stdenv.mkDerivation rec { 8 name = "optipng-0.7.5"; 9 10 src = fetchurl { 11 url = "mirror://sourceforge/optipng/${name}.tar.gz"; 12 sha256 = "17b197437z5wn29llpwklk7ihgx8bhc913gvjf4zyb81idwlprbl"; 13 }; 14 15 buildInputs = [ libpng ]; 16 17 LDFLAGS = optional static "-static"; 18 configureFlags = "--with-system-zlib --with-system-libpng"; 19 20 crossAttrs = { 21 CC="${stdenv.cross.config}-gcc"; 22 LD="${stdenv.cross.config}-gcc"; 23 AR="${stdenv.cross.config}-ar"; 24 RANLIB="${stdenv.cross.config}-ranlib"; 25 configurePhase = '' 26 ./configure -prefix="$out" --with-system-zlib --with-system-libpng 27 ''; 28 postInstall = optional (stdenv.cross.libc == "msvcrt") '' 29 mv "$out"/bin/optipng "$out"/bin/optipng.exe 30 ''; 31 }; 32 33 meta = with stdenv.lib; { 34 homepage = http://optipng.sourceforge.net/; 35 description = "A PNG optimizer"; 36 license = licenses.zlib; 37 }; 38}