Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 24.05-beta 77 lines 2.5 kB view raw
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 14 15# for passthru.tests 16, freeimage 17, gd 18, graphicsmagick 19, haskellPackages 20, imagemagick 21, imlib2 22, libjxl 23, opencv 24, python3 25, vips 26}: 27 28stdenv.mkDerivation rec { 29 pname = "libwebp"; 30 version = "1.4.0"; 31 32 src = fetchFromGitHub { 33 owner = "webmproject"; 34 repo = pname; 35 rev = "v${version}"; 36 hash = "sha256-OR/VzKNn3mnwjf+G+RkEGAaaKrhVlAu1e2oTRwdsPj8="; 37 }; 38 39 configureFlags = [ 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") 52 ]; 53 54 nativeBuildInputs = [ autoreconfHook libtool ]; 55 buildInputs = [ ] 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 ]; 61 62 enableParallelBuilding = true; 63 64 passthru.tests = { 65 inherit gd graphicsmagick imagemagick imlib2 libjxl opencv vips; 66 inherit (python3.pkgs) pillow imread; 67 haskell-webp = haskellPackages.webp; 68 }; 69 70 meta = with lib; { 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 ]; 76 }; 77}