From c91300cf577d1463d3becb22831cf310606c69b8 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Mon, 26 Feb 2024 12:35:15 -0300 Subject: [PATCH] jasper: split outputs - enable extras: HEIF, JPG, OpenGL --- pkgs/by-name/ja/jasper/package.nix | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ja/jasper/package.nix b/pkgs/by-name/ja/jasper/package.nix index 42cce508a545..cd61d3b9be52 100644 --- a/pkgs/by-name/ja/jasper/package.nix +++ b/pkgs/by-name/ja/jasper/package.nix @@ -1,8 +1,15 @@ { lib -, stdenv -, fetchFromGitHub , cmake +, fetchFromGitHub +, freeglut +, libGL +, libheif +, libjpeg , pkg-config +, stdenv +, enableHEIFCodec ? true +, enableJPGCodec ? true +, enableOpenGL ? true }: stdenv.mkDerivation (finalAttrs: { @@ -16,18 +23,34 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-SE3zB+8zZuuT+W6QYTuQhM+dBgYuFzYK4a7QaquGB60="; }; - outputs = [ "out" "doc" "man" ]; + outputs = [ "out" "dev" "doc" "lib" "man" ]; nativeBuildInputs = [ cmake pkg-config ]; + buildInputs = [ + ] ++ lib.optionals enableHEIFCodec [ + libheif + ] ++ lib.optionals enableJPGCodec [ + libjpeg + ] ++ lib.optionals enableOpenGL [ + freeglut + libGL + ]; + # Since "build" already exists and is populated, cmake tries to use it, # throwing uncomprehensible error messages... cmakeBuildDir = "build-directory"; cmakeFlags = [ (lib.cmakeBool "ALLOW_IN_SOURCE_BUILD" true) + (lib.cmakeBool "JAS_ENABLE_HEIC_CODEC" enableHEIFCodec) + (lib.cmakeBool "JAS_INCLUDE_HEIC_CODEC" enableHEIFCodec) + (lib.cmakeBool "JAS_ENABLE_JPG_CODEC" enableJPGCodec) + (lib.cmakeBool "JAS_INCLUDE_JPG_CODEC" enableJPGCodec) + (lib.cmakeBool "JAS_ENABLE_MIF_CODEC" false) # Dangerous! + (lib.cmakeBool "JAS_ENABLE_OPENGL" enableOpenGL) ]; strictDeps = true; @@ -53,6 +76,7 @@ stdenv.mkDerivation (finalAttrs: { for most computing platforms when JasPer was first developed, circa 1999. ''; license = lib.licenses.mit; + mainProgram = "jasper"; maintainers = with lib.maintainers; [ AndersonTorres ]; platforms = lib.platforms.unix;