From 62b322de1ccc9135aff0c60589b6bc6affce7438 Mon Sep 17 00:00:00 2001 From: fortuneteller2k Date: Mon, 10 Jul 2023 10:38:50 +0800 Subject: [PATCH] elf2uf2-rs: support darwin --- pkgs/development/embedded/elf2uf2-rs/default.nix | 15 +++++++++------ pkgs/top-level/all-packages.nix | 4 +++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/pkgs/development/embedded/elf2uf2-rs/default.nix b/pkgs/development/embedded/elf2uf2-rs/default.nix index 3b6255683c8c..d26c0072265c 100644 --- a/pkgs/development/embedded/elf2uf2-rs/default.nix +++ b/pkgs/development/embedded/elf2uf2-rs/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, rustPlatform, fetchCrate, pkg-config, udev }: +{ lib, stdenv, rustPlatform, fetchCrate, pkg-config, udev, CoreFoundation, DiskArbitration, Foundation }: rustPlatform.buildRustPackage rec { pname = "elf2uf2-rs"; @@ -13,9 +13,12 @@ rustPlatform.buildRustPackage rec { pkg-config ]; - buildInputs = [ - udev - ]; + buildInputs = lib.optional stdenv.isLinux udev + ++ lib.optionals stdenv.isDarwin [ + CoreFoundation + DiskArbitration + Foundation + ]; cargoSha256 = "sha256-+3Rqlzkrw9XfM3PelGNbnRGaWQLbzVJ7iJgvGgVt5FE="; @@ -23,7 +26,7 @@ rustPlatform.buildRustPackage rec { description = "Convert ELF files to UF2 for USB Flashing Bootloaders"; homepage = "https://github.com/JoNil/elf2uf2-rs"; license = with licenses; [ bsd0 ]; - platforms = platforms.linux; - maintainers = with maintainers; [ polygon ]; + platforms = platforms.linux ++ platforms.darwin; + maintainers = with maintainers; [ polygon fortuneteller2k ]; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 75f7c262c4da..360e50a94fc4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -18747,7 +18747,9 @@ with pkgs; 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 { };