6 threadingSupport ? true, # multi-threading
10 libGLU, # OpenGL (required for vwebp)
12 libpng, # PNG image format
14 libjpeg, # JPEG image format
16 libtiff, # TIFF image format
18 giflib, # GIF image format
19 swap16bitcspSupport ? false, # Byte swap for 16bit color spaces
20 libwebpmuxSupport ? true, # Build libwebpmux
34 stdenv.mkDerivation rec {
38 src = fetchFromGitHub {
39 owner = "webmproject";
42 hash = "sha256-DMHP7DVWXrTsqU0m9tc783E6dNO0EQoSXZTn5kZOtTg=";
46 (lib.cmakeBool "BUILD_SHARED_LIBS" true)
47 (lib.cmakeBool "WEBP_USE_THREAD" threadingSupport)
48 (lib.cmakeBool "WEBP_BUILD_VWEBP" openglSupport)
49 (lib.cmakeBool "WEBP_BUILD_IMG2WEBP" (pngSupport || jpegSupport || tiffSupport))
50 (lib.cmakeBool "WEBP_BUILD_GIF2WEBP" gifSupport)
51 (lib.cmakeBool "WEBP_BUILD_ANIM_UTILS" false) # Not installed
52 (lib.cmakeBool "WEBP_BUILD_EXTRAS" false) # Not installed
53 (lib.cmakeBool "WEBP_ENABLE_SWAP_16BIT_CSP" swap16bitcspSupport)
54 (lib.cmakeBool "WEBP_BUILD_LIBWEBPMUX" libwebpmuxSupport)
57 nativeBuildInputs = [ cmake ];
60 ++ lib.optionals openglSupport [
65 ++ lib.optionals pngSupport [ libpng ]
66 ++ lib.optionals jpegSupport [ libjpeg ]
67 ++ lib.optionals tiffSupport [ libtiff ]
68 ++ lib.optionals gifSupport [ giflib ];
80 inherit (python3.pkgs) pillow imread;
81 haskell-webp = haskellPackages.webp;
85 description = "Tools and library for the WebP image format";
86 homepage = "https://developers.google.com/speed/webp/";
87 license = licenses.bsd3;
88 platforms = platforms.all;
89 maintainers = with maintainers; [ ajs124 ];