Merge pull request #6394 from codyopel/libwebp
libwebp: refactor & 0.4.1 -> 0.4.2
This commit is contained in:
commit
6be3ffb0d4
@ -1,26 +1,67 @@
|
|||||||
{ stdenv, fetchurl, libpng, libjpeg, giflib, libtiff }:
|
{ 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
|
||||||
|
}:
|
||||||
|
|
||||||
|
assert openglSupport -> ((freeglut != null) && (mesa != null));
|
||||||
|
assert pngSupport -> (libpng != null);
|
||||||
|
assert jpegSupport -> (libjpeg != null);
|
||||||
|
assert tiffSupport -> (libtiff != null);
|
||||||
|
assert gifSupport -> (giflib != null);
|
||||||
|
|
||||||
|
let
|
||||||
|
mkFlag = optSet: flag: if optSet then "--enable-${flag}" else "--disable-${flag}";
|
||||||
|
in
|
||||||
|
|
||||||
|
with stdenv.lib;
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "libwebp-0.4.1";
|
name = "libwebp-${version}";
|
||||||
|
version = "0.4.2";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://downloads.webmproject.org/releases/webp/${name}.tar.gz";
|
url = "http://downloads.webmproject.org/releases/webp/${name}.tar.gz";
|
||||||
sha256 = "09yhfhb90hlhr0vq8ajnpk9rxvmb1bkiywcqm7xahl35yvk4ddh0";
|
sha256 = "0bbjl5spgq7jq7ms5q0scxg5hmg4dd386syb3di4jzggqbbjbn0l";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ libpng libjpeg giflib libtiff ];
|
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--enable-libwebpmux"
|
(mkFlag threadingSupport "threading")
|
||||||
"--enable-libwebpdemux"
|
(mkFlag openglSupport "gl")
|
||||||
"--enable-libwebpdecoder"
|
(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")
|
||||||
];
|
];
|
||||||
|
|
||||||
meta = {
|
buildInputs = [ ]
|
||||||
homepage = http://code.google.com/p/webp/;
|
++ optionals openglSupport [ freeglut mesa ]
|
||||||
description = "Tools and library for the WebP image format";
|
++ optional pngSupport libpng
|
||||||
|
++ optional jpegSupport libjpeg
|
||||||
|
++ optional tiffSupport libtiff
|
||||||
|
++ optional gifSupport giflib;
|
||||||
|
|
||||||
/* It has its own licence, google-related, but that looks like BSD */
|
meta = {
|
||||||
license = stdenv.lib.licenses.free;
|
description = "Tools and library for the WebP image format";
|
||||||
|
homepage = https://developers.google.com/speed/webp/;
|
||||||
|
license = licenses.bsd3;
|
||||||
|
platforms = platforms.all;
|
||||||
|
maintainers = with maintainers; [ codyopel ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user