nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 rustPlatform,
5 fetchCrate,
6 pkg-config,
7 libusb1,
8 udev,
9 nix-update-script,
10 versionCheckHook,
11}:
12
13rustPlatform.buildRustPackage rec {
14 pname = "wlink";
15 version = "0.1.1";
16
17 src = fetchCrate {
18 inherit pname version;
19 hash = "sha256-YxozhEJh/KBirlA6ymIEbJY3r7wYSeTL40W2xQLyue0=";
20 };
21
22 cargoHash = "sha256-Hv+W8yFw6zAKwrV6gf9fWOkR/LFNgAD7WwQsHBqTnPI=";
23
24 nativeBuildInputs = [ pkg-config ];
25
26 buildInputs = [
27 libusb1
28 udev
29 ];
30
31 doInstallCheck = true;
32 nativeInstallCheckInputs = [ versionCheckHook ];
33
34 passthru = {
35 updateScript = nix-update-script { };
36 };
37
38 meta = {
39 description = "WCH-Link flash tool for WCH's RISC-V MCUs(CH32V, CH56X, CH57X, CH58X, CH59X, CH32L103, CH32X035, CH641, CH643)";
40 homepage = "https://github.com/ch32-rs/wlink";
41 changelog = "https://github.com/ch32-rs/wlink/releases/tag/v${version}";
42 license = with lib.licenses; [
43 mit # or
44 asl20
45 ];
46 platforms = with lib.platforms; linux ++ darwin ++ windows;
47 broken = !stdenv.hostPlatform.isLinux;
48 maintainers = with lib.maintainers; [ jwillikers ];
49 mainProgram = "wlink";
50 };
51}