opencv: remove CUDA toolkit (#419716)

This commit is contained in:
Connor Baker
2025-06-25 15:11:54 -07:00
committed by GitHub
7 changed files with 8 additions and 12 deletions
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
buildInputs = [
obs-studio
onnxruntime
opencv
opencv.cxxdev
qt6.qtbase
curl
];
+1 -1
View File
@@ -106,7 +106,7 @@ stdenv.mkDerivation rec {
webkitgtk_4_0
wxGTK'
xorg.libX11
opencv
opencv.cxxdev
]
++ lib.optionals withSystemd [ systemd ]
++ checkInputs;
+1 -1
View File
@@ -57,7 +57,7 @@ stdenv.mkDerivation {
libGL
lz4
magic-enum
opencv
opencv.cxxdev
tbb
xorg.libX11
];
+1 -1
View File
@@ -116,7 +116,7 @@ stdenv.mkDerivation (finalAttrs: {
webkitgtk_4_0
wxGTK'
xorg.libX11
opencv
opencv.cxxdev
libnoise
]
++ lib.optionals withSystemd [ systemd ]
+1 -1
View File
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
buildInputs = [
exiv2
mpv
opencv4
opencv4.cxxdev
libsForQt5.qtbase
libsForQt5.qtimageformats
libsForQt5.qtsvg
+1 -1
View File
@@ -129,7 +129,7 @@ stdenv.mkDerivation (finalAttrs: {
flatbuffers
llvm_18
libSM
opencv
opencv.cxxdev
cubeb
]
++ lib.optional faudioSupport faudio
+2 -6
View File
@@ -585,17 +585,13 @@ effectiveStdenv.mkDerivation {
mkdir -p "$cxxdev/nix-support"
echo "''${!outputDev}" >> "$cxxdev/nix-support/propagated-build-inputs"
''
# hard-wire CUDA_TOOLKIT_ROOT_DIR so FindCUDA sees the toolkit
# remove the requirement that the exact same version of CUDA is used in packages
# consuming OpenCV's CMakes files
# consuming OpenCV's CMakes files
+ optionalString enableCuda ''
sed -i '1s;^;set(CUDA_TOOLKIT_ROOT_DIR ${cudaPackages.cudatoolkit})\n;' \
"$out/lib/cmake/opencv4/OpenCVConfig.cmake"
substituteInPlace "$out/lib/cmake/opencv4/OpenCVConfig.cmake" \
--replace-fail \
'find_host_package(CUDA ''${OpenCV_CUDA_VERSION} EXACT REQUIRED)' \
'find_host_package(CUDA REQUIRED)' \
'find_host_package(CUDAToolkit REQUIRED)' \
--replace-fail \
'message(FATAL_ERROR "OpenCV static library was compiled with CUDA' \
'message("OpenCV static library was compiled with CUDA'