2023-01-05 02:09:00 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
2022-01-10 05:12:27 +01:00
|
|
|
, withPlatform ? "generic"
|
|
|
|
, withPayload ? null
|
|
|
|
, withFDT ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "opensbi";
|
2023-01-05 02:09:00 +01:00
|
|
|
version = "1.2";
|
2022-01-10 05:12:27 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "riscv-software-src";
|
|
|
|
repo = "opensbi";
|
|
|
|
rev = "v${version}";
|
2023-01-05 02:09:00 +01:00
|
|
|
sha256 = "sha256-Zcl+SE2nySMycV/ozsl4AvGipRsMblA5mt3oVZ81Z44=";
|
2022-01-10 05:12:27 +01:00
|
|
|
};
|
|
|
|
|
2022-06-26 03:52:27 +02:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs ./scripts
|
|
|
|
'';
|
|
|
|
|
2023-01-05 02:09:00 +01:00
|
|
|
nativeBuildInputs = [ python3 ];
|
|
|
|
|
2022-01-10 05:12:27 +01:00
|
|
|
installFlags = [
|
|
|
|
"I=$(out)"
|
|
|
|
];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"PLATFORM=${withPlatform}"
|
|
|
|
] ++ lib.optionals (withPayload != null) [
|
|
|
|
"FW_PAYLOAD_PATH=${withPayload}"
|
|
|
|
] ++ lib.optionals (withFDT != null) [
|
|
|
|
"FW_FDT_PATH=${withFDT}"
|
|
|
|
];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
platforms = [ "riscv64-linux" ];
|
|
|
|
};
|
|
|
|
}
|