2024-03-03 15:05:05 +00:00
|
|
|
{ pkgs,
|
|
|
|
lib,
|
2024-03-06 04:06:16 +00:00
|
|
|
stdenv,
|
|
|
|
am-kernels
|
2024-03-03 15:05:05 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nemu";
|
|
|
|
version = "2024-03-02";
|
|
|
|
|
|
|
|
src = ./.;
|
|
|
|
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
gnumake
|
2024-03-06 04:25:16 +00:00
|
|
|
pkg-config
|
2024-03-03 15:05:05 +00:00
|
|
|
flex
|
|
|
|
bison
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
readline
|
|
|
|
libllvm
|
|
|
|
];
|
|
|
|
|
2024-03-06 04:06:16 +00:00
|
|
|
checkInputs = [
|
2024-03-06 04:15:20 +00:00
|
|
|
pkgs.check
|
2024-03-06 04:06:16 +00:00
|
|
|
am-kernels
|
|
|
|
];
|
|
|
|
|
2024-03-03 15:05:05 +00:00
|
|
|
configurePhase = ''
|
2024-03-05 10:21:57 +00:00
|
|
|
export NEMU_HOME=$(pwd)
|
2024-03-03 15:05:05 +00:00
|
|
|
make alldefconfig
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make
|
|
|
|
'';
|
|
|
|
|
2024-03-06 04:15:20 +00:00
|
|
|
doCheck = true;
|
2024-03-03 15:05:05 +00:00
|
|
|
checkPhase = ''
|
2024-03-06 04:30:31 +00:00
|
|
|
export IMAGES_PATH=${am-kernels}/share/images
|
2024-03-03 15:05:05 +00:00
|
|
|
make test
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
make PREFIX=$out install
|
|
|
|
'';
|
|
|
|
|
2024-03-06 04:30:31 +00:00
|
|
|
shellHook = ''
|
|
|
|
export NEMU_HOME=$(pwd)
|
|
|
|
export IMAGES_PATH=${am-kernels}/share/images
|
|
|
|
'';
|
|
|
|
|
2024-03-03 15:05:05 +00:00
|
|
|
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; [ ];
|
|
|
|
};
|
|
|
|
}
|