2023-01-20 10:41:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
2022-01-25 03:21:06 +00:00
|
|
|
, withPlatform ? "generic"
|
|
|
|
, withPayload ? null
|
|
|
|
, withFDT ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "opensbi";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "1.4";
|
2022-01-25 03:21:06 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "riscv-software-src";
|
|
|
|
repo = "opensbi";
|
|
|
|
rev = "v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-T8ZeAzjM9aeTXitjE7s+m+jjGGtDo2jK1qO5EuKiVLU=";
|
2022-01-25 03:21:06 +00:00
|
|
|
};
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs ./scripts
|
|
|
|
'';
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
nativeBuildInputs = [ python3 ];
|
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
installFlags = [
|
|
|
|
"I=$(out)"
|
|
|
|
];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"PLATFORM=${withPlatform}"
|
|
|
|
] ++ lib.optionals (withPayload != null) [
|
|
|
|
"FW_PAYLOAD_PATH=${withPayload}"
|
|
|
|
] ++ lib.optionals (withFDT != null) [
|
|
|
|
"FW_FDT_PATH=${withFDT}"
|
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
dontStrip = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "RISC-V Open Source Supervisor Binary Interface";
|
|
|
|
homepage = "https://github.com/riscv-software-src/opensbi";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
maintainers = with maintainers; [ ius nickcao zhaofengli ];
|
2024-01-02 11:29:13 +00:00
|
|
|
platforms = [ "riscv64-linux" "riscv32-linux" ];
|
2022-01-25 03:21:06 +00:00
|
|
|
};
|
|
|
|
}
|