Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / misc / opensbi / default.nix
blob172e28c056697ab237c3b02f2ce1c872f3aea7a9
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , python3
5 , withPlatform ? "generic"
6 , withPayload ? null
7 , withFDT ? null
8 }:
10 stdenv.mkDerivation rec {
11   pname = "opensbi";
12   version = "1.5";
14   src = fetchFromGitHub {
15     owner = "riscv-software-src";
16     repo = "opensbi";
17     rev = "v${version}";
18     hash = "sha256-vK14P97FcaVz4GDr/0055Z6s/k7BPKPQGZ/MQxbOWu0=";
19   };
21   postPatch = ''
22     patchShebangs ./scripts
23   '';
25   nativeBuildInputs = [ python3 ];
27   installFlags = [
28     "I=$(out)"
29   ];
31   makeFlags = [
32     "PLATFORM=${withPlatform}"
33   ] ++ lib.optionals (withPayload != null) [
34     "FW_PAYLOAD_PATH=${withPayload}"
35   ] ++ lib.optionals (withFDT != null) [
36     "FW_FDT_PATH=${withFDT}"
37   ];
39   enableParallelBuilding = true;
41   dontStrip = true;
42   dontPatchELF = true;
44   meta = with lib; {
45     description = "RISC-V Open Source Supervisor Binary Interface";
46     homepage = "https://github.com/riscv-software-src/opensbi";
47     license = licenses.bsd2;
48     maintainers = with maintainers; [ ius nickcao zhaofengli ];
49     platforms = [ "riscv64-linux" "riscv32-linux" ];
50   };