2021-08-06 21:57:35 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub }:
|
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";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "unstable-2022-07-11";
|
2021-01-05 17:05:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "raspberrypi";
|
|
|
|
repo = "tools";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "439b6198a9b340de5998dd14a26a0d9d38a6bcac";
|
|
|
|
hash = "sha512-KMHgj73eXHT++IE8DbCsFeJ87ngc9R3XxMUJy4Z3s4/MtMeB9zblADHkyJqz9oyeugeJTrDtuVETPBRo7M4Y8A==";
|
2021-01-05 17:05:55 +00:00
|
|
|
};
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString [
|
2021-01-05 17:05:55 +00:00
|
|
|
"-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 = ''
|
2021-08-06 21:57:35 +00:00
|
|
|
runHook preInstall
|
2021-01-05 17:05:55 +00:00
|
|
|
mkdir -vp $out/
|
|
|
|
cp -v *.bin $out/
|
2021-08-06 21:57:35 +00:00
|
|
|
runHook postInstall
|
2021-01-05 17:05:55 +00:00
|
|
|
'';
|
|
|
|
|
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";
|
2021-08-06 21:57:35 +00:00
|
|
|
homepage = "https://github.com/raspberrypi/tools";
|
2021-01-05 17:05:55 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = [ "armv6l-linux" "armv7l-linux" "aarch64-linux" ];
|
|
|
|
maintainers = with maintainers; [ samueldr ];
|
|
|
|
};
|
|
|
|
}
|