diff --git a/pkgs/development/libraries/opensubdiv/default.nix b/pkgs/development/libraries/opensubdiv/default.nix index b253a27a7db3..f5f84ee15463 100644 --- a/pkgs/development/libraries/opensubdiv/default.nix +++ b/pkgs/development/libraries/opensubdiv/default.nix @@ -39,7 +39,16 @@ stdenv.mkDerivation { enableParallelBuilding = true; - postInstall = "rm $out/lib/*.a"; + postInstall = + '' + rm $out/lib/*.a + '' + lib.optionalString cudaSupport '' + # Drop cudatoolkit reference from the closure. We'll get + # libOpenCL from /run/opengl-driver. + s=${cudatoolkit}/lib + t=$(for ((i = 0; i < ''${#s}; i++)); do echo -n X; done) + sed -i $out/lib/libosdGPU.so.* -e "s|$s|$t|g" + ''; meta = { description = "An Open-Source subdivision surface library";