{ lib , stdenv , fetchFromGitHub , fetchzip , rocmUpdateScript , cmake , rocm-cmake , rocprim , hip , gfortran , git , gtest , boost , python3Packages , buildTests ? false , buildBenchmarks ? false # Seems to depend on tests }: stdenv.mkDerivation (finalAttrs: { pname = "rocsparse"; version = "5.4.2"; outputs = [ "out" ] ++ lib.optionals (buildTests || buildBenchmarks) [ "test" ] ++ lib.optionals buildBenchmarks [ "benchmark" ]; src = fetchFromGitHub { owner = "ROCmSoftwarePlatform"; repo = "rocSPARSE"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-paibzXYvRnd+4yYvteLf7EYmqeqWDc7BoDByfSMrhYo="; }; nativeBuildInputs = [ cmake rocm-cmake hip gfortran ]; buildInputs = [ rocprim git ] ++ lib.optionals (buildTests || buildBenchmarks) [ gtest boost python3Packages.python python3Packages.pyyaml ]; cmakeFlags = [ "-DCMAKE_CXX_COMPILER=hipcc" # Manually define CMAKE_INSTALL_