From 7e845eda916d48ecd05978bdef1218c5d1195c28 Mon Sep 17 00:00:00 2001 From: rewine <1758075541@qq.com> Date: Sun, 27 Mar 2022 00:50:18 +0800 Subject: [PATCH] spike: 1.0.0 -> 1.1.0 --- .../virtualization/spike/default.nix | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/virtualization/spike/default.nix b/pkgs/applications/virtualization/spike/default.nix index cc2489356c5d..291328ee7fe8 100644 --- a/pkgs/applications/virtualization/spike/default.nix +++ b/pkgs/applications/virtualization/spike/default.nix @@ -1,27 +1,19 @@ -{ lib, stdenv, fetchFromGitHub, dtc, fetchpatch, pkgsCross }: +{ lib, stdenv, fetchFromGitHub, dtc, pkgsCross }: stdenv.mkDerivation rec { pname = "spike"; - version = "1.0.0"; + version = "1.1.0"; src = fetchFromGitHub { owner = "riscv"; repo = "riscv-isa-sim"; rev = "v${version}"; - sha256 = "1hcl01nj96s3rkz4mrq747s5lkw81lgdjdimb8b1b9h8qnida7ww"; + sha256 = "sha256-4D2Fezej0ioOOupw3kgMT5VLs+/jXQjwvek6v0AVMzI="; }; nativeBuildInputs = [ dtc ]; enableParallelBuilding = true; - patches = [ - # Add missing headers to fix build. - (fetchpatch { - url = "https://github.com/riscv/riscv-isa-sim/commit/b3855682c2d744c613d2ffd6b53e3f021ecea4f3.patch"; - sha256 = "1v1mpp4iddf5n4h3kmj65g075m7xc31bxww7gldnmgl607ma7cnl"; - }) - ]; - postPatch = '' patchShebangs scripts/*.sh patchShebangs tests/ebreak.py @@ -39,7 +31,9 @@ stdenv.mkDerivation rec { '' runHook preInstallCheck - $out/bin/spike -m64 ${riscvPkgs.riscv-pk}/bin/pk ${riscvPkgs.hello}/bin/hello | grep -Fq "Hello, world" + echo -e "#include\nint main() {printf(\"Hello, world\");return 0;}" > hello.c + ${riscvPkgs.stdenv.cc}/bin/riscv64-none-elf-gcc -o hello hello.c + $out/bin/spike -m64 ${riscvPkgs.riscv-pk}/bin/pk hello | grep -Fq "Hello, world" runHook postInstallCheck '';