Merge pull request #291591 from atorres1985-contrib/jasper

jasper: split outputs
This commit is contained in:
Guillaume Girol 2024-03-03 16:34:24 +01:00 committed by GitHub
commit 06a4249220
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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;