ysyx-workbench/nemu/default.nix
xinyangli d5feb71b50
Some checks failed
Build abstract machine with nix / build-abstract-machine (push) Failing after 7m47s
nemu: try difftest
2024-03-26 01:53:17 +08:00

63 lines
1,003 B
Nix

{ pkgs,
lib,
stdenv,
am-kernels,
dtc
}:
stdenv.mkDerivation rec {
pname = "nemu";
version = "2024-03-02";
src = ./.;
nativeBuildInputs = with pkgs; [
gnumake
pkg-config
flex
bison
dtc
];
buildInputs = with pkgs; [
readline
libllvm
];
checkInputs = [
pkgs.check
am-kernels
];
configurePhase = ''
export NEMU_HOME=$(pwd)
make alldefconfig
'';
buildPhase = ''
make
'';
doCheck = true;
checkPhase = ''
export IMAGES_PATH=${am-kernels}/share/binary
make test
'';
installPhase = ''
mkdir -p $out/bin
make PREFIX=$out install
'';
shellHook = ''
export NEMU_HOME=$(pwd)
export IMAGES_PATH=${am-kernels}/share/binary
'';
meta = with lib; {
description = "NJU EMUlator, a full system x86/mips32/riscv32/riscv64 emulator for teaching";
homepage = "https://github.com/NJU-ProjectN/nemu.git";
license = with licenses; [ ];
maintainers = with maintainers; [ ];
};
}