mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-17 02:14:08 +00:00
4f0dadbf38
After final improvements to the official formatter implementation, this commit now performs the first treewide reformat of Nix files using it. This is part of the implementation of RFC 166. Only "inactive" files are reformatted, meaning only files that aren't being touched by any PR with activity in the past 2 months. This is to avoid conflicts for PRs that might soon be merged. Later we can do a full treewide reformat to get the rest, which should not cause as many conflicts. A CI check has already been running for some time to ensure that new and already-formatted files are formatted, so the files being reformatted here should also stay formatted. This commit was automatically created and can be verified using nix-builda08b3a4d19
.tar.gz \ --argstr baseRevb32a094368
result/bin/apply-formatting $NIXPKGS_PATH
57 lines
1.4 KiB
Nix
57 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
dtc,
|
|
pkgsCross,
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "spike";
|
|
version = "1.1.0-unstable-2024-09-21";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "riscv";
|
|
repo = "riscv-isa-sim";
|
|
rev = "de5094a1a901d77ff44f89b38e00fefa15d4018e";
|
|
sha256 = "sha256-mAgR2VzDgeuIdmPEgrb+MaA89BnWfmNanOVidqn0cgc=";
|
|
};
|
|
|
|
nativeBuildInputs = [ dtc ];
|
|
enableParallelBuilding = true;
|
|
|
|
postPatch = ''
|
|
patchShebangs scripts/*.sh
|
|
'';
|
|
|
|
doCheck = true;
|
|
|
|
# To test whether spike is working, we run the RISC-V hello applications using the RISC-V proxy
|
|
# kernel on the Spike emulator and see whether we get the expected output.
|
|
doInstallCheck = true;
|
|
installCheckPhase =
|
|
let
|
|
riscvPkgs = pkgsCross.riscv64-embedded;
|
|
in
|
|
''
|
|
runHook preInstallCheck
|
|
|
|
echo -e "#include<stdio.h>\nint main() {printf(\"Hello, world\");return 0;}" > hello.c
|
|
${riscvPkgs.stdenv.cc}/bin/${riscvPkgs.stdenv.cc.targetPrefix}cc -o hello hello.c
|
|
$out/bin/spike -m64 ${riscvPkgs.riscv-pk}/bin/pk hello | grep -Fq "Hello, world"
|
|
|
|
runHook postInstallCheck
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "RISC-V ISA Simulator";
|
|
homepage = "https://github.com/riscv/riscv-isa-sim";
|
|
license = licenses.bsd3;
|
|
platforms = [
|
|
"x86_64-linux"
|
|
"aarch64-linux"
|
|
];
|
|
maintainers = with maintainers; [ blitz ];
|
|
};
|
|
}
|