2015-02-17 11:05:40 +00:00
|
|
|
{ stdenv, fetchurl
|
|
|
|
, threadingSupport ? true # multi-threading
|
2018-02-24 13:12:44 +00:00
|
|
|
, openglSupport ? false, freeglut ? null, libGLU_combined ? null # OpenGL (required for vwebp)
|
2015-02-17 11:05:40 +00:00
|
|
|
, pngSupport ? true, libpng ? null # PNG image format
|
|
|
|
, jpegSupport ? true, libjpeg ? null # JPEG image format
|
|
|
|
, tiffSupport ? true, libtiff ? null # TIFF image format
|
|
|
|
, gifSupport ? true, giflib ? null # GIF image format
|
|
|
|
#, wicSupport ? true # Windows Imaging Component
|
|
|
|
, alignedSupport ? false # Force aligned memory operations
|
|
|
|
, swap16bitcspSupport ? false # Byte swap for 16bit color spaces
|
|
|
|
, experimentalSupport ? false # Experimental code
|
|
|
|
, libwebpmuxSupport ? true # Build libwebpmux
|
|
|
|
, libwebpdemuxSupport ? true # Build libwebpdemux
|
|
|
|
, libwebpdecoderSupport ? true # Build libwebpdecoder
|
|
|
|
}:
|
2012-02-08 21:37:20 +00:00
|
|
|
|
2018-02-24 13:12:44 +00:00
|
|
|
assert openglSupport -> ((freeglut != null) && (libGLU_combined != null));
|
2015-02-17 11:05:40 +00:00
|
|
|
assert pngSupport -> (libpng != null);
|
|
|
|
assert jpegSupport -> (libjpeg != null);
|
|
|
|
assert tiffSupport -> (libtiff != null);
|
|
|
|
assert gifSupport -> (giflib != null);
|
|
|
|
|
2015-06-01 20:29:47 +01:00
|
|
|
let
|
|
|
|
mkFlag = optSet: flag: if optSet then "--enable-${flag}" else "--disable-${flag}";
|
|
|
|
in
|
|
|
|
|
2015-02-17 11:05:40 +00:00
|
|
|
with stdenv.lib;
|
2012-02-08 21:37:20 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2015-02-17 11:05:40 +00:00
|
|
|
name = "libwebp-${version}";
|
2018-04-24 20:32:19 +01:00
|
|
|
version = "1.0.0";
|
2014-03-17 21:17:16 +00:00
|
|
|
|
2012-02-08 21:37:20 +00:00
|
|
|
src = fetchurl {
|
2014-09-30 20:37:05 +01:00
|
|
|
url = "http://downloads.webmproject.org/releases/webp/${name}.tar.gz";
|
2018-04-24 20:32:19 +01:00
|
|
|
sha256 = "0nr2hd4iv61fphdbx49g96a56jkmdm9n2qss7jpkg1pii11rq9c4";
|
2012-02-08 21:37:20 +00:00
|
|
|
};
|
|
|
|
|
2014-03-18 02:38:06 +00:00
|
|
|
configureFlags = [
|
2015-06-01 20:29:47 +01:00
|
|
|
(mkFlag threadingSupport "threading")
|
|
|
|
(mkFlag openglSupport "gl")
|
|
|
|
(mkFlag pngSupport "png")
|
|
|
|
(mkFlag jpegSupport "jpeg")
|
|
|
|
(mkFlag tiffSupport "tiff")
|
|
|
|
(mkFlag gifSupport "gif")
|
|
|
|
#(mkFlag (wicSupport && stdenv.isCygwin) "wic")
|
|
|
|
(mkFlag alignedSupport "aligned")
|
|
|
|
(mkFlag swap16bitcspSupport "swap-16bit-csp")
|
|
|
|
(mkFlag experimentalSupport "experimental")
|
|
|
|
(mkFlag libwebpmuxSupport "libwebpmux")
|
|
|
|
(mkFlag libwebpdemuxSupport "libwebpdemux")
|
|
|
|
(mkFlag libwebpdecoderSupport "libwebpdecoder")
|
2014-03-18 02:38:06 +00:00
|
|
|
];
|
|
|
|
|
2015-02-17 11:05:40 +00:00
|
|
|
buildInputs = [ ]
|
2018-02-24 13:12:44 +00:00
|
|
|
++ optionals openglSupport [ freeglut libGLU_combined ]
|
2015-02-17 11:05:40 +00:00
|
|
|
++ optional pngSupport libpng
|
|
|
|
++ optional jpegSupport libjpeg
|
|
|
|
++ optional tiffSupport libtiff
|
|
|
|
++ optional gifSupport giflib;
|
|
|
|
|
2012-02-08 21:37:20 +00:00
|
|
|
meta = {
|
|
|
|
description = "Tools and library for the WebP image format";
|
2015-02-17 11:05:40 +00:00
|
|
|
homepage = https://developers.google.com/speed/webp/;
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ codyopel ];
|
2012-02-08 21:37:20 +00:00
|
|
|
};
|
|
|
|
}
|