{ lib, stdenv, fetchFromGitHub, rocmUpdateScript, cmake, rocm-cmake, clr, rocrand, gtest, buildTests ? false, gpuTargets ? [ ], }: stdenv.mkDerivation (finalAttrs: { pname = "hiprand"; version = "6.4.3"; outputs = [ "out" ] ++ lib.optionals buildTests [ "test" ]; src = fetchFromGitHub { owner = "ROCm"; repo = "hipRAND"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-f/AWDV7vkjt8BnjhLwT2m1Y6dlZy054+z6J0UW9Glg8="; }; nativeBuildInputs = [ cmake rocm-cmake clr ]; buildInputs = [ rocrand ] ++ (lib.optionals buildTests [ gtest ]); cmakeFlags = [ "-DHIP_ROOT_DIR=${clr}" # Manually define CMAKE_INSTALL_