From 909c4914937137a5b19a42a78eb9252e7ce2b3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Mancilla?= Date: Sun, 18 Aug 2024 19:25:14 -0400 Subject: [PATCH] libwebp: build with CMake --- .../development/libraries/libwebp/default.nix | 37 ++++++------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/pkgs/development/libraries/libwebp/default.nix b/pkgs/development/libraries/libwebp/default.nix index cf2285c7368f..abd1e1bd9afe 100644 --- a/pkgs/development/libraries/libwebp/default.nix +++ b/pkgs/development/libraries/libwebp/default.nix @@ -2,8 +2,7 @@ lib, stdenv, fetchFromGitHub, - autoreconfHook, - libtool, + cmake, threadingSupport ? true, # multi-threading openglSupport ? false, libglut, @@ -17,12 +16,8 @@ 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, @@ -47,25 +42,19 @@ stdenv.mkDerivation rec { hash = "sha256-OR/VzKNn3mnwjf+G+RkEGAaaKrhVlAu1e2oTRwdsPj8="; }; - configureFlags = [ - (lib.enableFeature threadingSupport "threading") - (lib.enableFeature openglSupport "gl") - (lib.enableFeature pngSupport "png") - (lib.enableFeature jpegSupport "jpeg") - (lib.enableFeature tiffSupport "tiff") - (lib.enableFeature gifSupport "gif") - (lib.enableFeature alignedSupport "aligned") - (lib.enableFeature swap16bitcspSupport "swap-16bit-csp") - (lib.enableFeature experimentalSupport "experimental") - (lib.enableFeature libwebpmuxSupport "libwebpmux") - (lib.enableFeature libwebpdemuxSupport "libwebpdemux") - (lib.enableFeature libwebpdecoderSupport "libwebpdecoder") + cmakeFlags = [ + (lib.cmakeBool "BUILD_SHARED_LIBS" true) + (lib.cmakeBool "WEBP_USE_THREAD" threadingSupport) + (lib.cmakeBool "WEBP_BUILD_VWEBP" openglSupport) + (lib.cmakeBool "WEBP_BUILD_IMG2WEBP" (pngSupport || jpegSupport || tiffSupport)) + (lib.cmakeBool "WEBP_BUILD_GIF2WEBP" gifSupport) + (lib.cmakeBool "WEBP_BUILD_ANIM_UTILS" false) # Not installed + (lib.cmakeBool "WEBP_BUILD_EXTRAS" false) # Not installed + (lib.cmakeBool "WEBP_ENABLE_SWAP_16BIT_CSP" swap16bitcspSupport) + (lib.cmakeBool "WEBP_BUILD_LIBWEBPMUX" libwebpmuxSupport) ]; - nativeBuildInputs = [ - autoreconfHook - libtool - ]; + nativeBuildInputs = [ cmake ]; buildInputs = [ ] ++ lib.optionals openglSupport [ @@ -78,8 +67,6 @@ stdenv.mkDerivation rec { ++ lib.optionals tiffSupport [ libtiff ] ++ lib.optionals gifSupport [ giflib ]; - enableParallelBuilding = true; - passthru.tests = { inherit gd