elf2uf2-rs: support darwin

This commit is contained in:
fortuneteller2k 2023-07-10 10:38:50 +08:00
parent 2a5f6cac35
commit 62b322de1c
2 changed files with 12 additions and 7 deletions

View file

@ -1,4 +1,4 @@
{ lib, stdenv, rustPlatform, fetchCrate, pkg-config, udev }: { lib, stdenv, rustPlatform, fetchCrate, pkg-config, udev, CoreFoundation, DiskArbitration, Foundation }:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "elf2uf2-rs"; pname = "elf2uf2-rs";
@ -13,9 +13,12 @@ rustPlatform.buildRustPackage rec {
pkg-config pkg-config
]; ];
buildInputs = [ buildInputs = lib.optional stdenv.isLinux udev
udev ++ lib.optionals stdenv.isDarwin [
]; CoreFoundation
DiskArbitration
Foundation
];
cargoSha256 = "sha256-+3Rqlzkrw9XfM3PelGNbnRGaWQLbzVJ7iJgvGgVt5FE="; cargoSha256 = "sha256-+3Rqlzkrw9XfM3PelGNbnRGaWQLbzVJ7iJgvGgVt5FE=";
@ -23,7 +26,7 @@ rustPlatform.buildRustPackage rec {
description = "Convert ELF files to UF2 for USB Flashing Bootloaders"; description = "Convert ELF files to UF2 for USB Flashing Bootloaders";
homepage = "https://github.com/JoNil/elf2uf2-rs"; homepage = "https://github.com/JoNil/elf2uf2-rs";
license = with licenses; [ bsd0 ]; license = with licenses; [ bsd0 ];
platforms = platforms.linux; platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ polygon ]; maintainers = with maintainers; [ polygon fortuneteller2k ];
}; };
} }

View file

@ -18747,7 +18747,9 @@ with pkgs;
electron-fiddle = callPackage ../development/tools/electron-fiddle { }; electron-fiddle = callPackage ../development/tools/electron-fiddle { };
elf2uf2-rs = callPackage ../development/embedded/elf2uf2-rs { }; elf2uf2-rs = darwin.apple_sdk_11_0.callPackage ../development/embedded/elf2uf2-rs {
inherit (darwin.apple_sdk_11_0.frameworks) CoreFoundation DiskArbitration Foundation;
};
elfinfo = callPackage ../development/tools/misc/elfinfo { }; elfinfo = callPackage ../development/tools/misc/elfinfo { };