2023-01-20 10:41:00 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, libusb1, pkg-config }:
|
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";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "20221215-105525";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "raspberrypi";
|
|
|
|
repo = "usbboot";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = version;
|
|
|
|
hash = "sha256-Y77IrDblXmnpZleJ3zTyiGDYLZ7gNxASXpqUzwS1NCU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
buildInputs = [ libusb1 ];
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "rpiboot";
|
2020-12-29 15:07:52 +00:00
|
|
|
license = licenses.asl20;
|
2023-01-20 10:41:00 +00:00
|
|
|
maintainers = with maintainers; [ cartr flokli ];
|
2022-05-18 14:49:53 +00:00
|
|
|
platforms = [ "aarch64-linux" "aarch64-darwin" "armv7l-linux" "armv6l-linux" "x86_64-linux" "x86_64-darwin" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|