2021-03-12 03:07:28 +03:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook, payload ? null }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "riscv-pk";
|
|
|
|
version = "1.0.0";
|
2018-02-19 02:11:03 +03:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "riscv";
|
|
|
|
repo = "riscv-pk";
|
2021-03-12 03:07:28 +03:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1cc0rz4q3a1zw8756b8yysw8lb5g4xbjajh5lvqbjix41hbdx6xz";
|
2018-02-19 02:11:03 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureScript = "../configure";
|
|
|
|
|
2021-01-15 16:21:58 +03:00
|
|
|
configureFlags = lib.optional (payload != null)
|
2018-02-19 20:37:46 +03:00
|
|
|
"--with-payload=${payload}";
|
|
|
|
|
2018-02-19 02:11:03 +03:00
|
|
|
hardeningDisable = [ "all" ];
|
|
|
|
|
2018-02-20 18:29:43 +03:00
|
|
|
postInstall = ''
|
|
|
|
mv $out/* $out/.cleanup
|
|
|
|
mv $out/.cleanup/* $out
|
|
|
|
rmdir $out/.cleanup
|
|
|
|
'';
|
|
|
|
|
2018-02-19 02:11:03 +03:00
|
|
|
meta = {
|
2020-10-11 08:55:05 +03:00
|
|
|
description = "RISC-V Proxy Kernel and Bootloader";
|
2020-04-01 04:11:51 +03:00
|
|
|
homepage = "https://github.com/riscv/riscv-pk";
|
2021-01-15 16:21:58 +03:00
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
platforms = lib.platforms.riscv;
|
|
|
|
maintainers = [ lib.maintainers.shlevy ];
|
2018-02-19 02:11:03 +03:00
|
|
|
};
|
|
|
|
}
|