build: initial support for building nemu, am-kernels with nix
This commit is contained in:
parent
f9808d0a40
commit
3c7c5f060e
6 changed files with 139 additions and 123 deletions
49
nemu/default.nix
Normal file
49
nemu/default.nix
Normal file
|
@ -0,0 +1,49 @@
|
|||
{ pkgs,
|
||||
lib,
|
||||
stdenv
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "nemu";
|
||||
version = "2024-03-02";
|
||||
|
||||
src = ./.;
|
||||
|
||||
NEMU_HOME = "/build/nemu";
|
||||
nativeBuildInputs = with pkgs; [
|
||||
gnumake
|
||||
flex
|
||||
bison
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
check
|
||||
readline
|
||||
libllvm
|
||||
];
|
||||
|
||||
configurePhase = ''
|
||||
echo pwd=$(pwd)
|
||||
make alldefconfig
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
make
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
make test
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
make PREFIX=$out install
|
||||
'';
|
||||
|
||||
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; [ ];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue