···1+{ lib, stdenv, fetchgit, dtc, fetchpatch }:
23stdenv.mkDerivation rec {
4 pname = "spike";
···2829 doCheck = true;
3031+ # To test whether spike is working, we run the RISC-V hello applications using the RISC-V proxy
32+ # kernel on the Spike emulator and see whether we get the expected output.
33+ doInstallCheck = true;
34+ installCheckPhase =
35+ let
36+ riscvPkgs = import ../../../.. { crossSystem = lib.systems.examples.riscv64-embedded; };
37+ in
38+ ''
39+ runHook preInstallCheck
40+41+ $out/bin/spike -m64 ${riscvPkgs.riscv-pk}/bin/pk ${riscvPkgs.hello}/bin/hello | grep -Fq "Hello, world"
42+43+ runHook postInstallCheck
44+ '';
4546 meta = with lib; {
47 description = "A RISC-V ISA Simulator";