libwebp: format

This commit is contained in:
Sebastián Mancilla
2024-08-25 23:17:56 -04:00
parent ba8924e6a0
commit a9a9833f01
+59 -31
View File
@@ -1,27 +1,39 @@
{ 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
# for passthru.tests
gd,
graphicsmagick,
haskellPackages,
imagemagick,
imlib2,
libjxl,
opencv,
python3,
vips,
}:
stdenv.mkDerivation rec {
@@ -29,10 +41,10 @@ stdenv.mkDerivation rec {
version = "1.4.0";
src = fetchFromGitHub {
owner = "webmproject";
repo = pname;
rev = "v${version}";
hash = "sha256-OR/VzKNn3mnwjf+G+RkEGAaaKrhVlAu1e2oTRwdsPj8=";
owner = "webmproject";
repo = "libwebp";
rev = "v${version}";
hash = "sha256-OR/VzKNn3mnwjf+G+RkEGAaaKrhVlAu1e2oTRwdsPj8=";
};
configureFlags = [
@@ -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;
};