From 7256875a69edd779aebb47fb63af5182ba194635 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Thu, 3 Oct 2024 21:20:54 -0500 Subject: [PATCH] wchisp: init at 0.3.0 --- pkgs/by-name/wc/wchisp/package.nix | 47 ++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 pkgs/by-name/wc/wchisp/package.nix diff --git a/pkgs/by-name/wc/wchisp/package.nix b/pkgs/by-name/wc/wchisp/package.nix new file mode 100644 index 000000000000..e70565ca4578 --- /dev/null +++ b/pkgs/by-name/wc/wchisp/package.nix @@ -0,0 +1,47 @@ +{ + stdenv, + lib, + rustPlatform, + fetchCrate, + pkg-config, + libusb1, + nix-update-script, + testers, + wchisp, +}: + +rustPlatform.buildRustPackage rec { + pname = "wchisp"; + version = "0.3.0"; + + src = fetchCrate { + inherit pname version; + hash = "sha256-6WNXsRvbldEjAykMn1DCiuKctBrsTHGv1fJuRXBblu0="; + }; + + cargoHash = "sha256-5kJ0MK0rUzyJvLZH/3nje+gTAM6et0mNE3sxVoK1L5s="; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ + libusb1 + ]; + + passthru = { + updateScript = nix-update-script { }; + tests.version = testers.testVersion { + package = wchisp; + }; + }; + + meta = with lib; { + description = "A command-line implementation of WCHISPTool, for flashing ch32 MCUs"; + homepage = "https://ch32-rs.github.io/wchisp/"; + changelog = "https://github.com/ch32-rs/wchisp/releases/tag/v${version}"; + license = with licenses; [ gpl2Only ]; + platforms = with platforms; linux ++ darwin ++ windows; + broken = !stdenv.hostPlatform.isLinux; + maintainers = with maintainers; [ jwillikers ]; + mainProgram = "wchisp"; + }; +}