2015-02-17 11:05:40 +00:00
|
|
|
{ stdenv, fetchurl
|
|
|
|
, threadingSupport ? true # multi-threading
|
|
|
|
, openglSupport ? false, freeglut ? null, mesa ? null # OpenGL (required for vwebp)
|
|
|
|
, 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
|
|
|
|
2015-02-17 11:05:40 +00:00
|
|
|
assert openglSupport -> ((freeglut != null) && (mesa != null));
|
|
|
|
assert pngSupport -> (libpng != null);
|
|
|
|
assert jpegSupport -> (libjpeg != null);
|
|
|
|
assert tiffSupport -> (libtiff != null);
|
|
|
|
assert gifSupport -> (giflib != null);
|
|
|
|
|
|
|
|
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}";
|
2015-03-26 19:36:04 +00:00
|
|
|
version = "0.4.3";
|
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";
|
2015-03-26 19:36:04 +00:00
|
|
|
sha256 = "1i4hfczjm3b1qj1g4cc9hgb69l47f3nkgf6hk7nz4dm9zmc0vgpg";
|
2012-02-08 21:37:20 +00:00
|
|
|
};
|
|
|
|
|
2014-03-18 02:38:06 +00:00
|
|
|
configureFlags = [
|
2015-05-22 21:33:08 +01:00
|
|
|
(mkEnable threadingSupport "threading" null)
|
|
|
|
(mkEnable openglSupport "gl" null)
|
|
|
|
(mkEnable pngSupport "png" null)
|
|
|
|
(mkEnable jpegSupport "jpeg" null)
|
|
|
|
(mkEnable tiffSupport "tiff" null)
|
|
|
|
(mkEnable gifSupport "gif" null)
|
|
|
|
#(mkEnable (wicSupport && stdenv.isCygwin) "wic" null)
|
|
|
|
(mkEnable alignedSupport "aligned" null)
|
|
|
|
(mkEnable swap16bitcspSupport "swap-16bit-csp" null)
|
|
|
|
(mkEnable experimentalSupport "experimental" null)
|
|
|
|
(mkEnable libwebpmuxSupport "libwebpmux" null)
|
|
|
|
(mkEnable libwebpdemuxSupport "libwebpdemux" null)
|
|
|
|
(mkEnable libwebpdecoderSupport "libwebpdecoder" null)
|
2014-03-18 02:38:06 +00:00
|
|
|
];
|
|
|
|
|
2015-02-17 11:05:40 +00:00
|
|
|
buildInputs = [ ]
|
|
|
|
++ optionals openglSupport [ freeglut mesa ]
|
|
|
|
++ 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
|
|
|
};
|
|
|
|
}
|