{ lib, stdenv, fetchFromGitHub, rocmUpdateScript, cmake, rocm-cmake, clr, gtest, gbenchmark, buildTests ? false, buildBenchmarks ? false, gpuTargets ? clr.localGpuTargets or [ ], }: stdenv.mkDerivation (finalAttrs: { pname = "rocrand${clr.gpuArchSuffix}"; version = "7.2.3"; outputs = [ "out" ] ++ lib.optionals buildTests [ "test" ] ++ lib.optionals buildBenchmarks [ "benchmark" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "rocm-libraries"; rev = "rocm-${finalAttrs.version}"; sparseCheckout = [ "projects/rocrand" "shared" ]; hash = "sha256-tl++h7LSEXf0jWe007+RIRwYHdB6TKPDpzipj1Emew8="; }; sourceRoot = "${finalAttrs.src.name}/projects/rocrand"; nativeBuildInputs = [ cmake rocm-cmake clr ]; buildInputs = lib.optionals buildTests [ gtest ] ++ lib.optionals buildBenchmarks [ gbenchmark ]; cmakeFlags = [ "-DHIP_ROOT_DIR=${clr}" # Manually define CMAKE_INSTALL_