2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config }:
|
2021-01-05 17:05:55 +00:00
|
|
|
|
|
|
|
let
|
2021-02-05 17:12:51 +00:00
|
|
|
inherit (lib) optionals;
|
2021-01-05 17:05:55 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "raspberrypi-armstubs";
|
|
|
|
version = "2020-10-08";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "raspberrypi";
|
|
|
|
repo = "tools";
|
|
|
|
rev = "fc0e73c13865450e95edd046200e42a6e52d8256";
|
|
|
|
sha256 = "1g6ikpjcrm5x0rk5aiwjdd8grf997qkvgamcrdxy6k9ln746h25s";
|
|
|
|
};
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = [
|
|
|
|
"-march=armv8-a+crc"
|
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
cd armstubs
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"CC8=${stdenv.cc.targetPrefix}cc"
|
|
|
|
"LD8=${stdenv.cc.targetPrefix}ld"
|
|
|
|
"OBJCOPY8=${stdenv.cc.targetPrefix}objcopy"
|
|
|
|
"OBJDUMP8=${stdenv.cc.targetPrefix}objdump"
|
2021-01-15 22:18:51 +00:00
|
|
|
"CC7=${stdenv.cc.targetPrefix}cc"
|
|
|
|
"LD7=${stdenv.cc.targetPrefix}ld"
|
|
|
|
"OBJCOPY7=${stdenv.cc.targetPrefix}objcopy"
|
|
|
|
"OBJDUMP7=${stdenv.cc.targetPrefix}objdump"
|
2021-01-05 17:05:55 +00:00
|
|
|
]
|
|
|
|
++ optionals (stdenv.isAarch64) [ "armstub8.bin" "armstub8-gic.bin" ]
|
|
|
|
++ optionals (stdenv.isAarch32) [ "armstub7.bin" "armstub8-32.bin" "armstub8-32-gic.bin" ]
|
|
|
|
;
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -vp $out/
|
|
|
|
cp -v *.bin $out/
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2021-01-05 17:05:55 +00:00
|
|
|
description = "Firmware related ARM stubs for the Raspberry Pi";
|
|
|
|
homepage = https://github.com/raspberrypi/tools;
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = [ "armv6l-linux" "armv7l-linux" "aarch64-linux" ];
|
|
|
|
maintainers = with maintainers; [ samueldr ];
|
|
|
|
};
|
|
|
|
}
|