opencv: Use OpenJPEG from nixpkgs instead of vendored copy

This commit is contained in:
Kevin Mehall 2022-07-25 21:27:33 +00:00
parent 41400115e0
commit b21e1b5d1a

View File

@ -25,6 +25,8 @@
, enableEXR ? !stdenv.isDarwin , enableEXR ? !stdenv.isDarwin
, openexr , openexr
, ilmbase , ilmbase
, enableJPEG2000 ? true
, openjpeg
, enableEigen ? true , enableEigen ? true
, eigen , eigen
, enableOpenblas ? true , enableOpenblas ? true
@ -255,6 +257,7 @@ stdenv.mkDerivation {
++ lib.optional enableTIFF libtiff ++ lib.optional enableTIFF libtiff
++ lib.optional enableWebP libwebp ++ lib.optional enableWebP libwebp
++ lib.optionals enableEXR [ openexr ilmbase ] ++ lib.optionals enableEXR [ openexr ilmbase ]
++ lib.optional enableJPEG2000 openjpeg
++ lib.optional enableFfmpeg ffmpeg ++ lib.optional enableFfmpeg ffmpeg
++ lib.optionals (enableFfmpeg && stdenv.isDarwin) ++ lib.optionals (enableFfmpeg && stdenv.isDarwin)
[ VideoDecodeAcceleration bzip2 ] [ VideoDecodeAcceleration bzip2 ]
@ -302,6 +305,8 @@ stdenv.mkDerivation {
(opencvFlag "JPEG" enableJPEG) (opencvFlag "JPEG" enableJPEG)
(opencvFlag "PNG" enablePNG) (opencvFlag "PNG" enablePNG)
(opencvFlag "OPENEXR" enableEXR) (opencvFlag "OPENEXR" enableEXR)
(opencvFlag "OPENJPEG" enableJPEG2000)
"-DWITH_JASPER=OFF" # OpenCV falls back to a vendored copy of Jasper when OpenJPEG is disabled
(opencvFlag "CUDA" enableCuda) (opencvFlag "CUDA" enableCuda)
(opencvFlag "CUBLAS" enableCuda) (opencvFlag "CUBLAS" enableCuda)
(opencvFlag "TBB" enableTbb) (opencvFlag "TBB" enableTbb)