Commit a9a9833f authored by Sebastián Mancilla's avatar Sebastián Mancilla
Browse files

libwebp: format

parent ba8924e6
Loading
Loading
Loading
Loading
+59 −31
Original line number Diff line number Diff line
{ lib, stdenv, fetchFromGitHub, autoreconfHook, libtool
, threadingSupport ? true # multi-threading
, openglSupport ? false, libglut, libGL, libGLU # OpenGL (required for vwebp)
, pngSupport ? true, libpng # PNG image format
, jpegSupport ? true, libjpeg # JPEG image format
, tiffSupport ? true, libtiff # TIFF image format
, gifSupport ? true, giflib # GIF image format
, 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
{
  lib,
  stdenv,
  fetchFromGitHub,
  autoreconfHook,
  libtool,
  threadingSupport ? true, # multi-threading
  openglSupport ? false,
  libglut,
  libGL,
  libGLU, # OpenGL (required for vwebp)
  pngSupport ? true,
  libpng, # PNG image format
  jpegSupport ? true,
  libjpeg, # JPEG image format
  tiffSupport ? true,
  libtiff, # TIFF image format
  gifSupport ? true,
  giflib, # GIF image format
  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

  # for passthru.tests
, gd
, graphicsmagick
, haskellPackages
, imagemagick
, imlib2
, libjxl
, opencv
, python3
, vips
  gd,
  graphicsmagick,
  haskellPackages,
  imagemagick,
  imlib2,
  libjxl,
  opencv,
  python3,
  vips,
}:

stdenv.mkDerivation rec {
@@ -30,7 +42,7 @@ stdenv.mkDerivation rec {

  src = fetchFromGitHub {
    owner = "webmproject";
    repo   = pname;
    repo = "libwebp";
    rev = "v${version}";
    hash = "sha256-OR/VzKNn3mnwjf+G+RkEGAaaKrhVlAu1e2oTRwdsPj8=";
  };
@@ -50,9 +62,17 @@ stdenv.mkDerivation rec {
    (lib.enableFeature libwebpdecoderSupport "libwebpdecoder")
  ];

  nativeBuildInputs = [ autoreconfHook libtool ];
  buildInputs = [ ]
    ++ lib.optionals openglSupport [ libglut libGL libGLU ]
  nativeBuildInputs = [
    autoreconfHook
    libtool
  ];
  buildInputs =
    [ ]
    ++ lib.optionals openglSupport [
      libglut
      libGL
      libGLU
    ]
    ++ lib.optionals pngSupport [ libpng ]
    ++ lib.optionals jpegSupport [ libjpeg ]
    ++ lib.optionals tiffSupport [ libtiff ]
@@ -61,7 +81,15 @@ stdenv.mkDerivation rec {
  enableParallelBuilding = true;

  passthru.tests = {
    inherit gd graphicsmagick imagemagick imlib2 libjxl opencv vips;
    inherit
      gd
      graphicsmagick
      imagemagick
      imlib2
      libjxl
      opencv
      vips
      ;
    inherit (python3.pkgs) pillow imread;
    haskell-webp = haskellPackages.webp;
  };