2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, libusb1 }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-12-29 15:07:52 +00:00
|
|
|
pname = "rpiboot";
|
2021-08-05 21:33:18 +00:00
|
|
|
version = "2021.07.01";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "raspberrypi";
|
|
|
|
repo = "usbboot";
|
2021-08-05 21:33:18 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-BkNyYCrasfiRs7CbJa7tCo2k70TLGcXkOX+zGPyZGGE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ libusb1 ];
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
sed -i "s@/usr/@$out/@g" main.c
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mkdir -p $out/share/rpiboot
|
|
|
|
cp rpiboot $out/bin
|
|
|
|
cp -r msd $out/share/rpiboot
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/raspberrypi/usbboot";
|
2021-08-05 21:33:18 +00:00
|
|
|
description = "Utility to boot a Raspberry Pi CM/CM3/CM4/Zero over USB";
|
2020-12-29 15:07:52 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ cartr ];
|
|
|
|
platforms = [ "aarch64-linux" "armv7l-linux" "armv6l-linux" "x86_64-linux" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|