1 { lib, stdenv, fetchFromGitHub, autoreconfHook, libtool
2 , threadingSupport ? true # multi-threading
3 , openglSupport ? false, freeglut, libGL, libGLU # OpenGL (required for vwebp)
4 , pngSupport ? true, libpng # PNG image format
5 , jpegSupport ? true, libjpeg # JPEG image format
6 , tiffSupport ? true, libtiff # TIFF image format
7 , gifSupport ? true, giflib # GIF image format
8 , alignedSupport ? false # Force aligned memory operations
9 , swap16bitcspSupport ? false # Byte swap for 16bit color spaces
10 , experimentalSupport ? false # Experimental code
11 , libwebpmuxSupport ? true # Build libwebpmux
12 , libwebpdemuxSupport ? true # Build libwebpdemux
13 , libwebpdecoderSupport ? true # Build libwebpdecoder
28 stdenv.mkDerivation rec {
32 src = fetchFromGitHub {
33 owner = "webmproject";
36 hash = "sha256-UYO2Fmm8nzQR8VBC26wEwWd3qZTD+6MHKcmKBoNcpEE=";
40 (lib.enableFeature threadingSupport "threading")
41 (lib.enableFeature openglSupport "gl")
42 (lib.enableFeature pngSupport "png")
43 (lib.enableFeature jpegSupport "jpeg")
44 (lib.enableFeature tiffSupport "tiff")
45 (lib.enableFeature gifSupport "gif")
46 (lib.enableFeature alignedSupport "aligned")
47 (lib.enableFeature swap16bitcspSupport "swap-16bit-csp")
48 (lib.enableFeature experimentalSupport "experimental")
49 (lib.enableFeature libwebpmuxSupport "libwebpmux")
50 (lib.enableFeature libwebpdemuxSupport "libwebpdemux")
51 (lib.enableFeature libwebpdecoderSupport "libwebpdecoder")
54 nativeBuildInputs = [ autoreconfHook libtool ];
56 ++ lib.optionals openglSupport [ freeglut libGL libGLU ]
57 ++ lib.optionals pngSupport [ libpng ]
58 ++ lib.optionals jpegSupport [ libjpeg ]
59 ++ lib.optionals tiffSupport [ libtiff ]
60 ++ lib.optionals gifSupport [ giflib ];
62 enableParallelBuilding = true;
65 inherit freeimage gd graphicsmagick imagemagick imlib2 libjxl opencv vips;
66 inherit (python3.pkgs) pillow imread;
67 haskell-webp = haskellPackages.webp;
71 description = "Tools and library for the WebP image format";
72 homepage = "https://developers.google.com/speed/webp/";
73 license = licenses.bsd3;
74 platforms = platforms.all;
75 maintainers = with maintainers; [ ajs124 ];